pub struct FileGroup { /* private fields */ }
Expand description
Represents a group of partitioned files that’ll be processed by a single thread. Maintains optional statistics across all files in the group.
Implementations§
Source§impl FileGroup
impl FileGroup
Sourcepub fn new(files: Vec<PartitionedFile>) -> Self
pub fn new(files: Vec<PartitionedFile>) -> Self
Creates a new FileGroup from a vector of PartitionedFile objects
Sourcepub fn with_statistics(self, statistics: Arc<Statistics>) -> Self
pub fn with_statistics(self, statistics: Arc<Statistics>) -> Self
Set the statistics for this group
Sourcepub fn files(&self) -> &[PartitionedFile]
pub fn files(&self) -> &[PartitionedFile]
Returns a slice of the files in this group
pub fn iter(&self) -> impl Iterator<Item = &PartitionedFile>
pub fn into_inner(self) -> Vec<PartitionedFile>
pub fn is_empty(&self) -> bool
Sourcepub fn pop(&mut self) -> Option<PartitionedFile>
pub fn pop(&mut self) -> Option<PartitionedFile>
Removes the last element from the files vector and returns it, or None if empty
Sourcepub fn push(&mut self, file: PartitionedFile)
pub fn push(&mut self, file: PartitionedFile)
Adds a file to the group
Sourcepub fn file_statistics(&self, index: Option<usize>) -> Option<&Statistics>
pub fn file_statistics(&self, index: Option<usize>) -> Option<&Statistics>
Get the specific file statistics for the given index
If the index is None, return the FileGroup
statistics
Sourcepub fn statistics_mut(&mut self) -> Option<&mut Statistics>
pub fn statistics_mut(&mut self) -> Option<&mut Statistics>
Get the mutable reference to the statistics for this group
Sourcepub fn split_files(self, n: usize) -> Vec<FileGroup>
pub fn split_files(self, n: usize) -> Vec<FileGroup>
Partition the list of files into n
groups
Trait Implementations§
Source§impl From<Vec<PartitionedFile>> for FileGroup
impl From<Vec<PartitionedFile>> for FileGroup
Source§fn from(files: Vec<PartitionedFile>) -> Self
fn from(files: Vec<PartitionedFile>) -> Self
Converts to this type from the input type.
Source§impl FromIterator<PartitionedFile> for FileGroup
impl FromIterator<PartitionedFile> for FileGroup
Source§fn from_iter<I: IntoIterator<Item = PartitionedFile>>(iter: I) -> Self
fn from_iter<I: IntoIterator<Item = PartitionedFile>>(iter: I) -> Self
Creates a value from an iterator. Read more
Auto Trait Implementations§
impl Freeze for FileGroup
impl !RefUnwindSafe for FileGroup
impl Send for FileGroup
impl Sync for FileGroup
impl Unpin for FileGroup
impl !UnwindSafe for FileGroup
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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