FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    MappedArraySlice

    struct · ferroui-base · v0.5.0

    struct MappedArraySlice<T>
    

    Provides a mapped view of an underlying slice, selecting arbitrary indices from the source array.

    View source

    Members

    new

    fn new(data: &ArraySlice<T>, map: &ArraySlice<i32>) -> Self
    

    Creates a view of the data slice through the map slice.

    In a debug build, panics when the map is longer than the data.

    Source

    length

    fn length(self: &Self) -> usize
    

    Gets the number of items in the map.

    Source

    set

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

    Writes the specified element of the slice.

    Panics when the index is not less than length.

    Source

    get

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

    Reads the specified element of the slice.

    Panics when the index is not less than length.

    Source

    Trait implementations

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

    Availability

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