pub trait HashableObject {
// Required methods
fn hash(&self) -> u64;
fn raw_payload(&self) -> &[u8] ⓘ;
fn is_compressed(&self) -> bool;
fn decompress(&self, buf: &mut Vec<u8>) -> Result<usize>;
fn next_hash_offset(&self) -> Option<NonZeroU64>;
fn object_type() -> ObjectType;
}Required Methods§
Sourcefn raw_payload(&self) -> &[u8] ⓘ
fn raw_payload(&self) -> &[u8] ⓘ
Get the payload data for matching
Sourcefn is_compressed(&self) -> bool
fn is_compressed(&self) -> bool
Check if the payload is compressed
Sourcefn decompress(&self, buf: &mut Vec<u8>) -> Result<usize>
fn decompress(&self, buf: &mut Vec<u8>) -> Result<usize>
Decompress the payload into the provided buffer. Returns the number of decompressed bytes.
Sourcefn next_hash_offset(&self) -> Option<NonZeroU64>
fn next_hash_offset(&self) -> Option<NonZeroU64>
Get the offset to the next object in the hash chain
Sourcefn object_type() -> ObjectType
fn object_type() -> ObjectType
Get the object type
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".