Lines Matching defs:List
70 /// let mut list = List::new();
128 /// let mut list2 = List::new();
180 /// let mut list = List::<DTWrap<dyn Foo>>::new();
246 /// let mut list2 = List::<DTWrap<dyn Foo>>::new();
263 pub struct List<T: ?Sized + ListItem<ID>, const ID: u64 = 0> {
270 unsafe impl<T, const ID: u64> Send for List<T, ID>
278 unsafe impl<T, const ID: u64> Sync for List<T, ID>
285 /// Implemented by types where a [`ListArc<Self>`] can be inserted into a [`List`].
327 /// This is called when an item is inserted into a [`List`].
466 impl<T: ?Sized + ListItem<ID>, const ID: u64> List<T, ID> {
678 // of `List`.
690 pub fn push_all_back(&mut self, other: &mut List<T, ID>) {
748 impl<T: ?Sized + ListItem<ID>, const ID: u64> Default for List<T, ID> {
750 List::new()
754 impl<T: ?Sized + ListItem<ID>, const ID: u64> Drop for List<T, ID> {
762 /// An iterator over a [`List`].
766 /// * There must be a [`List`] that is immutably borrowed for the duration of `'a`.
767 /// * The `current` pointer is null or points at a value in that [`List`].
768 /// * The `stop` pointer is equal to the `first` field of that [`List`].
810 /// A cursor into a [`List`].
820 /// use kernel::list::{List, ListArc, ListLinks};
846 /// fn remove_first(list: &mut List<ListItem>, value: u32) -> Option<ListArc<ListItem>> {
858 /// fn remove_last(list: &mut List<ListItem>, value: u32) -> Option<ListArc<ListItem>> {
871 /// fn remove_all(list: &mut List<ListItem>, value: u32) -> List<ListItem> {
872 /// let mut out = List::new();
886 /// fn insert_at(list: &mut List<ListItem>, new: ListArc<ListItem>, idx: usize) -> Result {
898 /// fn merge_sorted(list: &mut List<ListItem>, merge: List<ListItem>) {
911 /// let mut list = List::new();
927 /// let mut list2 = List::new();
946 list: &'a mut List<T, ID>,
1130 // access to the `CursorPeek`, the `Cursor` or the `List`. However, the `ArcBorrow` holds
1132 // `Cursor`, which in turn holds a mutable borrow on the `List`, so any such mutable
1156 // access to the `CursorPeek`, the `Cursor` or the `List`. However, the `&T` holds an
1158 // `Cursor`, which in turn holds a mutable borrow on the `List`, so any such mutable access
1166 impl<'a, T: ?Sized + ListItem<ID>, const ID: u64> IntoIterator for &'a List<T, ID> {
1175 /// An owning iterator into a [`List`].
1177 list: List<T, ID>,
1196 impl<T: ?Sized + ListItem<ID>, const ID: u64> IntoIterator for List<T, ID> {