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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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
§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where
S: Into<Dispatch>,
§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