pub struct BarcFile { /* private fields */ }
Expand description
Reference to a BARC File by Path
, supporting up to 1 writer and N
readers concurrently.
Implementations
sourceimpl BarcFile
impl BarcFile
sourcepub fn new<P>(path: P) -> BarcFilewhere
P: AsRef<Path>,
pub fn new<P>(path: P) -> BarcFilewhere
P: AsRef<Path>,
Return new instance for the specified path, which may be an
existing file, or one to be created when writer
is opened.
sourcepub fn writer(&self) -> Result<BarcWriter<'_>, BarcError>
pub fn writer(&self) -> Result<BarcWriter<'_>, BarcError>
Get a writer for this file, opening the file for write (and
possibly creating it, or erroring) if this is the first time
called. May block on the write lock, as only one BarcWriter
instance is allowed.
sourcepub fn reader(&self) -> Result<BarcReader, BarcError>
pub fn reader(&self) -> Result<BarcReader, BarcError>
Get a reader for this file. Errors if the file does not exist.
Auto Trait Implementations
impl RefUnwindSafe for BarcFile
impl Send for BarcFile
impl Sync for BarcFile
impl Unpin for BarcFile
impl UnwindSafe for BarcFile
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more