FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    ArrayBuilder

    struct · ferroui-base · v0.5.0

    struct ArrayBuilder<T>
    

    A simple growable buffer.

    Upstream hands out ArraySlices aliasing the builder's array; here the builder owns a Vec<T> and ranges are borrowed as plain slices.

    View source

    Members

    new

    const fn new() -> Self
    

    Source

    length

    fn length(self: &Self) -> usize
    

    The number of items.

    Source

    capacity

    fn capacity(self: &Self) -> usize
    

    The allocated capacity.

    Source

    add_item

    fn add_item(self: &mut Self, value: T)
    

    Appends one item.

    Source

    clear

    fn clear(self: &mut Self)
    

    Removes every item, keeping the storage.

    Source

    reset

    fn reset(self: &mut Self)
    

    Drops the storage (C# arrayBuilder = default).

    Source

    as_span

    fn as_span(self: &Self) -> &[T]
    

    The items.

    Source

    as_span_mut

    fn as_span_mut(self: &mut Self) -> &mut [T]
    

    The items, mutably.

    Source

    as_slice

    fn as_slice(self: &Self, start: usize, length: usize) -> &[T]
    

    length items starting at start.

    Source

    as_slice_to

    fn as_slice_to(self: &Self, length: usize) -> &[T]
    

    The first length items (the original's AsSlice(length); its AsSlice() is as_span).

    Source

    as_slice_mut

    fn as_slice_mut(self: &mut Self, start: usize, length: usize) -> &mut [T]
    

    length items starting at start, mutably.

    Source

    set_length

    fn set_length(self: &mut Self, value: usize)
    

    Sets the number of items; new items are default values.

    Source

    add

    fn add(self: &mut Self, length: usize) -> &mut [T]
    

    Appends length default items and returns them.

    Source

    add_slice

    fn add_slice(self: &mut Self, value: &[T]) -> &mut [T]
    

    Appends a copy of value and returns the appended range.

    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
    • Debug
    • Default
    • Index<usize>
    • IndexMut<usize>

    Availability

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