Trait ps_datachunk::DataChunkTrait

source ·
pub trait DataChunkTrait {
    // Required methods
    fn data_ref(&self) -> &[u8] ;
    fn hash_ref(&self) -> &[u8] ;

    // Provided methods
    fn hash(&self) -> HashCow<'_> { ... }
    fn encrypt(&self, compressor: &Compressor) -> Result<EncryptedDataChunk> { ... }
    fn decrypt(
        &self,
        key: &[u8],
        compressor: &Compressor,
    ) -> Result<OwnedDataChunk> { ... }
    fn to_datachunk(&self) -> DataChunk<'_> { ... }
    fn align(&self) -> AlignedDataChunk { ... }
    fn borrow(&self) -> BorrowedDataChunk<'_> { ... }
    fn to_owned(&self) -> OwnedDataChunk { ... }
    fn try_as<T: Archive>(&self) -> Result<TypedDataChunk<'_, T>>
       where T::Archived: for<'a> CheckBytes<DefaultValidator<'a>> { ... }
}
Expand description

represents any representation of a chunk of data

Required Methods§

source

fn data_ref(&self) -> &[u8]

source

fn hash_ref(&self) -> &[u8]

Provided Methods§

source

fn hash(&self) -> HashCow<'_>

source

fn encrypt(&self, compressor: &Compressor) -> Result<EncryptedDataChunk>

source

fn decrypt(&self, key: &[u8], compressor: &Compressor) -> Result<OwnedDataChunk>

source

fn to_datachunk(&self) -> DataChunk<'_>

source

fn align(&self) -> AlignedDataChunk

source

fn borrow(&self) -> BorrowedDataChunk<'_>

source

fn to_owned(&self) -> OwnedDataChunk

source

fn try_as<T: Archive>(&self) -> Result<TypedDataChunk<'_, T>>
where T::Archived: for<'a> CheckBytes<DefaultValidator<'a>>,

Object Safety§

This trait is not object safe.

Implementors§