pub struct SymlinkEntryBuilder(/* private fields */);Expand description
A builder for creating a symbolic link NormalEntry.
The entry data is the UTF-8 encoded link target path, fixed at
construction time; this builder does not implement
Write.
Implementations§
Source§impl SymlinkEntryBuilder
impl SymlinkEntryBuilder
Sourcepub fn new(
name: EntryName,
source: EntryReference,
) -> Result<SymlinkEntryBuilder, Error>
pub fn new( name: EntryName, source: EntryReference, ) -> Result<SymlinkEntryBuilder, Error>
Creates a builder that stores the link target without compression or encryption.
§Errors
Returns an error if initialization fails.
Sourcepub fn new_with_options(
name: EntryName,
source: EntryReference,
option: impl WriteOption,
) -> Result<SymlinkEntryBuilder, Error>
pub fn new_with_options( name: EntryName, source: EntryReference, option: impl WriteOption, ) -> Result<SymlinkEntryBuilder, Error>
Creates a builder with the given write options; the link target is compressed and encrypted accordingly.
When option.encryption() is Encryption::NO, the cipher
mode recorded in the header is CipherMode::CBC regardless
of option.cipher_mode(), matching the wire representation
produced by the legacy link constructors.
§Errors
Returns an error if initialization fails.
Sourcepub fn metadata(&mut self, metadata: Metadata) -> &mut SymlinkEntryBuilder
pub fn metadata(&mut self, metadata: Metadata) -> &mut SymlinkEntryBuilder
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 SymlinkEntryBuilder
pub fn add_extra_chunk<T>(&mut self, chunk: T) -> &mut SymlinkEntryBuilder
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 SymlinkEntryBuilder
impl !UnwindSafe for SymlinkEntryBuilder
impl RefUnwindSafe for SymlinkEntryBuilder
impl Send for SymlinkEntryBuilder
impl Sync for SymlinkEntryBuilder
impl Unpin for SymlinkEntryBuilder
impl UnsafeUnpin for SymlinkEntryBuilder
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
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>
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>
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