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 shared 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. An OptIn session is shown by
neither until with names it.
Implementations§
Source§impl HighlightMask
impl HighlightMask
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), whatever their visibility: naming a session is asking
for it, so an OptIn id listed here is admitted.
Sourcepub fn with(self, id: SessionId) -> Self
pub fn with(self, id: SessionId) -> Self
Ask for one more session by name.
On a mask that already names a set (only / none) this
adds to it. On all it admits one
OptIn session without narrowing anything else,
which is the shape a view wants when it owns a private layer and still wants the
spell squiggles, comment underlines and ambient caret band it holds no handle on.
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.