FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    IndexRange

    struct · ferroui-controls · v0.5.0

    struct IndexRange
    

    An inclusive range of indexes.

    The arithmetic wraps on overflow, as the managed implementation's does: "select all" without a source selects the range 0..=i32::MAX.

    View source

    Members

    from_index

    fn from_index(index: i32) -> Self
    

    A range holding a single index.

    Source

    new

    fn new(begin: i32, end: i32) -> Self
    

    Source

    begin

    fn begin(self: &Self) -> i32
    

    Source

    end

    fn end(self: &Self) -> i32
    

    Source

    count

    fn count(self: &Self) -> i32
    

    Source

    contains

    fn contains(self: &Self, index: i32) -> bool
    

    Source

    split

    fn split(self: &Self, split_index: i32) -> (IndexRange, Option<IndexRange>)
    

    Splits the range after split_index: the part up to and including the index, and the part after it if there is one.

    Source

    intersects

    fn intersects(self: &Self, other: IndexRange) -> bool
    

    Source

    adjacent

    fn adjacent(self: &Self, other: IndexRange) -> bool
    

    Source

    contains_in

    fn contains_in(ranges: Option<&[IndexRange]>, index: i32) -> bool
    

    Whether any of the ranges contains the index.

    Source

    get_at

    fn get_at(ranges: &[IndexRange], index: i32) -> i32
    

    The indexth index of the ranges.

    Source

    add

    fn add(ranges: &mut Vec<IndexRange>, range: IndexRange, added: Option<&mut Vec<IndexRange>>) -> i32
    

    Adds a range to the ranges. Returns the number of indexes added, which are recorded in added.

    Source

    add_ranges

    fn add_ranges(destination: &mut Vec<IndexRange>, source: &[IndexRange], added: Option<&mut Vec<IndexRange>>) -> i32
    

    Adds each of the source ranges to destination.

    Source

    intersect

    fn intersect(ranges: &mut Vec<IndexRange>, range: IndexRange, removed: Option<&mut Vec<IndexRange>>) -> i32
    

    Restricts the ranges to range. Returns the number of indexes removed, which are recorded in removed.

    Source

    remove

    fn remove(ranges: Option<&mut Vec<IndexRange>>, range: IndexRange, removed: Option<&mut Vec<IndexRange>>) -> i32
    

    Removes a range from the ranges. Returns the number of indexes removed, which are recorded in removed.

    Source

    remove_ranges

    fn remove_ranges(destination: &mut Vec<IndexRange>, source: &[IndexRange], added: Option<&mut Vec<IndexRange>>) -> i32
    

    Removes each of the source ranges from destination.

    Source

    enumerate_indices

    fn enumerate_indices(ranges: Rc<Vec<IndexRange>>) -> IndexRangeIndices
    

    Enumerates the indexes of the ranges.

    Source

    get_count

    fn get_count(ranges: &[IndexRange]) -> i32
    

    The number of indexes in the ranges.

    Source

    Trait implementations

    • Send
    • Sync
    • Freeze
    • UnsafeUnpin
    • Unpin
    • UnwindSafe
    • RefUnwindSafe
    • Borrow<T>
    • BorrowMut<T>
    • CloneToUninit
    • Into<U>
    • From<T>
    • TryInto<U>
    • TryFrom<U>
    • Any
    • ToOwned
    • ToString
    • ResourceKeyObject
    • PropertyValue
    • AnyValue
    • ClassDefaults
    • ErasedDestructor
    • IntoEither
    • Clone
    • Copy
    • Debug
    • StructuralPartialEq
    • PartialEq
    • Eq
    • Hash
    • Display

    Availability

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