FerroUI/ docs

Search guides, controls, Rust APIs, and XAML.

    GitHub ↗

    TextHighlighterCollection

    struct · ferroui-controls · v0.5.0

    struct TextHighlighterCollection
    

    View source

    Members

    new

    fn new() -> Self
    

    Source

    from_items

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

    Source

    downgrade

    fn downgrade(self: &Self) -> WeakTextHighlighterCollection
    

    Source

    add

    fn add(self: &Self, highlighter: impl IntoRef<TextHighlighter>)
    

    Source

    insert

    fn insert(self: &Self, index: usize, highlighter: impl IntoRef<TextHighlighter>)
    

    Source

    set

    fn set(self: &Self, index: usize, highlighter: impl IntoRef<TextHighlighter>) -> bool
    

    Source

    remove

    fn remove(self: &Self, highlighter: impl IntoRef<TextHighlighter>) -> bool
    

    Source

    remove_at

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

    Source

    snapshot

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

    Source

    invalidated

    fn invalidated(self: &Self, handler: impl Fn() -> () + 'static) -> Subscription
    

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

    Source

    merged_regions

    fn merged_regions(self: &Self, content_length: usize, default_foreground: Option<Rc<dyn IBrush>>, default_background: Option<Rc<dyn IBrush>>) -> Vec<TextHighlightRegion>
    

    Produces ordered, disjoint regions, ignoring invalid/empty ranges and clipping ranges to the view's content. Null brushes use the supplied theme defaults rather than inheriting a lower layer's brush.

    Source

    merged_regions_with

    fn merged_regions_with(self: &Self, content_length: usize, default_foreground: Option<Rc<dyn IBrush>>, default_background: Option<Rc<dyn IBrush>>, normalize: impl FnMut(Range<usize>) -> Range<usize>) -> Vec<TextHighlightRegion>
    

    Normalizes each source layer before merging. A document view can widen boundaries that fall inside a UTF-16 surrogate pair to scalar boundaries, retaining collection-order priority even when two half-pairs overlap.

    Source

    Trait implementations

    Availability

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