pub struct Leaf<R = &'static [u8]> {
pub handle: R,
pub id: Arc<str>,
pub content_version: u8,
pub flags: Flags,
pub compress: CompressMode,
pub compression_algo: CompressionAlgorithm,
pub encrypt: bool,
pub sign: bool,
}Available on crate feature
builder only.Fields§
§handle: Rsource data
id: Arc<str>The ID under which the embedded data will be referenced
content_version: u8The version of the content, allowing you to track obsolete data.
flags: FlagsThe flags that will go into the archive write target.
compress: CompressModeAvailable on crate feature
compression only.How a Leaf should be compressed
compression_algo: CompressionAlgorithmAvailable on crate feature
compression only.The specific compression algorithm to use
encrypt: boolAvailable on crate feature
crypto only.Use encryption when writing into the target.
sign: boolAvailable on crate feature
crypto only.Whether to include a signature with this Leaf
Implementations§
Source§impl<R: Read + Send + Sync> Leaf<R>
impl<R: Read + Send + Sync> Leaf<R>
Sourcepub fn template<R2>(self, other: &Leaf<R2>) -> Self
pub fn template<R2>(self, other: &Leaf<R2>) -> Self
Copy all fields from another Leaf, except for handle and id.
Sourcepub fn compress(self, compress: CompressMode) -> Self
Available on crate feature compression only.
pub fn compress(self, compress: CompressMode) -> Self
compression only.Setter for the compress field
Sourcepub fn version(self, content_version: u8) -> Self
pub fn version(self, content_version: u8) -> Self
Setter for the content_version field
Sourcepub fn encrypt(self, encrypt: bool) -> Self
Available on crate feature crypto only.
pub fn encrypt(self, encrypt: bool) -> Self
crypto only.Setter for the encrypt field
Sourcepub fn sign(self, sign: bool) -> Self
Available on crate feature crypto only.
pub fn sign(self, sign: bool) -> Self
crypto only.Setter for the sign field
Sourcepub fn compression_algo(self, compression_algo: CompressionAlgorithm) -> Self
Available on crate feature compression only.
pub fn compression_algo(self, compression_algo: CompressionAlgorithm) -> Self
compression only.Setter for the compression_algo field
Trait Implementations§
Auto Trait Implementations§
impl<R> Freeze for Leaf<R>where
R: Freeze,
impl<R> RefUnwindSafe for Leaf<R>where
R: RefUnwindSafe,
impl<R> Send for Leaf<R>where
R: Send,
impl<R> Sync for Leaf<R>where
R: Sync,
impl<R> Unpin for Leaf<R>where
R: Unpin,
impl<R> UnwindSafe for Leaf<R>where
R: UnwindSafe,
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