pub struct Segment {
pub start: usize,
pub end: usize,
pub user_start: usize,
pub file: PathBuf,
pub exact: bool,
}Expand description
One contributed segment of the combined source: its [start, end) byte range
in the combined string, the ORIGINAL file it came from, and — for a byte-intact
segment — the offset in that file its start corresponds to.
Fields§
§start: usizeSegment start in the combined source.
end: usizeSegment end (exclusive) in the combined source.
user_start: usizeThe offset in the ORIGINAL file that start maps to. Meaningful only when
exact; a transformed module segment leaves it 0.
file: PathBufThe file that contributed this segment.
exact: boolTrue when the combined text over this segment is byte-identical to the
original file’s text (the entry’s own leading prose + code, absent privacy
mangling), so user_start + (offset - start) indexes the original file
directly. A module segment is transformed (note-block / privacy stripping,
owner-mangling) and is NOT exact.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Segment
impl RefUnwindSafe for Segment
impl Send for Segment
impl Sync for Segment
impl Unpin for Segment
impl UnsafeUnpin for Segment
impl UnwindSafe for Segment
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.