TextHighlighterCollection
struct · ferroui-controls · v0.5.0
struct TextHighlighterCollection
Members
newfrom_itemsdowngradeaddinsertsetremoveremove_atsnapshotinvalidatedmerged_regionsmerged_regions_with
new
fn new() -> Self
from_items
fn from_items(items: impl IntoIterator<Item = Ref<TextHighlighter>>) -> Self
downgrade
fn downgrade(self: &Self) -> WeakTextHighlighterCollection
add
fn add(self: &Self, highlighter: impl IntoRef<TextHighlighter>)
insert
fn insert(self: &Self, index: usize, highlighter: impl IntoRef<TextHighlighter>)
set
fn set(self: &Self, index: usize, highlighter: impl IntoRef<TextHighlighter>) -> bool
remove
fn remove(self: &Self, highlighter: impl IntoRef<TextHighlighter>) -> bool
remove_at
fn remove_at(self: &Self, index: usize) -> Option<Ref<TextHighlighter>>
snapshot
fn snapshot(self: &Self) -> Rc<Vec<Ref<TextHighlighter>>>
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.
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.
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.
Trait implementations
SendSyncFreezeUnsafeUnpinUnpinUnwindSafeRefUnwindSafeBorrow<T>BorrowMut<T>CloneToUninitInto<U>From<T>TryInto<U>TryFrom<U>ReceiverAnyToOwnedPropertyValueAnyValueClassDefaultsErasedDestructorIntoEitherClonePartialEqDebugDefaultDerefMarkupTypedValueTypeRegistration
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.