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 y these two contexts.
Implementations§
source§impl TEXT
impl TEXT
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 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.
§Panics
Panics if requested in a node outside resolve_text
.
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