pub struct Editing<'a> {
pub selection: Option<Selection>,
pub caret_on: bool,
pub layouts: Option<&'a BlockLayouts>,
pub annotations: &'a [(Selection, Annotation)],
pub placeholder: Option<SharedString>,
pub caption: Caption,
pub typography: Option<Typography>,
}Expand description
What an editor paints over a document.
One value rather than six parameters, and the reason it is public: the
caret, the selection, the comment washes and the layout sink all arrive
together or not at all, and a read-only render sets none of them.
Fields§
§selection: Option<Selection>The caret and what it has selected. None paints neither — a document
nobody is editing.
caret_on: boolThe blink’s lit half. A caret painted on every frame reads as frozen, and the phase belongs to whoever owns the focus.
layouts: Option<&'a BlockLayouts>Filled as the document paints, for a caller resolving clicks against it.
annotations: &'a [(Selection, Annotation)]Ranges washed under the text, in the order given.
placeholder: Option<SharedString>Shown on the caret’s block while it holds nothing.
caption: Caption§typography: Option<Typography>What to set the document in. None takes the installed
Typography — a caller sizing one document apart from the rest
passes Typography::scaled.
Trait Implementations§
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for Editing<'a>
impl<'a> !Send for Editing<'a>
impl<'a> !Sync for Editing<'a>
impl<'a> !UnwindSafe for Editing<'a>
impl<'a> Freeze for Editing<'a>
impl<'a> Unpin for Editing<'a>
impl<'a> UnsafeUnpin for Editing<'a>
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<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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian().