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§
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>>
Object Safety§
This trait is not object safe.