pub struct FileSetConfig {
n_file_sets: usize,
map: Map<Vec<u8>>,
}Expand description
This contains path prefixes to partition a Vfs into FileSets.
§Example
let mut builder = FileSetConfigBuilder::default();
builder.add_file_set(vec![VfsPath::new_virtual_path("/src".to_string())]);
let config = builder.build();
let mut file_system = Vfs::default();
file_system.set_file_contents(VfsPath::new_virtual_path("/src/main.rs".to_string()), Some(vec![]));
file_system.set_file_contents(VfsPath::new_virtual_path("/src/lib.rs".to_string()), Some(vec![]));
file_system.set_file_contents(VfsPath::new_virtual_path("/build.rs".to_string()), Some(vec![]));
// contains the sets :
// { "/src/main.rs", "/src/lib.rs" }
// { "build.rs" }
let sets = config.partition(&file_system);Fields§
§n_file_sets: usizeNumber of sets that self can partition a Vfs into.
This should be the number of sets in self.map + 1 for files that don’t fit in any
defined set.
map: Map<Vec<u8>>Map from encoded paths to the set they belong to.
Implementations§
Source§impl FileSetConfig
impl FileSetConfig
Sourcepub fn builder() -> FileSetConfigBuilder
pub fn builder() -> FileSetConfigBuilder
Returns a builder for FileSetConfig.
Sourcepub fn partition(&self, vfs: &Vfs) -> Vec<FileSet>
pub fn partition(&self, vfs: &Vfs) -> Vec<FileSet>
Partition vfs into FileSets.
Creates a new FileSet for every set of prefixes in self.
Trait Implementations§
Source§impl Debug for FileSetConfig
impl Debug for FileSetConfig
Auto Trait Implementations§
impl Freeze for FileSetConfig
impl RefUnwindSafe for FileSetConfig
impl Send for FileSetConfig
impl Sync for FileSetConfig
impl Unpin for FileSetConfig
impl UnsafeUnpin for FileSetConfig
impl UnwindSafe for FileSetConfig
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
Mutably borrows from an owned value. Read more
§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>
Converts
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>
Converts
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