pub struct RotatingWarcWriter { /* private fields */ }Expand description
Rotating WARC writer with compression
Implementations§
Source§impl RotatingWarcWriter
impl RotatingWarcWriter
Sourcepub fn new(base_dir: impl AsRef<Path>, prefix: impl Into<String>) -> Self
pub fn new(base_dir: impl AsRef<Path>, prefix: impl Into<String>) -> Self
Create a new rotating writer
Sourcepub fn with_max_size(self, max_size: u64) -> Self
pub fn with_max_size(self, max_size: u64) -> Self
Set max file size
Sourcepub fn with_compression(self, compress: bool) -> Self
pub fn with_compression(self, compress: bool) -> Self
Enable/disable compression
Sourcepub fn current_filename(&self) -> PathBuf
pub fn current_filename(&self) -> PathBuf
Get the current filename
Sourcepub fn create_file(&self) -> Result<WarcFileHandle>
pub fn create_file(&self) -> Result<WarcFileHandle>
Create a new WARC file
Sourcepub fn rotate(&self) -> Result<WarcFileHandle>
pub fn rotate(&self) -> Result<WarcFileHandle>
Rotate to the next file
Sourcepub fn needs_rotation(&self, handle: &WarcFileHandle) -> bool
pub fn needs_rotation(&self, handle: &WarcFileHandle) -> bool
Check if rotation is needed based on size
Auto Trait Implementations§
impl !Freeze for RotatingWarcWriter
impl RefUnwindSafe for RotatingWarcWriter
impl Send for RotatingWarcWriter
impl Sync for RotatingWarcWriter
impl Unpin for RotatingWarcWriter
impl UnwindSafe for RotatingWarcWriter
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