pub struct HighlightMask { /* private fields */ }Expand description
Which highlight sessions a particular view renders.
Two panes over one shared document can carry different find queries, so “which highlights
to show” is a property of the view, not the document. A snapshot is built under a mask;
only the sessions the mask admits contribute spans, and the effective
HighlighterKind is the join over just those.
The default (HighlightMask::all) shows every session — the behaviour of the old
snapshot_flow(). HighlightMask::none shows none — the old
snapshot_flow_without_highlights(), and it must stay exactly as cheap, since every
read-only preview pane uses it.
Implementations§
Source§impl HighlightMask
impl HighlightMask
Sourcepub fn all() -> Self
pub fn all() -> Self
Show every session attached to the document. The default, and the shape of a plain
snapshot_flow().
Sourcepub fn only(ids: impl IntoIterator<Item = SessionId>) -> Self
pub fn only(ids: impl IntoIterator<Item = SessionId>) -> Self
Show only the named sessions (e.g. the shared syntax + spell sessions plus this view’s own find session).
Sourcepub fn with(self, id: SessionId) -> Self
pub fn with(self, id: SessionId) -> Self
Add a session to a mask that already names some (a no-op on HighlightMask::all,
which already admits everything).
Trait Implementations§
Source§impl Clone for HighlightMask
impl Clone for HighlightMask
Source§fn clone(&self) -> HighlightMask
fn clone(&self) -> HighlightMask
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for HighlightMask
impl Debug for HighlightMask
Source§impl Default for HighlightMask
impl Default for HighlightMask
Source§fn default() -> HighlightMask
fn default() -> HighlightMask
impl Eq for HighlightMask
Source§impl PartialEq for HighlightMask
impl PartialEq for HighlightMask
impl StructuralPartialEq for HighlightMask
Auto Trait Implementations§
impl Freeze for HighlightMask
impl RefUnwindSafe for HighlightMask
impl Send for HighlightMask
impl Sync for HighlightMask
impl Unpin for HighlightMask
impl UnsafeUnpin for HighlightMask
impl UnwindSafe for HighlightMask
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.