pub struct SelectedText {
pub text: String,
pub range: Range<usize>,
}Expand description
What the reader has selected in a label (Label::on_selection).
Fields§
§text: StringThe selected text, as the label displays it (Markdown markers already stripped). Empty when the selection was cleared.
range: Range<usize>The selection as a byte range into the displayed text. Empty when nothing is selected.
Implementations§
Trait Implementations§
Source§impl Clone for SelectedText
impl Clone for SelectedText
Source§fn clone(&self) -> SelectedText
fn clone(&self) -> SelectedText
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SelectedText
impl Debug for SelectedText
Source§impl Default for SelectedText
impl Default for SelectedText
Source§fn default() -> SelectedText
fn default() -> SelectedText
Returns the “default value” for a type. Read more
impl Eq for SelectedText
Source§impl PartialEq for SelectedText
impl PartialEq for SelectedText
impl StructuralPartialEq for SelectedText
Auto Trait Implementations§
impl Forget for SelectedText
impl Freeze for SelectedText
impl Move for SelectedText
impl RefUnwindSafe for SelectedText
impl Send for SelectedText
impl Sync for SelectedText
impl Unpin for SelectedText
impl UnsafeUnpin for SelectedText
impl UnwindSafe for SelectedText
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
Mutably borrows from an owned value. Read more
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
Compare self to
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
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> ⓘ
Converts
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> ⓘ
Converts
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