Struct rustfmt_nightly::config::file_lines::FileLines
source · 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
sourcepub(crate) fn is_all(&self) -> bool
pub(crate) fn is_all(&self) -> bool
Returns true
if this FileLines
contains all lines in all files.
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) -> boolwhere
F: FnMut(&Range) -> bool,
fn file_range_matches<F>(&self, file_name: &FileName, f: F) -> boolwhere
F: FnMut(&Range) -> 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 RefUnwindSafe for FileLines
impl Send for FileLines
impl Sync for FileLines
impl Unpin for FileLines
impl UnwindSafe for FileLines
Blanket Implementations§
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