Skip to main content

HashableObject

Trait HashableObject 

Source
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, JournalError>;
    fn next_hash_offset(&self) -> Option<NonZero<u64>>;
    fn object_type() -> ObjectType;
}

Required Methods§

Source

fn hash(&self) -> u64

Get the hash value of this object

Source

fn raw_payload(&self) -> &[u8]

Get the payload data for matching

Source

fn is_compressed(&self) -> bool

Check if the payload is compressed

Source

fn decompress(&self, buf: &mut Vec<u8>) -> Result<usize, JournalError>

Decompress the payload into the provided buffer. Returns the number of decompressed bytes.

Source

fn next_hash_offset(&self) -> Option<NonZero<u64>>

Get the offset to the next object in the hash chain

Source

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".

Implementors§