pub enum FragmentContent {
Text {
text: String,
format: TextFormat,
offset: usize,
length: usize,
element_id: u64,
word_starts: Vec<u8>,
},
Image {
name: String,
width: u32,
height: u32,
quality: u32,
format: TextFormat,
offset: usize,
element_id: u64,
},
}Expand description
A contiguous run of content with uniform formatting within a block.
Offsets are block-relative: offset is the character position
within the block where this fragment starts (0 = block start).
Variants§
Text
A text run. The layout engine shapes these into glyphs.
Fields
§
format: TextFormat§
element_id: u64Stable synthesized id for the underlying format run
(see synth_element_id).
Survives edits that don’t delete the run (character insertions
inside the run keep the same id). Used by accessibility layers
to build stable NodeIds for AccessKit TextRun children.
Image
An inline image. The layout engine reserves space for it.
To retrieve the image pixel data, use the existing
TextDocument::resource(name) method.
Trait Implementations§
Source§impl Clone for FragmentContent
impl Clone for FragmentContent
Source§fn clone(&self) -> FragmentContent
fn clone(&self) -> FragmentContent
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for FragmentContent
impl Debug for FragmentContent
Source§impl PartialEq for FragmentContent
impl PartialEq for FragmentContent
Source§fn eq(&self, other: &FragmentContent) -> bool
fn eq(&self, other: &FragmentContent) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for FragmentContent
impl StructuralPartialEq for FragmentContent
Auto Trait Implementations§
impl Freeze for FragmentContent
impl RefUnwindSafe for FragmentContent
impl Send for FragmentContent
impl Sync for FragmentContent
impl Unpin for FragmentContent
impl UnsafeUnpin for FragmentContent
impl UnwindSafe for FragmentContent
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