Struct layout_2013::text::RunMapping
source · struct RunMapping {
byte_range: Range<usize>,
old_fragment_index: usize,
text_run_index: usize,
selected: bool,
}
Expand description
A mapping from a portion of an unscanned text fragment to the text run we’re going to create for it.
Fields§
§byte_range: Range<usize>
The range of byte indices within the text fragment.
old_fragment_index: usize
The index of the unscanned text fragment that this mapping corresponds to.
text_run_index: usize
The index of the text run we’re going to create.
selected: bool
Is the text in this fragment selected?
Implementations§
source§impl RunMapping
impl RunMapping
sourcefn new(run_info_list: &[RunInfo], fragment_index: usize) -> RunMapping
fn new(run_info_list: &[RunInfo], fragment_index: usize) -> RunMapping
Given the current set of text runs, creates a run mapping for the next fragment.
run_info_list
describes the set of runs we’ve seen already.
sourcefn flush(
self,
mappings: &mut Vec<RunMapping>,
run_info: &mut RunInfo,
text: &str,
compression: CompressionMode,
text_transform: TextTransform,
last_whitespace: &mut bool,
start_position: &mut usize,
end_position: usize,
)
fn flush( self, mappings: &mut Vec<RunMapping>, run_info: &mut RunInfo, text: &str, compression: CompressionMode, text_transform: TextTransform, last_whitespace: &mut bool, start_position: &mut usize, end_position: usize, )
Flushes this run mapping to the list. run_info
describes the text run that we’re
currently working on. text
refers to the text of this fragment.
sourcefn contains_insertion_point(&self, insertion_point: Option<ByteIndex>) -> bool
fn contains_insertion_point(&self, insertion_point: Option<ByteIndex>) -> bool
Is the insertion point for this text run within this mapping?
NOTE: We treat the range as inclusive at both ends, since the insertion point can lie before the first character or after the last character, and should be drawn even if the text is empty.
Trait Implementations§
source§impl Clone for RunMapping
impl Clone for RunMapping
source§fn clone(&self) -> RunMapping
fn clone(&self) -> RunMapping
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for RunMapping
impl Debug for RunMapping
impl Copy for RunMapping
Auto Trait Implementations§
impl Freeze for RunMapping
impl RefUnwindSafe for RunMapping
impl Send for RunMapping
impl Sync for RunMapping
impl Unpin for RunMapping
impl UnwindSafe for RunMapping
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> 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>
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>
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 more