pub struct Glyph<'a> { /* private fields */ }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