pub struct CharacterHit { /* private fields */ }Expand description
Represents information about a character hit within a glyph run.
The CharacterHit structure provides information about the index of the
first character that got hit as well as information about leading or
trailing edge.
Indices and lengths are UTF-16 code units (see the index-unit note in
media/text_formatting/mod.rs).
Implementations§
Source§impl CharacterHit
impl CharacterHit
Sourcepub const fn new(first_character_index: i32) -> Self
pub const fn new(first_character_index: i32) -> Self
Creates a hit on the leading edge of the character at first_character_index.
Sourcepub const fn with_trailing_length(
first_character_index: i32,
trailing_length: i32,
) -> Self
pub const fn with_trailing_length( first_character_index: i32, trailing_length: i32, ) -> Self
Creates a hit with a trailing length.
Sourcepub const fn first_character_index(&self) -> i32
pub const fn first_character_index(&self) -> i32
Gets the index of the first character that got hit.
Sourcepub const fn trailing_length(&self) -> i32
pub const fn trailing_length(&self) -> i32
Gets the trailing length value for the character that got hit.
Trait Implementations§
Source§impl Clone for CharacterHit
impl Clone for CharacterHit
impl Copy for CharacterHit
Source§impl Debug for CharacterHit
impl Debug for CharacterHit
Source§impl Default for CharacterHit
impl Default for CharacterHit
impl Eq for CharacterHit
Source§impl Hash for CharacterHit
impl Hash for CharacterHit
Source§impl PartialEq for CharacterHit
impl PartialEq for CharacterHit
impl StructuralPartialEq for CharacterHit
Auto Trait Implementations§
impl Freeze for CharacterHit
impl RefUnwindSafe for CharacterHit
impl Send for CharacterHit
impl Sync for CharacterHit
impl Unpin for CharacterHit
impl UnsafeUnpin for CharacterHit
impl UnwindSafe for CharacterHit
Blanket Implementations§
Source§impl<T> AnyValue for Twhere
T: PartialEq + 'static,
impl<T> AnyValue for Twhere
T: PartialEq + 'static,
fn any_value_as_any(&self) -> &(dyn Any + 'static)
fn any_value_eq(&self, other: &(dyn AnyValue + 'static)) -> bool
fn any_value_type_name(&self) -> &'static str
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> ClassDefaults for Twhere
T: ?Sized,
impl<T> ClassDefaults for Twhere
T: ?Sized,
Source§fn static_constructor()
fn static_constructor()
The static constructor of a type: work done once per thread, after
the properties of the type are registered and before its first
instance exists (class handlers,
affects_render, metadata
overrides). Read more