Lines Matching refs:ListLinks

33 /// * If the list is empty, then `first` is null. Otherwise, `first` points at the `ListLinks`

35 /// * All prev/next pointers in `ListLinks` fields of items in the list are valid and form a cycle.
37 /// exclusive access to the `ListLinks` field.
48 /// links: ListLinks,
55 /// links <- ListLinks::new(),
64 /// impl ListItem<0> for BasicItem { using ListLinks { self.links }; }
174 /// Views the [`ListLinks`] for this value.
182 /// Otherwise, the returned pointer points at a read-only [`ListLinks`] with two null pointers.
187 unsafe fn view_links(me: *const Self) -> *mut ListLinks<ID>;
189 /// View the full value given its [`ListLinks`] field.
205 unsafe fn view_value(me: *mut ListLinks<ID>) -> *const Self;
211 /// The caller is granted exclusive access to the returned [`ListLinks`] until `post_remove` is
223 unsafe fn prepare_to_insert(me: *const Self) -> *mut ListLinks<ID>;
235 unsafe fn post_remove(me: *mut ListLinks<ID>) -> *const Self;
251 pub struct ListLinks<const ID: u64 = 0> {
257 // SAFETY: The only way to access/modify the pointers inside of `ListLinks<ID>` is via holding the
260 unsafe impl<const ID: u64> Send for ListLinks<ID> {}
261 // SAFETY: The type is opaque so immutable references to a ListLinks are useless. Therefore, it's
262 // okay to have immutable access to a ListLinks from several threads at once.
263 unsafe impl<const ID: u64> Sync for ListLinks<ID> {}
265 impl<const ID: u64> ListLinks<ID> {
270 ListLinks {
296 /// Similar to [`ListLinks`], but also contains a pointer to the full value.
298 /// This type can be used instead of [`ListLinks`] to support lists with trait objects.
301 /// The `ListLinks` field inside this value.
304 pub inner: ListLinks<ID>,
313 // it's okay to have immutable access to a ListLinks from several threads at once.
325 inner: ListLinks {
384 let item = unsafe { ListLinks::fields(list_links) };
464 let mut item = unsafe { ListLinks::fields(T::view_links(item)) };
559 let list_links = unsafe { ListLinks::from_fields(item) };
678 let item = unsafe { T::view_value(ListLinks::from_fields(current)) };
700 /// use kernel::list::{List, ListArc, ListLinks};
706 /// links: ListLinks,
713 /// links <- ListLinks::new(),
722 /// impl ListItem<0> for ListItem { using ListLinks { self.links }; }
1005 let me = unsafe { T::view_value(ListLinks::from_fields(self.ptr)) };
1032 let me = unsafe { T::view_value(ListLinks::from_fields(self.ptr)) };