Struct rustc_span::SourceFileDiffs
source · pub struct SourceFileDiffs {
pub(crate) bytes_per_diff: usize,
pub(crate) num_diffs: usize,
pub(crate) raw_diffs: Vec<u8>,
}
Expand description
The source file lines in difference list form. This matches the form used within metadata, which saves space by exploiting the fact that the lines list is sorted and individual lines are usually not that long.
We read it directly from metadata and only decode it into Lines
form
when necessary. This is a significant performance win, especially for
small crates where very little of std
’s metadata is used.
Fields§
§bytes_per_diff: usize
Always 1, 2, or 4. Always as small as possible, while being big enough to hold the length of the longest line in the source file. The 1 case is by far the most common.
num_diffs: usize
The number of diffs encoded in raw_diffs
. Always one less than
the number of lines in the source file.
raw_diffs: Vec<u8>
The diffs in “raw” form. Each segment of bytes_per_diff
length
encodes one little-endian diff. Note that they aren’t LEB128
encoded. This makes for much faster decoding. Besides, the
bytes_per_diff==1 case is by far the most common, and LEB128
encoding has no effect on that case.
Trait Implementations§
source§impl Clone for SourceFileDiffs
impl Clone for SourceFileDiffs
source§fn clone(&self) -> SourceFileDiffs
fn clone(&self) -> SourceFileDiffs
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for SourceFileDiffs
impl RefUnwindSafe for SourceFileDiffs
impl Send for SourceFileDiffs
impl Sync for SourceFileDiffs
impl Unpin for SourceFileDiffs
impl UnwindSafe for SourceFileDiffs
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,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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 moresource§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<'a, T> Captures<'a> for Twhere
T: ?Sized,
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 40 bytes