pub struct Cursor<'a, T, A = Global>
where T: 'a, A: Allocator,
{ /* private fields */ }
๐Ÿ”ฌThis is a nightly-only experimental API. (linked_list_cursors)
Available on crate feature wayland and Linux only.
Expand description

A cursor over a LinkedList.

A Cursor is like an iterator, except that it can freely seek back-and-forth.

Cursors always rest between two elements in the list, and index in a logically circular way. To accommodate this, there is a โ€œghostโ€ non-element that yields None between the head and tail of the list.

When created, cursors start at the front of the list, or the โ€œghostโ€ non-element if the list is empty.

Implementationsยง

Sourceยง

impl<'a, T, A> Cursor<'a, T, A>
where A: Allocator,

Source

pub fn index(&self) -> Option<usize>

๐Ÿ”ฌThis is a nightly-only experimental API. (linked_list_cursors)

Returns the cursor position index within the LinkedList.

This returns None if the cursor is currently pointing to the โ€œghostโ€ non-element.

Source

pub fn move_next(&mut self)

๐Ÿ”ฌThis is a nightly-only experimental API. (linked_list_cursors)

Moves the cursor to the next element of the LinkedList.

If the cursor is pointing to the โ€œghostโ€ non-element then this will move it to the first element of the LinkedList. If it is pointing to the last element of the LinkedList then this will move it to the โ€œghostโ€ non-element.

Source

pub fn move_prev(&mut self)

๐Ÿ”ฌThis is a nightly-only experimental API. (linked_list_cursors)

Moves the cursor to the previous element of the LinkedList.

If the cursor is pointing to the โ€œghostโ€ non-element then this will move it to the last element of the LinkedList. If it is pointing to the first element of the LinkedList then this will move it to the โ€œghostโ€ non-element.

Source

pub fn current(&self) -> Option<&'a T>

๐Ÿ”ฌThis is a nightly-only experimental API. (linked_list_cursors)

Returns a reference to the element that the cursor is currently pointing to.

This returns None if the cursor is currently pointing to the โ€œghostโ€ non-element.

Source

pub fn peek_next(&self) -> Option<&'a T>

๐Ÿ”ฌThis is a nightly-only experimental API. (linked_list_cursors)

Returns a reference to the next element.

If the cursor is pointing to the โ€œghostโ€ non-element then this returns the first element of the LinkedList. If it is pointing to the last element of the LinkedList then this returns None.

Source

pub fn peek_prev(&self) -> Option<&'a T>

๐Ÿ”ฌThis is a nightly-only experimental API. (linked_list_cursors)

Returns a reference to the previous element.

If the cursor is pointing to the โ€œghostโ€ non-element then this returns the last element of the LinkedList. If it is pointing to the first element of the LinkedList then this returns None.

Source

pub fn front(&self) -> Option<&'a T>

๐Ÿ”ฌThis is a nightly-only experimental API. (linked_list_cursors)

Provides a reference to the front element of the cursorโ€™s parent list, or None if the list is empty.

Source

pub fn back(&self) -> Option<&'a T>

๐Ÿ”ฌThis is a nightly-only experimental API. (linked_list_cursors)

Provides a reference to the back element of the cursorโ€™s parent list, or None if the list is empty.

Source

pub fn as_list(&self) -> &'a LinkedList<T, A>

๐Ÿ”ฌThis is a nightly-only experimental API. (linked_list_cursors)

Provides a reference to the cursorโ€™s parent list.

Trait Implementationsยง

Sourceยง

impl<T, A> Clone for Cursor<'_, T, A>
where A: Allocator,

Sourceยง

fn clone(&self) -> Cursor<'_, T, A>

Returns a duplicate of the value. Read more
1.0.0 ยท Sourceยง

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Sourceยง

impl<T, A> Debug for Cursor<'_, T, A>
where T: Debug, A: Allocator,

Sourceยง

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

Formats the value using the given formatter. Read more
Sourceยง

impl<T, A> Send for Cursor<'_, T, A>
where T: Sync, A: Allocator + Sync,

