Struct libpna::SolidEntryBuilder
source · pub struct SolidEntryBuilder { /* private fields */ }Expand description
A builder for creating a new solid Entry.
Implementations§
source§impl SolidEntryBuilder
impl SolidEntryBuilder
sourcepub fn new(option: WriteOption) -> Result<Self>
pub fn new(option: WriteOption) -> Result<Self>
Creates a new SolidEntryBuilder with the given option.
§Arguments
option- The write option specifying the compression and encryption settings.
§Returns
A new SolidEntryBuilder.
sourcepub fn add_entry(&mut self, entry: RegularEntry) -> Result<usize>
pub fn add_entry(&mut self, entry: RegularEntry) -> Result<usize>
Adds an entry to the solid archive.
§Arguments
entry- The entry to add to the archive.
§Examples
use libpna::{EntryBuilder, SolidEntryBuilder, WriteOption};
use std::io;
use std::io::Write;
let mut builder = SolidEntryBuilder::new(WriteOption::builder().build())?;
let dir_entry = EntryBuilder::new_dir("example".into()).build()?;
builder.add_entry(dir_entry)?;
let mut entry_builder =
EntryBuilder::new_file("example/text.txt".into(), WriteOption::store())?;
entry_builder.write_all(b"content")?;
let file_entry = entry_builder.build()?;
builder.add_entry(file_entry)?;
builder.build()?;Auto Trait Implementations§
impl Freeze for SolidEntryBuilder
impl RefUnwindSafe for SolidEntryBuilder
impl Send for SolidEntryBuilder
impl !Sync for SolidEntryBuilder
impl Unpin for SolidEntryBuilder
impl UnwindSafe for SolidEntryBuilder
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