Lines Matching +full:send +full:- +full:empty

1 // SPDX-License-Identifier: GPL-2.0
33 /// * If the list is empty, then `first` is null. Otherwise, `first` points at the `ListLinks`
45 unsafe impl<T, const ID: u64> Send for List<T, ID>
47 ListArc<T, ID>: Send,
77 /// Otherwise, the returned pointer points at a read-only [`ListLinks`] with two null pointers.
82 unsafe fn view_links(me: *const Self) -> *mut ListLinks<ID>; in view_links()
100 unsafe fn view_value(me: *mut ListLinks<ID>) -> *const Self; in view_value()
118 unsafe fn prepare_to_insert(me: *const Self) -> *mut ListLinks<ID>; in prepare_to_insert()
130 unsafe fn post_remove(me: *mut ListLinks<ID>) -> *const Self; in post_remove()
153 // associated `ListArc<T, ID>`. Since that type correctly implements `Send`, it is impossible to
154 // move this an instance of this type to a different thread if the pointees are `!Send`.
155 unsafe impl<const ID: u64> Send for ListLinks<ID> {}
162 pub fn new() -> impl PinInit<Self> { in new()
163 // INVARIANT: Pin-init initializers can't be used on an existing `Arc`, so this value will in new()
177 unsafe fn fields(me: *mut Self) -> *mut ListLinksFields { in fields()
186 unsafe fn from_fields(me: *mut ListLinksFields) -> *mut Self { in from_fields()
206 unsafe impl<T: ?Sized + Send, const ID: u64> Send for ListLinksSelfPtr<T, ID> {}
219 pub fn new() -> impl PinInit<Self> { in new()
220 // INVARIANT: Pin-init initializers can't be used on an existing `Arc`, so this value will in new()
235 /// Creates a new empty list.
236 pub const fn new() -> Self { in new()
243 /// Returns whether this list is empty.
244 pub fn is_empty(&self) -> bool { in is_empty()
311 // SAFETY: We just checked that `next` is non-null. in push_front()
327 pub fn pop_back(&mut self) -> Option<ListArc<T, ID>> { in pop_back()
332 // SAFETY: We just checked that the list is not empty. in pop_back()
339 pub fn pop_front(&mut self) -> Option<ListArc<T, ID>> { in pop_front()
356 pub unsafe fn remove(&mut self, item: &T) -> Option<ListArc<T, ID>> { in remove()
363 // * If `item` is not in any list, then these fields are read-only and null. in remove()
372 // This is really a no-op, but this ensures that `item` is a raw pointer that was in remove()
373 // obtained without going through a pointer->reference->pointer conversion roundtrip. in remove()
397 unsafe fn remove_internal(&mut self, item: *mut ListLinksFields) -> ListArc<T, ID> { in remove_internal()
416 ) -> ListArc<T, ID> { in remove_internal_inner()
439 // `prev->next` to `next`, which is the new first item, and setting `item->next` to null in remove_internal_inner()
440 // did not modify `prev->next`. in remove_internal_inner()
442 // `item->next` to null, so this correctly sets `first` to null now that the list is in remove_internal_inner()
443 // empty. in remove_internal_inner()
445 // SAFETY: The `prev` pointer is the value that `item->prev` had when it was in this in remove_internal_inner()
465 // First, we insert the elements into `self`. At the end, we make `other` empty. in push_all_back()
471 // SAFETY: The other list is not empty, so this pointer is valid. in push_all_back()
474 // SAFETY: The self list is not empty, so this pointer is valid. in push_all_back()
488 // INVARIANT: The other list is now empty, so update its pointer. in push_all_back()
494 /// If the list is empty, this returns `None`.
495 pub fn cursor_front(&mut self) -> Option<Cursor<'_, T, ID>> { in cursor_front()
507 pub fn iter(&self) -> Iter<'_, T, ID> { in iter()
508 // INVARIANT: If the list is empty, both pointers are null. Otherwise, both pointers point in iter()
519 fn default() -> Self { in default()
549 fn next(&mut self) -> Option<ArcBorrow<'a, T>> { in next()
592 pub fn current(&self) -> ArcBorrow<'_, T> { in current()
608 pub fn next(self) -> Option<Cursor<'a, T, ID>> { in next()
625 pub fn prev(self) -> Option<Cursor<'a, T, ID>> { in prev()
642 pub fn remove(self) -> ListArc<T, ID> { in remove()
654 fn into_iter(self) -> Iter<'a, T, ID> { in into_iter()
667 fn next(&mut self) -> Option<ListArc<T, ID>> { in next()
675 fn next_back(&mut self) -> Option<ListArc<T, ID>> { in next_back()
684 fn into_iter(self) -> IntoIter<T, ID> { in into_iter()