Struct ps_datachunk::aligned::AlignedDataChunk
source · pub struct AlignedDataChunk { /* private fields */ }
Implementations§
source§impl AlignedDataChunk
impl AlignedDataChunk
pub fn new_with_parameters( data: AlignedVec, hash: &[u8], data_length: usize, hash_offset: usize, size_offset: usize, ) -> Self
pub fn new_with_hash(chunk_data: &[u8], hash: &[u8]) -> Self
pub fn new_from_data_vec(data: AlignedVec) -> Self
pub fn new(chunk_data: &[u8]) -> Self
pub fn len(&self) -> usize
pub fn hash_ref(&self) -> &[u8] ⓘ
pub fn hash(&self) -> Hash
pub fn data_ref(&self) -> &[u8] ⓘ
pub fn serialize_into(self) -> AlignedVec
pub fn serialize(&self) -> AlignedVec
pub fn deserialize_from(inner: AlignedVec) -> Self
pub fn deserialize_unchecked(bytes: &[u8]) -> Self
pub fn deserialize(bytes: &[u8]) -> Result<Self>
pub fn as_serialized_bytes(&self) -> &[u8] ⓘ
source§impl AlignedDataChunk
impl AlignedDataChunk
Trait Implementations§
source§impl Archive for AlignedDataChunkwhere
AlignedVec: Archive,
impl Archive for AlignedDataChunkwhere
AlignedVec: Archive,
§type Archived = ArchivedAlignedDataChunk
type Archived = ArchivedAlignedDataChunk
The archived representation of this type. Read more
§type Resolver = AlignedDataChunkResolver
type Resolver = AlignedDataChunkResolver
The resolver for this type. It must contain all the additional information from serializing
needed to make the archived type from the normal type.
source§impl Clone for AlignedDataChunk
impl Clone for AlignedDataChunk
source§fn clone(&self) -> AlignedDataChunk
fn clone(&self) -> AlignedDataChunk
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl DataChunkTrait for AlignedDataChunk
impl DataChunkTrait for AlignedDataChunk
fn data_ref(&self) -> &[u8] ⓘ
fn hash_ref(&self) -> &[u8] ⓘ
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>>
source§impl Debug for AlignedDataChunk
impl Debug for AlignedDataChunk
source§impl<'lt> From<&DataChunk<'lt>> for AlignedDataChunk
impl<'lt> From<&DataChunk<'lt>> for AlignedDataChunk
source§impl From<&OwnedDataChunk> for AlignedDataChunk
impl From<&OwnedDataChunk> for AlignedDataChunk
source§fn from(value: &OwnedDataChunk) -> Self
fn from(value: &OwnedDataChunk) -> Self
Converts to this type from the input type.
source§impl<'lt> From<AlignedDataChunk> for DataChunk<'lt>
impl<'lt> From<AlignedDataChunk> for DataChunk<'lt>
source§fn from(chunk: AlignedDataChunk) -> Self
fn from(chunk: AlignedDataChunk) -> Self
Converts to this type from the input type.
source§impl<'lt> From<DataChunk<'lt>> for AlignedDataChunk
impl<'lt> From<DataChunk<'lt>> for AlignedDataChunk
source§impl Into<OwnedDataChunk> for &AlignedDataChunk
impl Into<OwnedDataChunk> for &AlignedDataChunk
source§fn into(self) -> OwnedDataChunk
fn into(self) -> OwnedDataChunk
Converts this type into the (usually inferred) input type.
Auto Trait Implementations§
impl Freeze for AlignedDataChunk
impl RefUnwindSafe for AlignedDataChunk
impl Send for AlignedDataChunk
impl Sync for AlignedDataChunk
impl Unpin for AlignedDataChunk
impl UnwindSafe for AlignedDataChunk
Blanket Implementations§
source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
source§impl<T> ArchiveUnsized for Twhere
T: Archive,
impl<T> ArchiveUnsized for Twhere
T: Archive,
§type Archived = <T as Archive>::Archived
type Archived = <T as Archive>::Archived
The archived counterpart of this type. Unlike
Archive
, it may be unsized. Read more§type MetadataResolver = ()
type MetadataResolver = ()
The resolver for the metadata of this type. Read more
source§unsafe fn resolve_metadata(
&self,
_: usize,
_: <T as ArchiveUnsized>::MetadataResolver,
_: *mut <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata,
)
unsafe fn resolve_metadata( &self, _: usize, _: <T as ArchiveUnsized>::MetadataResolver, _: *mut <<T as ArchiveUnsized>::Archived as ArchivePointee>::ArchivedMetadata, )
Creates the archived version of the metadata for this value at the given position and writes
it to the given output. Read more
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<F, W, T, D> Deserialize<With<T, W>, D> for F
impl<F, W, T, D> Deserialize<With<T, W>, D> for F
source§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Gets the layout of the type.