pub struct DeliveryBlob {
pub header: DeliveryBlobHeader,
pub payload_length: usize,
pub is_compressed: bool,
}Expand description
Untyped header + metadata fields of an RFC 0207 delivery blob.
Fields§
§header: DeliveryBlobHeader§payload_length: usize§is_compressed: boolImplementations§
Source§impl DeliveryBlob
impl DeliveryBlob
Sourcepub fn parse(
data: &[u8],
allow_type3: bool,
) -> Result<Option<(DeliveryBlob, &[u8])>, DeliveryBlobError>
pub fn parse( data: &[u8], allow_type3: bool, ) -> Result<Option<(DeliveryBlob, &[u8])>, DeliveryBlobError>
Attempt to parse data as a delivery blob. On success, returns validated blob info,
and the remainder of data representing the blob payload.
If allow_type3 is false, Type 3 delivery blobs will return
DeliveryBlobError::InvalidType.
Sourcepub fn decompressed_size(delivery_blob: &[u8]) -> Result<u64, DecompressError>
pub fn decompressed_size(delivery_blob: &[u8]) -> Result<u64, DecompressError>
Return the decompressed size of the blob without decompressing it.
Sourcepub fn decompress(delivery_blob: &[u8]) -> Result<Vec<u8>, DecompressError>
pub fn decompress(delivery_blob: &[u8]) -> Result<Vec<u8>, DecompressError>
Decompress a delivery blob in delivery_blob.
Sourcepub fn decompress_to(
delivery_blob: &[u8],
writer: impl Write,
) -> Result<(), DecompressError>
pub fn decompress_to( delivery_blob: &[u8], writer: impl Write, ) -> Result<(), DecompressError>
Decompress a delivery blob in delivery_blob to writer.
Trait Implementations§
Source§impl Clone for DeliveryBlob
impl Clone for DeliveryBlob
Source§fn clone(&self) -> DeliveryBlob
fn clone(&self) -> DeliveryBlob
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for DeliveryBlob
Source§impl Debug for DeliveryBlob
impl Debug for DeliveryBlob
impl Eq for DeliveryBlob
Source§impl From<DeliveryBlob> for Type1Blob
impl From<DeliveryBlob> for Type1Blob
Source§fn from(blob: DeliveryBlob) -> Self
fn from(blob: DeliveryBlob) -> Self
Converts to this type from the input type.
Source§impl From<DeliveryBlob> for Type2Blob
impl From<DeliveryBlob> for Type2Blob
Source§fn from(blob: DeliveryBlob) -> Self
fn from(blob: DeliveryBlob) -> Self
Converts to this type from the input type.
Source§impl From<DeliveryBlob> for Type3Blob
impl From<DeliveryBlob> for Type3Blob
Source§fn from(blob: DeliveryBlob) -> Self
fn from(blob: DeliveryBlob) -> Self
Converts to this type from the input type.
Source§impl From<Type1Blob> for DeliveryBlob
impl From<Type1Blob> for DeliveryBlob
Source§impl From<Type2Blob> for DeliveryBlob
impl From<Type2Blob> for DeliveryBlob
Source§impl From<Type3Blob> for DeliveryBlob
impl From<Type3Blob> for DeliveryBlob
Source§impl PartialEq for DeliveryBlob
impl PartialEq for DeliveryBlob
Source§fn eq(&self, other: &DeliveryBlob) -> bool
fn eq(&self, other: &DeliveryBlob) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for DeliveryBlob
Auto Trait Implementations§
impl Freeze for DeliveryBlob
impl RefUnwindSafe for DeliveryBlob
impl Send for DeliveryBlob
impl Sync for DeliveryBlob
impl Unpin for DeliveryBlob
impl UnsafeUnpin for DeliveryBlob
impl UnwindSafe for DeliveryBlob
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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