pub struct AccessRun {
pub key: Key,
pub line: usize,
pub start: usize,
pub end: usize,
pub text: String,
pub rect: Rect,
pub char_lengths: Vec<u8>,
pub char_positions: Vec<f32>,
pub char_widths: Vec<f32>,
pub word_starts: Vec<u8>,
pub rtl: bool,
}Expand description
One visual line (or a piece of one) of an editor’s text, with what a
screen reader needs to read it by character and word and to place a
caret: every character’s byte length, x position and width. A line
that continues into another ends with its "\n", counted as a
character of zero width. Runs longer than RUN_CHARS characters are
split, so indices fit the platform’s byte-sized ones.
Fields§
§key: KeyThe run’s own id (derived from the editor’s key).
line: usizeThe line it belongs to: a buffer line for a built-in editor, the
ordinal of the role="line" node for a custom one.
start: usizeByte range of the run inside the line’s text (the "\n" excluded).
end: usize§text: String§rect: RectLogical px, viewport coordinates, cut to the clip the text is
drawn under as a node’s rect is; char_positions still place
every character where it is drawn.
char_lengths: Vec<u8>§char_positions: Vec<f32>Each character’s x relative to rect.x, and its width.
char_widths: Vec<f32>§word_starts: Vec<u8>Character indices where words start.
rtl: boolImplementations§
Trait Implementations§
impl StructuralPartialEq for AccessRun
Auto Trait Implementations§
impl Freeze for AccessRun
impl RefUnwindSafe for AccessRun
impl Send for AccessRun
impl Sync for AccessRun
impl Unpin for AccessRun
impl UnsafeUnpin for AccessRun
impl UnwindSafe for AccessRun
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§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.Source§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.Source§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.Source§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.