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]

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]

pub fn insert<R: Read>(
    &mut self,
    compression: Compression,
    path: BoxPath,
    value: &mut R,
    attrs: HashMap<String, Vec<u8>>
) -> Result<&FileRecord>
[src]

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]

pub fn set_file_attr<S: AsRef<str>>(
    &mut self,
    key: S,
    value: Vec<u8>
) -> Result<()>
[src]

Trait Implementations

impl Drop for BoxFileWriter[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.