pub struct Glyph<'a> { /* private fields */ }๐Deprecated since 1.1.0: discontinued api
Expand description
Data for rendering/mapping graphemes to screen coordinates.
Implementationsยง
Sourceยงimpl<'a> Glyph<'a>
impl<'a> Glyph<'a>
pub fn new( glyph: Cow<'a, str>, text_bytes: Range<usize>, screen_pos: (u16, u16), screen_width: u16, pos: TextPosition, ) -> Self
Sourcepub fn text_bytes(&self) -> Range<usize>
pub fn text_bytes(&self) -> Range<usize>
Get the byte-range as absolute range into the complete text.
Sourcepub fn pos(&self) -> TextPosition
pub fn pos(&self) -> TextPosition
Get the position of the glyph
Sourcepub fn screen_pos(&self) -> (u16, u16)
pub fn screen_pos(&self) -> (u16, u16)
Get the screen position of the glyph.
Sourcepub fn screen_width(&self) -> u16
pub fn screen_width(&self) -> u16
Display width of the glyph.
Trait Implementationsยง
Auto Trait Implementationsยง
impl<'a> Freeze for Glyph<'a>
impl<'a> RefUnwindSafe for Glyph<'a>
impl<'a> Send for Glyph<'a>
impl<'a> Sync for Glyph<'a>
impl<'a> Unpin for Glyph<'a>
impl<'a> UnwindSafe for Glyph<'a>
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> 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