pub struct Split {
pub in_file: Option<PathBuf>,
pub out_dir: Option<PathBuf>,
pub chunk_size: usize,
pub buffer_capacity: usize,
}Expand description
Process to split file from a path to a directory.
§Example
use std::path::PathBuf;
use filerune_fusion::split::{Split, SplitResult};
let result: SplitResult = Split::new()
.in_file(PathBuf::from("path").join("to").join("file"))
.out_dir(PathBuf::from("path").join("to").join("dir"))
.run()
.unwrap();Fields§
§in_file: Option<PathBuf>§out_dir: Option<PathBuf>§chunk_size: usize§buffer_capacity: usizeImplementations§
Source§impl Split
impl Split
Sourcepub fn from<P: Into<Split>>(process: P) -> Self
pub fn from<P: Into<Split>>(process: P) -> Self
Create a new split process from an existing one.
Sourcepub fn chunk_size(self, size: usize) -> Self
pub fn chunk_size(self, size: usize) -> Self
Set the maximum size of each chunk.
By default, the chunk size follows the CHUNK_SIZE_DEFAULT.
Sourcepub fn buffer_capacity(self, capacity: usize) -> Self
pub fn buffer_capacity(self, capacity: usize) -> Self
Set the size of the buffer capacity.
By default, it is BUFFER_CAPACITY_DEFAULT.
Sourcepub fn run(&self) -> Result<SplitResult, SplitError>
pub fn run(&self) -> Result<SplitResult, SplitError>
Run the split process.
Trait Implementations§
Source§impl SplitAsyncExt for Split
impl SplitAsyncExt for Split
Source§async fn run_async(&self) -> Result<SplitResult, SplitError>
async fn run_async(&self) -> Result<SplitResult, SplitError>
Run the split process asynchronously.
Source§impl SplitAsyncExt for Split
impl SplitAsyncExt for Split
Source§async fn run_async(&self) -> Result<SplitResult, SplitError>
async fn run_async(&self) -> Result<SplitResult, SplitError>
Run the split process asynchronously.
Source§impl SplitAsyncExt for Split
impl SplitAsyncExt for Split
Source§async fn run_async(&self) -> Result<SplitResult, SplitError>
async fn run_async(&self) -> Result<SplitResult, SplitError>
Run the split process asynchronously.
Auto Trait Implementations§
impl Freeze for Split
impl RefUnwindSafe for Split
impl Send for Split
impl Sync for Split
impl Unpin for Split
impl UnsafeUnpin for Split
impl UnwindSafe for Split
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