Sourceยง

impl<T, A> Sync for Cursor<'_, T, A>
where T: Sync, A: Allocator + Sync,

Auto Trait Implementationsยง

ยง

impl<'a, T, A> Freeze for Cursor<'a, T, A>

ยง

impl<'a, T, A> RefUnwindSafe for Cursor<'a, T, A>

ยง

impl<'a, T, A> Unpin for Cursor<'a, T, A>

ยง

impl<'a, T, A> UnwindSafe for Cursor<'a, T, A>

Blanket Implementationsยง

Sourceยง

impl<S, D, Swp, Dwp, T> AdaptInto<D, Swp, Dwp, T> for S
where T: Real + Zero + Arithmetics + Clone, Swp: WhitePoint<T>, Dwp: WhitePoint<T>, D: AdaptFrom<S, Swp, Dwp, T>,

Sourceยง

fn adapt_into_using<M>(self, method: M) -> D
where M: TransformMatrix<T>,

Convert the source color to the destination color using the specified method.
Sourceยง

fn adapt_into(self) -> D

Convert the source color to the destination color using the bradford method by default.
ยง

impl<T> Also for T

ยง

fn also<F>(self, block: F) -> Self
where F: FnOnce(&mut Self),

Apply a function to this value and return the (possibly) modified value.
Sourceยง

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

Sourceยง

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
ยง

impl<T, Res> Apply<Res> for T
where T: ?Sized,

ยง

fn apply<F>(self, f: F) -> Res
where F: FnOnce(Self) -> Res, Self: Sized,

Apply a function which takes the parameter by value.
ยง

fn apply_ref<F>(&self, f: F) -> Res
where F: FnOnce(&Self) -> Res,

Apply a function which takes the parameter by reference.
ยง

fn apply_mut<F>(&mut self, f: F) -> Res
where F: FnOnce(&mut Self) -> Res,

Apply a function which takes the parameter by mutable reference.
Sourceยง

impl<T, C> ArraysFrom<C> for T
where C: IntoArrays<T>,

Sourceยง

fn arrays_from(colors: C) -> T

Cast a collection of colors into a collection of arrays.
Sourceยง

impl<T, C> ArraysInto<C> for T
where C: FromArrays<T>,

Sourceยง

fn arrays_into(self) -> C

Cast this collection of arrays into a collection of colors.
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<WpParam, T, U> Cam16IntoUnclamped<WpParam, T> for U
where T: FromCam16Unclamped<WpParam, U>,

Sourceยง

type Scalar = <T as FromCam16Unclamped<WpParam, U>>::Scalar

The number type thatโ€™s used in parameters when converting.
Sourceยง

fn cam16_into_unclamped( self, parameters: BakedParameters<WpParam, <U as Cam16IntoUnclamped<WpParam, T>>::Scalar>, ) -> T

Converts self into C, using the provided parameters.
Sourceยง

impl<T> CloneToUninit for T
where T: Clone,

Sourceยง

unsafe fn clone_to_uninit(&self, dest: *mut u8)

๐Ÿ”ฌThis is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Sourceยง

impl<T, C> ComponentsFrom<C> for T
where C: IntoComponents<T>,

Sourceยง

fn components_from(colors: C) -> T

Cast a collection of colors into a collection of color components.
ยง

impl<T> Downcast for T
where T: Any,

ยง

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
ยง

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
ยง

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &Anyโ€™s vtable from &Traitโ€™s.
ยง

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Anyโ€™s vtable from &mut Traitโ€™s.
ยง

impl<T> DowncastSync for T
where T: Any + Send + Sync,

ยง

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Sync + Send>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Sourceยง

impl<T> From<T> for T

Sourceยง

fn from(t: T) -> T

Returns the argument unchanged.

Sourceยง

impl<T> FromAngle<T> for T

Sourceยง

fn from_angle(angle: T) -> T

Performs a conversion from angle.
Sourceยง

impl<T, U> FromStimulus<U> for T
where U: IntoStimulus<T>,

Sourceยง

fn from_stimulus(other: U) -> T

Converts other into Self, while performing the appropriate scaling, rounding and clamping.
ยง

impl<T> Instrument for T

ยง

fn instrument(self, span: Span) -> Instrumented<Self> โ“˜

Instruments this type with the provided [Span], returning an Instrumented wrapper. Read more
ยง

fn in_current_span(self) -> Instrumented<Self> โ“˜

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoAngle<U> for T
where U: FromAngle<T>,

Sourceยง

fn into_angle(self) -> U

Performs a conversion into T.
ยง

impl<State, Message> IntoBoot<State, Message> for State

ยง

fn into_boot(self) -> (State, Task<Message>)

Turns some type into the initial state of some Application.
Sourceยง

impl<WpParam, T, U> IntoCam16Unclamped<WpParam, T> for U
where T: Cam16FromUnclamped<WpParam, U>,

Sourceยง

type Scalar = <T as Cam16FromUnclamped<WpParam, U>>::Scalar

The number type thatโ€™s used in parameters when converting.
Sourceยง

fn into_cam16_unclamped( self, parameters: BakedParameters<WpParam, <U as IntoCam16Unclamped<WpParam, T>>::Scalar>, ) -> T

Converts self into C, using the provided parameters.
Sourceยง

impl<T, U> IntoColor<U> for T
where U: FromColor<T>,

Sourceยง

fn into_color(self) -> U

Convert into T with values clamped to the color defined bounds Read more
Sourceยง

impl<T, U> IntoColorUnclamped<U> for T
where U: FromColorUnclamped<T>,

Sourceยง

fn into_color_unclamped(self) -> U

Convert into T. The resulting color might be invalid in its color space Read more
Sourceยง

impl<T> IntoStimulus<T> for T

Sourceยง

fn into_stimulus(self) -> T

Converts self into T, while performing the appropriate scaling, rounding and clamping.
Sourceยง

impl<T> Same for T

Sourceยง

type Output = T

Should always be Self
Sourceยง

impl<T> ToOwned for T
where T: Clone,

Sourceยง

type Owned = T

The resulting type after obtaining ownership.
Sourceยง

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Sourceยง

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Sourceยง

impl<T, C> TryComponentsInto<C> for T
where C: TryFromComponents<T>,

Sourceยง

type Error = <C as TryFromComponents<T>>::Error

The error for when try_into_colors fails to cast.
Sourceยง

fn try_components_into(self) -> Result<C, <T as TryComponentsInto<C>>::Error>

Try to cast this collection of color components into a collection of colors. Read more
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.
Sourceยง

impl<T, U> TryIntoColor<U> for T
where U: TryFromColor<T>,

Sourceยง

fn try_into_color(self) -> Result<U, OutOfBounds<U>>

Convert into T, returning ok if the color is inside of its defined range, otherwise an OutOfBounds error is returned which contains the unclamped color. Read more
Sourceยง

impl<C, U> UintsFrom<C> for U
where C: IntoUints<U>,

Sourceยง

fn uints_from(colors: C) -> U

Cast a collection of colors into a collection of unsigned integers.
Sourceยง

impl<C, U> UintsInto<C> for U
where C: FromUints<U>,

Sourceยง

fn uints_into(self) -> C

Cast this collection of unsigned integers into a collection of colors.
ยง

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

ยง

fn vzip(self) -> V

ยง

impl<T> WithSubscriber for T

ยง

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> โ“˜
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a [WithDispatch] wrapper. Read more
ยง

fn with_current_subscriber(self) -> WithDispatch<Self> โ“˜

Attaches the current default Subscriber to this type, returning a [WithDispatch] wrapper. Read more
ยง

impl<T> MaybeClone for T

ยง

impl<T> MaybeDebug for T

ยง

impl<T> MaybeSend for T
where T: Send,

ยง

impl<T> MaybeSend for T
where T: Send,

ยง

impl<T> MaybeSync for T
where T: Sync,

ยง

impl<T> MaybeSync for T
where T: Sync,