pub struct FileLines(Option<HashMap<FileName, Vec<Range>>>);
Expand description
A set of lines in files.
It is represented as a multimap keyed on file names, with values a collection of
non-overlapping ranges sorted by their start point. An inner None
is interpreted to mean all
lines in all files.
Tuple Fields§
§0: Option<HashMap<FileName, Vec<Range>>>
Implementations§
source§impl FileLines
impl FileLines
pub fn from_ranges(ranges: HashMap<FileName, Vec<Range>>) -> FileLines
sourcepub fn to_json_spans(&self) -> Vec<JsonSpan>
pub fn to_json_spans(&self) -> Vec<JsonSpan>
Returns JSON representation as accepted by the --file-lines JSON
arg.
sourcefn file_range_matches<F>(&self, file_name: &FileName, f: F) -> bool
fn file_range_matches<F>(&self, file_name: &FileName, f: F) -> bool
Returns true
if self
includes all lines in all files. Otherwise runs f
on all ranges
in the designated file (if any) and returns true if f
ever does.
sourcepub(crate) fn contains(&self, range: &LineRange) -> bool
pub(crate) fn contains(&self, range: &LineRange) -> bool
Returns true
if range
is fully contained in self
.
sourcepub(crate) fn intersects(&self, range: &LineRange) -> bool
pub(crate) fn intersects(&self, range: &LineRange) -> bool
Returns true
if any lines in range
are in self
.
sourcepub(crate) fn contains_line(&self, file_name: &FileName, line: usize) -> bool
pub(crate) fn contains_line(&self, file_name: &FileName, line: usize) -> bool
Returns true
if line
from file_name
is in self
.
Trait Implementations§
source§impl ConfigType for FileLines
impl ConfigType for FileLines
source§impl<'de> Deserialize<'de> for FileLines
impl<'de> Deserialize<'de> for FileLines
source§fn deserialize<D>(_: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(_: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
impl StructuralPartialEq for FileLines
Auto Trait Implementations§
impl Freeze for FileLines
impl RefUnwindSafe for FileLines
impl Send for FileLines
impl Sync for FileLines
impl Unpin for FileLines
impl UnwindSafe for FileLines
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 more§impl<T> Pointable for T
impl<T> Pointable for T
source§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<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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: 48 bytes