FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    TextRangeCollection

    struct · ferroui-controls · v0.5.0

    struct TextRangeCollection
    

    An observable shared collection of copied highlight values.

    Unlike a live document range, an item does not follow edits. Applications replace range values when their search results or annotations change.

    View source

    Members

    new

    fn new() -> Self
    

    Source

    from_items

    fn from_items(items: impl IntoIterator<Item = TextHighlightRange>) -> Self
    

    Source

    count

    fn count(self: &Self) -> usize
    

    Source

    len

    fn len(self: &Self) -> usize
    

    Source

    is_empty

    fn is_empty(self: &Self) -> bool
    

    Source

    capacity

    fn capacity(self: &Self) -> usize
    

    Source

    clear

    fn clear(self: &Self)
    

    Source

    add

    fn add(self: &Self, range: TextHighlightRange)
    

    Source

    add_range

    fn add_range(self: &Self, ranges: impl IntoIterator<Item = TextHighlightRange>)
    

    Source

    add_span

    fn add_span(self: &Self, range: Range<usize>) -> Result<(), TextHighlightError>
    

    Source

    insert

    fn insert(self: &Self, index: usize, range: TextHighlightRange)
    

    Like the source collection, inserting past the end appends.

    Source

    insert_range

    fn insert_range(self: &Self, index: usize, ranges: impl IntoIterator<Item = TextHighlightRange>)
    

    Source

    get

    fn get(self: &Self, index: usize) -> Option<TextHighlightRange>
    

    Source

    set

    fn set(self: &Self, index: usize, range: TextHighlightRange) -> bool
    

    Source

    remove_at

    fn remove_at(self: &Self, index: usize) -> Option<TextHighlightRange>
    

    Source

    remove

    fn remove(self: &Self, range: &TextHighlightRange) -> bool
    

    Source

    contains

    fn contains(self: &Self, range: &TextHighlightRange) -> bool
    

    Source

    index_of

    fn index_of(self: &Self, range: &TextHighlightRange) -> Option<usize>
    

    Source

    snapshot

    fn snapshot(self: &Self) -> Rc<Vec<TextHighlightRange>>
    

    Copies every value so setters on a returned item cannot mutate the list.

    Source

    to_vec

    fn to_vec(self: &Self) -> Vec<TextHighlightRange>
    

    Source

    iter

    fn iter(self: &Self) -> std::vec::IntoIter<TextHighlightRange>
    

    Source

    for_each

    fn for_each(self: &Self, f: impl FnMut(&TextHighlightRange) -> ())
    

    Source

    collection_changed

    fn collection_changed(self: &Self, handler: impl Fn(&'a NotifyCollectionChangedEventArgs<'b, TextHighlightRange>) -> () + 'static) -> Subscription
    

    Dropping the returned guard removes the handler; Subscription::detach keeps it for the life of the collection.

    Source

    Trait implementations

    Availability

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