pub struct Fragment {
pub nodes: SmallVec<[Node; 8]>,
}
Expand description
Part of a pretty document, made up of Node
s.
Fields§
§nodes: SmallVec<[Node; 8]>
Implementations§
source§impl Fragment
impl Fragment
pub fn new(fragments: impl IntoIterator<Item = impl Into<Self>>) -> Self
sourcepub fn layout_with_max_line_width(
self,
max_line_width: usize
) -> FragmentPostLayout
pub fn layout_with_max_line_width( self, max_line_width: usize ) -> FragmentPostLayout
Perform layout on the Fragment
, limiting lines to max_line_width
columns where possible.
source§impl Fragment
impl Fragment
sourcefn approx_layout(&mut self, max_widths: MaxWidths) -> ApproxLayout
fn approx_layout(&mut self, max_widths: MaxWidths) -> ApproxLayout
Determine the ApproxLayout
of this Fragment
, potentially making
adjustments in order to fit within max_widths
.
source§impl Fragment
impl Fragment
sourcefn render_to_line_ops(
&self,
directly_in_block: bool
) -> impl InternalIterator<Item = LineOp<'_>>
fn render_to_line_ops( &self, directly_in_block: bool ) -> impl InternalIterator<Item = LineOp<'_>>
sourcefn render_to_text_ops(&self) -> impl InternalIterator<Item = TextOp<'_>>
fn render_to_text_ops(&self) -> impl InternalIterator<Item = TextOp<'_>>
Trait Implementations§
source§impl PartialEq for Fragment
impl PartialEq for Fragment
impl StructuralPartialEq for Fragment
Auto Trait Implementations§
impl RefUnwindSafe for Fragment
impl !Send for Fragment
impl !Sync for Fragment
impl Unpin 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
Mutably borrows from an owned value. Read more