pub struct TEXT;Expand description
Text internals used by text implementer nodes and properties.
The text implementation is split between two contexts, resolve_text and layout_text, this service
provides access to data produced by these two contexts.
Implementations§
Source§impl TEXT
impl TEXT
Sourcepub fn try_rich(&self) -> Option<RwLockReadGuardOwned<RichText>>
pub fn try_rich(&self) -> Option<RwLockReadGuardOwned<RichText>>
Read lock the current rich text context if any parent widget defines it.
Sourcepub fn try_resolved(&self) -> Option<RwLockReadGuardOwned<ResolvedText>>
pub fn try_resolved(&self) -> Option<RwLockReadGuardOwned<ResolvedText>>
Read lock the current contextual resolved text if called in a node inside resolve_text.
Note that this will block until a read lock can be acquired.
Sourcepub fn rich(&self) -> RwLockReadGuardOwned<RichText>
pub fn rich(&self) -> RwLockReadGuardOwned<RichText>
Sourcepub fn resolved(&self) -> RwLockReadGuardOwned<ResolvedText>
pub fn resolved(&self) -> RwLockReadGuardOwned<ResolvedText>
Read lock the current contextual resolved text.
§Panics
Panics if requested in a node outside resolve_text.
Sourcepub fn try_laidout(&self) -> Option<RwLockReadGuardOwned<LaidoutText>>
pub fn try_laidout(&self) -> Option<RwLockReadGuardOwned<LaidoutText>>
Read lock the current contextual laidout text if called in a node inside layout_text.
Note that this will block until a read lock can be acquired.
Sourcepub fn laidout(&self) -> RwLockReadGuardOwned<LaidoutText>
pub fn laidout(&self) -> RwLockReadGuardOwned<LaidoutText>
Read lock the current contextual laidout text.
§Panics
Panics if not available in context. Is only available inside layout_text after the first layout.
Sourcepub fn resolve_caret(
&self,
) -> MappedRwLockWriteGuardOwned<ResolvedText, CaretInfo>
pub fn resolve_caret( &self, ) -> MappedRwLockWriteGuardOwned<ResolvedText, CaretInfo>
Write lock the current contextual resolved text to edit the caret.
Note that the entire ResolvedText is exclusive locked, you cannot access the resolved text while holding this lock.
§Panics
Panics if requested in a node outside resolve_text.
Sourcepub fn resolve_rich_caret(
&self,
) -> MappedRwLockWriteGuardOwned<RichText, RichCaretInfo>
pub fn resolve_rich_caret( &self, ) -> MappedRwLockWriteGuardOwned<RichText, RichCaretInfo>
Sourcepub fn set_caret_retained_x(&self, x: Px)
pub fn set_caret_retained_x(&self, x: Px)
Set the caret_retained_x value.
Note that the value is already updated automatically on caret layout, this method is for rich text operations to propagate the line position between widgets.
Auto Trait Implementations§
impl Freeze for TEXT
impl RefUnwindSafe for TEXT
impl Send for TEXT
impl Sync for TEXT
impl Unpin for TEXT
impl UnwindSafe for TEXT
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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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