pub struct DirEntryBuilder { /* private fields */ }Expand description
A builder for creating a directory NormalEntry.
Directories carry no data content, so this builder does not implement
Write.
§Examples
use libpna::DirEntryBuilder;
let entry = DirEntryBuilder::new("dir/".into()).build()?;Implementations§
Source§impl DirEntryBuilder
impl DirEntryBuilder
Sourcepub const fn new(name: EntryName) -> DirEntryBuilder
pub const fn new(name: EntryName) -> DirEntryBuilder
Creates a builder for a directory entry.
Sourcepub fn metadata(&mut self, metadata: Metadata) -> &mut DirEntryBuilder
pub fn metadata(&mut self, metadata: Metadata) -> &mut DirEntryBuilder
Sets the metadata of the entry, replacing any previously set metadata.
The raw file size and compressed size recorded in the given metadata
are ignored; build() computes them.
Sourcepub fn add_extra_chunk<T>(&mut self, chunk: T) -> &mut DirEntryBuilder
pub fn add_extra_chunk<T>(&mut self, chunk: T) -> &mut DirEntryBuilder
Adds extra chunk to the entry.
Sourcepub fn build(self) -> Result<NormalEntry, Error>
pub fn build(self) -> Result<NormalEntry, Error>
Consumes this builder and returns the constructed NormalEntry.
§Errors
Returns an error if an I/O error occurs while building entry into buffer.
Auto Trait Implementations§
impl !Freeze for DirEntryBuilder
impl RefUnwindSafe for DirEntryBuilder
impl Send for DirEntryBuilder
impl Sync for DirEntryBuilder
impl Unpin for DirEntryBuilder
impl UnsafeUnpin for DirEntryBuilder
impl UnwindSafe for DirEntryBuilder
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
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more