pub enum FragmentContent {
Text {
text: String,
format: TextFormat,
offset: usize,
length: usize,
},
Image {
name: String,
width: u32,
height: u32,
quality: u32,
format: TextFormat,
offset: usize,
},
}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: TextFormatImage
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 · 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
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