pub struct Fragment {Show 15 fields
pub x: f32,
pub lead: f32,
pub fixed: f32,
pub height: f32,
pub break_before: BreakPoint,
pub piece: Piece,
pub marks: Option<Box<Marks>>,
pub decorations: Option<Box<Decorations>>,
pub markers: Option<Box<Vec<Marker>>>,
pub notes: Option<Box<Vec<Arc<Note>>>>,
pub reflow: Option<Arc<Reflow>>,
pub spanning: bool,
pub layer: i32,
pub offset: (f32, f32),
pub opacity: f32,
}Expand description
One thing the flow can place: a line, an image, an ornament.
Everything horizontal is settled here — indentation, alignment, the measure a drop cap left — so the flow only stacks.
Fields§
§x: f32Leading edge, from the content box’s own.
lead: f32Space above, from the margins around it. A page that opens on this fragment drops it.
fixed: f32Space above that a page break does not drop and no margin collapses through: the borders and padding between this fragment and whatever is above it.
height: f32The fragment’s own height.
break_before: BreakPointWhether a page may end above it.
piece: PieceWhat it paints.
marks: Option<Box<Marks>>What it tells the page furniture when it lands. Boxed because a book has thousands of fragments and a handful of chapter headings.
decorations: Option<Box<Decorations>>The decorated blocks this fragment opens and closes. Boxed for the same reason: most fragments decorate nothing.
markers: Option<Box<Vec<Marker>>>The markers of the list items that open on this fragment, outermost first. Boxed, because most fragments open no item.
notes: Option<Box<Vec<Arc<Note>>>>The notes whose references were set on this fragment, in the order they were written. They are set at the foot of whichever page the fragment lands on. Boxed: a book has thousands of lines and a handful of notes.
reflow: Option<Arc<Reflow>>The paragraph this line came out of, shared by every line of
it, and None on everything else. The flow reads it where an
image narrows the bands the paragraph is set in. A book that
anchors nothing keeps none of this.
spanning: boolWhether it came out of a block that spans every column, from
column-span: all. Its leading edge and its measure are then
the whole content box’s rather than one column’s.
layer: i32The layer the fragment’s own items paint in, from the
z-index of the block it came out of. A row carries the
layers of the table it is part of on its items, so this is not
read for one.
offset: (f32, f32)How far position: relative moves what the fragment paints,
across and down, from the blocks it came out of. Nothing around
the fragment moves with it.
opacity: f32How much of what the fragment paints shows, from 0 to 1: the
opacity of the blocks it came out of, multiplied together.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Fragment
impl RefUnwindSafe for Fragment
impl Send for Fragment
impl Sync for Fragment
impl Unpin for Fragment
impl UnsafeUnpin for Fragment
impl UnwindSafe for Fragment
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> ErasedDestructor for Twhere
T: 'static,
§impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
impl<U, T> ToOwnedObj<U> for Twhere
U: FromObjRef<T>,
§fn to_owned_obj(&self, data: FontData<'_>) -> U
fn to_owned_obj(&self, data: FontData<'_>) -> U
T, using the provided data to resolve any offsets.