Struct zng_wgt_text::node::TEXT
source · 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> 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> 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