Struct box_format::BoxFileWriter [−][src]
pub struct BoxFileWriter { /* fields omitted */ }
Implementations
impl BoxFileWriter
[src]
pub fn finish(self) -> Result<u64>
[src]
pub fn open<P: AsRef<Path>>(path: P) -> Result<BoxFileWriter>
[src]
This will open an existing .box
file for writing, and error if the file is not valid.
pub fn create<P: AsRef<Path>>(path: P) -> Result<BoxFileWriter>
[src]
This will create a new .box
file for writing, and error if the file already exists.
pub fn create_with_alignment<P: AsRef<Path>>(
path: P,
alignment: u64
) -> Result<BoxFileWriter>
[src]
path: P,
alignment: u64
) -> Result<BoxFileWriter>
This will create a new .box
file for reading and writing, and error if the file already exists.
Will insert byte-aligned values based on provided alignment
value. For best results, consider a power of 2.
pub fn path(&self) -> &Path
[src]
pub fn alignment(&self) -> u64
[src]
pub fn version(&self) -> u32
[src]
pub fn metadata(&self) -> &BoxMetadata
[src]
Will return the metadata for the .box
if it has been provided.
pub fn mkdir(
&mut self,
path: BoxPath,
attrs: HashMap<String, Vec<u8>>
) -> Result<()>
[src]
&mut self,
path: BoxPath,
attrs: HashMap<String, Vec<u8>>
) -> Result<()>
pub fn link(
&mut self,
path: BoxPath,
target: BoxPath,
attrs: HashMap<String, Vec<u8>>
) -> Result<()>
[src]
&mut self,
path: BoxPath,
target: BoxPath,
attrs: HashMap<String, Vec<u8>>
) -> Result<()>
pub fn insert<R: Read>(
&mut self,
compression: Compression,
path: BoxPath,
value: &mut R,
attrs: HashMap<String, Vec<u8>>
) -> Result<&FileRecord>
[src]
&mut self,
compression: Compression,
path: BoxPath,
value: &mut R,
attrs: HashMap<String, Vec<u8>>
) -> Result<&FileRecord>
pub unsafe fn data(&self, record: &FileRecord) -> Result<Mmap>
[src]
Safety
Use of memory maps is unsafe as modifications to the file could affect the operation of the application. Ensure that the Box being operated on is not mutated while a memory map is in use.
pub fn set_attr<S: AsRef<str>>(
&mut self,
path: &BoxPath,
key: S,
value: Vec<u8>
) -> Result<()>
[src]
&mut self,
path: &BoxPath,
key: S,
value: Vec<u8>
) -> Result<()>
pub fn set_file_attr<S: AsRef<str>>(
&mut self,
key: S,
value: Vec<u8>
) -> Result<()>
[src]
&mut self,
key: S,
value: Vec<u8>
) -> Result<()>
Trait Implementations
impl Drop for BoxFileWriter
[src]
Auto Trait Implementations
impl RefUnwindSafe for BoxFileWriter
impl Send for BoxFileWriter
impl Sync for BoxFileWriter
impl Unpin for BoxFileWriter
impl UnwindSafe for BoxFileWriter
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,