pub enum SelectionFormat {
Plain,
Source,
SourceAcrossStyles,
}Expand description
The format of the text returned by
TextViewState::selected_text, which is also what copy writes to the
clipboard.
Variants§
Plain
The rendered text, without any markup.
Source
The source of the selection.
Select-all returns the original source verbatim, a partial selection is
reconstructed as Markdown from the parsed nodes (e.g. selecting inside
a **bold** run yields **bold**).
SourceAcrossStyles
The rendered text while the selection stays within one style, the source as soon as it takes in several.
A style is everything the source would spell out around the selected
text: the marks of an inline run (emphasis, code, a link’s URL) and the
block it sits in (a heading’s #, a list marker, a code fence). So
selecting inside a **bold** run, a link or a code block yields the
text alone, also when the selection reaches exactly up to the run’s
boundaries, while a selection across that boundary, into a second
block, or over an inline object copies like Self::Source. Two blocks
count as two styles even when their marks match, since the source of
either spells out where one ends. Select-all copies the source verbatim.
Trait Implementations§
Source§impl Clone for SelectionFormat
impl Clone for SelectionFormat
impl Copy for SelectionFormat
Source§impl Debug for SelectionFormat
impl Debug for SelectionFormat
Source§impl Default for SelectionFormat
impl Default for SelectionFormat
impl Eq for SelectionFormat
Source§impl PartialEq for SelectionFormat
impl PartialEq for SelectionFormat
impl StructuralPartialEq for SelectionFormat
Auto Trait Implementations§
impl Freeze for SelectionFormat
impl RefUnwindSafe for SelectionFormat
impl Send for SelectionFormat
impl Sync for SelectionFormat
impl Unpin for SelectionFormat
impl UnsafeUnpin for SelectionFormat
impl UnwindSafe for SelectionFormat
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 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().