FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    ArraySlice

    struct · ferroui-base · v0.5.0

    struct ArraySlice<T>
    

    A view over length elements of a shared array starting at start.

    View source

    Members

    empty

    fn empty() -> Self
    

    An empty slice (C# ArraySlice<T>.Empty).

    Source

    new

    fn new(data: Vec<T>) -> Self
    

    A slice over a whole new array.

    Source

    from_shared

    fn from_shared(data: Rc<RefCell<Vec<T>>>, start: usize, length: usize) -> Self
    

    A slice over part of a shared array.

    Panics when the range is outside the array.

    Source

    data

    fn data(self: &Self) -> &Rc<RefCell<Vec<T>>>
    

    The shared array this slice views.

    Source

    is_empty

    fn is_empty(self: &Self) -> bool
    

    Whether the slice has no elements.

    Source

    start

    fn start(self: &Self) -> usize
    

    The offset of the slice inside the shared array.

    Source

    length

    fn length(self: &Self) -> usize
    

    The number of elements.

    Source

    span

    fn span(self: &Self) -> Ref<'_, [T]>
    

    Borrows the elements (C# Span).

    Panics when the array is mutably borrowed.

    Source

    span_mut

    fn span_mut(self: &Self) -> RefMut<'_, [T]>
    

    Mutably borrows the elements (C# Span).

    Panics when the array is borrowed.

    Source

    set

    fn set(self: &Self, index: usize, value: T)
    

    Writes one element.

    Source

    slice

    fn slice(self: &Self, start: usize, length: usize) -> Self
    

    A slice of the same array. As upstream, start is relative to the underlying array, not to this slice.

    Source

    take

    fn take(self: &Self, length: usize) -> Self
    

    The first length elements.

    Panics when length is larger than the slice.

    Source

    skip

    fn skip(self: &Self, length: usize) -> Self
    

    Everything after the first length elements.

    Panics when length is larger than the slice.

    Source

    get

    fn get(self: &Self, index: usize) -> T
    

    Reads one element.

    Source

    fill

    fn fill(self: &Self, value: T)
    

    Sets every element to value.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • ClassDefaults
    • Borrow<T>
    • BorrowMut<T>
    • CloneToUninit
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ToOwned
    • ErasedDestructor
    • IntoEither
    • Clone
    • From<Vec<T>>

    Availability

    Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.