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
sourceimpl 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 files(&self) -> Files<'_>ⓘNotable traits for Files<'a>impl<'a> Iterator for Files<'a> type Item = &'a FileName;
pub fn files(&self) -> Files<'_>ⓘNotable traits for Files<'a>impl<'a> Iterator for Files<'a> type Item = &'a FileName;
Returns an iterator over the files contained in self
.
sourcepub fn to_json_spans(&self) -> Vec<JsonSpan>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
pub fn to_json_spans(&self) -> Vec<JsonSpan>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A>where
A: Allocator,
A: Allocator,
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
sourceimpl ConfigType for FileLines
impl ConfigType for FileLines
sourceimpl<'de> Deserialize<'de> for FileLines
impl<'de> Deserialize<'de> for FileLines
sourcefn 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
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
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