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, PsDataChunkError> { ... }
    fn decrypt(
        &self,
        key: &[u8],
        compressor: &Compressor,
    ) -> Result<OwnedDataChunk, PsDataChunkError> { ... }
    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>, PsDataChunkError>
       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§

Object Safety§

This trait is not object safe.

Implementors§