pub struct Formatting {
pub mode: Mode,
pub marks: Vec<Mark>,
pub block: Option<SharedString>,
pub fenceable: bool,
}Expand description
What a toolbar reads to light itself, in one call.
Every field is a question a bar asks on every frame, and each was a separate reach into the document before: which marks are lit, what the block is called, whether cmd-E would fence, and whether any of it applies at all. Taken together so a bar cannot answer half of them from one frame and half from the next.
Fields§
§mode: ModeWhich form the document is in. In Mode::Source the markup is already
spelled out, so Self::marks is empty and a bar has nothing to light.
marks: Vec<Mark>The marks the selection carries throughout — and at a collapsed caret, the ones the next character typed would carry, cmd-B before typing included.
block: Option<SharedString>What the caret’s block is called in turns, or None for a block the
menu does not offer.
fenceable: boolWhether Mark::Code here makes a fence out of the selection rather
than an inline span — the one chord whose meaning changes with what is
selected, and the one a bar cannot work out for itself.
Trait Implementations§
Source§impl Clone for Formatting
impl Clone for Formatting
Source§fn clone(&self) -> Formatting
fn clone(&self) -> Formatting
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 Formatting
impl Debug for Formatting
impl Eq for Formatting
Source§impl PartialEq for Formatting
impl PartialEq for Formatting
impl StructuralPartialEq for Formatting
Auto Trait Implementations§
impl Freeze for Formatting
impl RefUnwindSafe for Formatting
impl Send for Formatting
impl Sync for Formatting
impl Unpin for Formatting
impl UnsafeUnpin for Formatting
impl UnwindSafe for Formatting
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more