Struct layout_2013::text::TextRunScanner
source · pub struct TextRunScanner {
pub clump: LinkedList<Fragment>,
}
Expand description
A stack-allocated object for scanning an inline flow into TextRun
-containing TextFragment
s.
Fields§
§clump: LinkedList<Fragment>
Implementations§
source§impl TextRunScanner
impl TextRunScanner
pub fn new() -> TextRunScanner
pub fn scan_for_runs( &mut self, font_context: &FontContext, fragments: LinkedList<Fragment>, ) -> InlineFragments
sourcefn flush_clump_to_list(
&mut self,
font_context: &FontContext,
out_fragments: &mut Vec<Fragment>,
paragraph_bytes_processed: &mut usize,
bidi_levels: Option<&[Level]>,
last_whitespace: bool,
linebreaker: &mut Option<LineBreakLeafIter>,
) -> bool
fn flush_clump_to_list( &mut self, font_context: &FontContext, out_fragments: &mut Vec<Fragment>, paragraph_bytes_processed: &mut usize, bidi_levels: Option<&[Level]>, last_whitespace: bool, linebreaker: &mut Option<LineBreakLeafIter>, ) -> bool
A “clump” is a range of inline flow leaves that can be merged together into a single fragment. Adjacent text with the same style can be merged, and nothing else can.
The flow keeps track of the fragments contained by all non-leaf DOM nodes. This is necessary for correct painting order. Since we compress several leaf fragments here, the mapping must be adjusted.
Auto Trait Implementations§
impl Freeze for TextRunScanner
impl !RefUnwindSafe for TextRunScanner
impl Send for TextRunScanner
impl Sync for TextRunScanner
impl Unpin for TextRunScanner
impl !UnwindSafe for TextRunScanner
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
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moresource§impl<T> MaybeBoxed<Box<T>> for T
impl<T> MaybeBoxed<Box<T>> for T
source§fn maybe_boxed(self) -> Box<T>
fn maybe_boxed(self) -> Box<T>
Convert
source§impl<T> MaybeBoxed<T> for T
impl<T> MaybeBoxed<T> for T
source§fn maybe_boxed(self) -> T
fn maybe_boxed(self) -> T
Convert