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: impl WriteOption) -> Result<Self>
pub fn new(option: impl WriteOption) -> Result<Self>
Creates a new SolidEntryBuilder with the given option.
§Arguments
option- The option for specifying solid entry’s the compression and encryption settings.
§Returns
A new SolidEntryBuilder.
Sourcepub fn add_entry<T>(&mut self, entry: NormalEntry<T>) -> Result<usize>where
NormalEntry<T>: Entry,
pub fn add_entry<T>(&mut self, entry: NormalEntry<T>) -> Result<usize>where
NormalEntry<T>: Entry,
Adds an entry to the solid archive.
§Arguments
entry- The entry to add to the archive.
§Examples
use libpna::{EntryBuilder, SolidEntryBuilder, WriteOptions};
use std::io;
use std::io::Write;
let mut builder = SolidEntryBuilder::new(WriteOptions::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(), WriteOptions::store())?;
entry_builder.write_all(b"content")?;
let file_entry = entry_builder.build()?;
builder.add_entry(file_entry)?;
builder.build()?;Sourcepub fn add_extra_chunk<T: Into<RawChunk>>(&mut self, chunk: T)
pub fn add_extra_chunk<T: Into<RawChunk>>(&mut self, chunk: T)
Adds extra chunk to the solid entry.
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