Skip to main content

RcuIntrusiveList

Struct RcuIntrusiveList 

Source
pub struct RcuIntrusiveList<T, A: RcuListAdapter<T>> { /* private fields */ }

Implementations§

Source§

impl<T, A: RcuListAdapter<T>> RcuIntrusiveList<T, A>

Source

pub unsafe fn push_front<'a>( &self, scope: &'a RcuReadScope, data: RcuPtrRef<'a, T>, )

Pushes a new element to the front of the list.

§Safety

Requires external synchronization to exclude concurrent writers.

Source

pub unsafe fn push_back<'a>(&self, scope: &RcuReadScope, data: RcuPtrRef<'a, T>)

Pushes a new element to the back of the list.

§Safety

Requires external synchronization to exclude concurrent writers.

Source

pub unsafe fn append(&self, scope: &RcuReadScope, other: Self)

Appends another list to the end of this list.

§Safety

Requires external synchronization to exclude concurrent writers.

Source

pub unsafe fn remove<'a>( &self, scope: &'a RcuReadScope, node: RcuPtrRef<'a, T>, ) -> RcuPtrRef<'a, Link>

Removes the given node from the list.

Returns the link of the next node in the list, if any.

§Safety

Requires external synchronization to exclude concurrent writers.

Source

pub unsafe fn split_off(&self, scope: &RcuReadScope, pos: usize) -> Self

Splits the list into two lists at the given position.

If the given position is past the end of the list, returns an empty list.

§Safety

Requires external synchronization to exclude concurrent writers.

Source

pub unsafe fn update(&self, scope: &RcuReadScope, other: Self)

Updates the list with the contents of another list.

§Safety

Requires external synchronization to exclude concurrent writers.

Source

pub unsafe fn clear<'a>( &self, scope: &'a RcuReadScope, callback: impl Fn(RcuPtrRef<'a, T>), )
where T: 'static,

Removes all elements from the list.

The callback is called for each element in the list. The caller is responsible for cleaning up the removed elements.

Concurrent readers may continue to see the old value of the list until the RCU state machine has made sufficient progress to ensure that no concurrent readers are holding read guards.

§Safety

Requires external synchronization to exclude concurrent writers.

Source

pub fn cursor<'a>( &'a self, scope: &'a RcuReadScope, ) -> RcuIntrusiveListCursor<'a, T, A>

Returns a cursor that can be used to traverse and modify the list.

Concurrent readers may continue to see the old value of the list until the RCU state machine has made sufficient progress to ensure that no concurrent readers are holding read guards.

Source

pub fn iter<'a>(&self, scope: &'a RcuReadScope) -> impl Iterator<Item = &'a T>
where T: 'static,

Returns an iterator over the elements in the list.

Trait Implementations§

Source§

impl<T: Debug, A: Debug + RcuListAdapter<T>> Debug for RcuIntrusiveList<T, A>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<T, A: RcuListAdapter<T>> Default for RcuIntrusiveList<T, A>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

§

impl<T, A> !Freeze for RcuIntrusiveList<T, A>

§

impl<T, A> RefUnwindSafe for RcuIntrusiveList<T, A>

§

impl<T, A> Send for RcuIntrusiveList<T, A>
where T: Send, A: Send,

§

impl<T, A> Sync for RcuIntrusiveList<T, A>
where T: Sync, A: Sync,

§

impl<T, A> Unpin for RcuIntrusiveList<T, A>
where T: Unpin, A: Unpin,

§

impl<T, A> UnsafeUnpin for RcuIntrusiveList<T, A>

§

impl<T, A> UnwindSafe for RcuIntrusiveList<T, A>
where T: UnwindSafe, A: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.