Struct TailValRef

Source
pub struct TailValRef<'node, 'tail, T: 'node + 'tail> { /* private fields */ }
Expand description

A TailValRef is an active item, which provides mutable access to a single node and its successors.

Implementations§

Source§

impl<'node, 'tail, T: 'node + 'tail> TailValRef<'node, 'tail, T>

Source

pub fn tail<'slf>(&'slf mut self) -> (&'slf ValRef<'node, T>, Cursor<'slf, T>)

Returns a reference to a ValRef to the first node owned by self, as well as a Cursor owning the rest of the nodes owned by self.

After both items have gone out of scope, this method may be called again.

Source

pub fn into_tail(self) -> (ValRef<'node, T>, Cursor<'tail, T>)

Returns a ValRef to the first node owned by self, as well as a Cursorowning the rest of the nodes owned byself`.

This method consumes self. The Cursor who returned this may be used again after the returned cursor has gone out of scope.

Source

pub fn into_passive(self) -> ValRef<'node, T>

Turns self into a ValRef to the first node owned by self. The Cursor who returned this may be used again after this method has been called.

Source

pub fn insert_before(&mut self, val: T) -> ValRef<'node, T>

Inserts a new element before this element and returns a ValRef to the newly inserted element.

Source

pub fn insert_after(&mut self, val: T) -> ValRef<'node, T>

Inserts a new element after this element and returns a ValRef to the newly inserted element.

Source

pub fn remove(self) -> T

Removes this element from the list and returns it’s value.

Trait Implementations§

Source§

impl<'node, 'tail, T: 'node + 'tail> Deref for TailValRef<'node, 'tail, T>

Source§

type Target = T

The resulting type after dereferencing.
Source§

fn deref(&self) -> &T

Dereferences the value.
Source§

impl<'node, 'tail, T: 'node + 'tail> DerefMut for TailValRef<'node, 'tail, T>

Source§

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

Mutably dereferences the value.

Auto Trait Implementations§

§

impl<'node, 'tail, T> Freeze for TailValRef<'node, 'tail, T>

§

impl<'node, 'tail, T> !RefUnwindSafe for TailValRef<'node, 'tail, T>

§

impl<'node, 'tail, T> !Send for TailValRef<'node, 'tail, T>

§

impl<'node, 'tail, T> !Sync for TailValRef<'node, 'tail, T>

§

impl<'node, 'tail, T> Unpin for TailValRef<'node, 'tail, T>

§

impl<'node, 'tail, T> !UnwindSafe for TailValRef<'node, 'tail, T>

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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
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.