pub trait DataChunkTrait {
// Required methods
fn data_ref(&self) -> &[u8] ⓘ;
fn hash_ref(&self) -> &[u8] ⓘ;
// Provided methods
fn hash(&self) -> Arc<Hash> { ... }
fn encrypt(&self) -> Result<EncryptedDataChunk> { ... }
fn decrypt(&self, key: &[u8]) -> Result<SerializedDataChunk> { ... }
fn to_datachunk(&self) -> DataChunk<'_> { ... }
fn borrow(&self) -> BorrowedDataChunk<'_> { ... }
fn to_owned(&self) -> OwnedDataChunk { ... }
fn serialize(&self) -> Result<SerializedDataChunk> { ... }
fn try_as<T: Archive>(&self) -> Result<TypedDataChunk<'_, T>>
where T::Archived: for<'a> CheckBytes<HighValidator<'a, Error>> { ... }
}
Expand description
represents any representation of a chunk of data
Required Methods§
Provided Methods§
fn hash(&self) -> Arc<Hash>
fn encrypt(&self) -> Result<EncryptedDataChunk>
fn decrypt(&self, key: &[u8]) -> Result<SerializedDataChunk>
fn to_datachunk(&self) -> DataChunk<'_>
fn borrow(&self) -> BorrowedDataChunk<'_>
fn to_owned(&self) -> OwnedDataChunk
fn serialize(&self) -> Result<SerializedDataChunk>
fn try_as<T: Archive>(&self) -> Result<TypedDataChunk<'_, T>>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.