pub struct WriterPool { /* private fields */ }Expand description
Pool of per-table writers, creating files on demand.
Implementations§
Source§impl WriterPool
impl WriterPool
Sourcepub fn new(output_dir: PathBuf) -> Self
pub fn new(output_dir: PathBuf) -> Self
Create a new writer pool targeting the given output directory.
Sourcepub fn ensure_output_dir(&self) -> Result<()>
pub fn ensure_output_dir(&self) -> Result<()>
Create the output directory if it does not exist.
Sourcepub fn get_writer(&mut self, table_name: &str) -> Result<&mut TableWriter>
pub fn get_writer(&mut self, table_name: &str) -> Result<&mut TableWriter>
Get or create a writer for the given table name.
Sourcepub fn write_statement(&mut self, table_name: &str, stmt: &[u8]) -> Result<()>
pub fn write_statement(&mut self, table_name: &str, stmt: &[u8]) -> Result<()>
Write a statement to the file for the given table.
Auto Trait Implementations§
impl Freeze for WriterPool
impl RefUnwindSafe for WriterPool
impl Send for WriterPool
impl Sync for WriterPool
impl Unpin for WriterPool
impl UnsafeUnpin for WriterPool
impl UnwindSafe for WriterPool
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> 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