pub trait LtHash {
// Required methods
fn insert(&mut self, element: impl AsRef<[u8]>);
fn remove(&mut self, element: impl AsRef<[u8]>);
fn to_hex_string(&self) -> String;
fn union(&self, rhs: &Self) -> Self;
fn difference(&self, rhs: &Self) -> Self;
fn reset(&mut self);
fn into_bytes(self) -> Vec<u8> ⓘ;
}Expand description
Generic trait for LtHash, these functions will be implemented by all the instances of LtHash.
Required Methods§
Sourcefn insert(&mut self, element: impl AsRef<[u8]>)
fn insert(&mut self, element: impl AsRef<[u8]>)
Inserts an element to LtHash, actually it generates the hash (of size 2048 bytes) of the object and sums it to the checksum.
Sourcefn remove(&mut self, element: impl AsRef<[u8]>)
fn remove(&mut self, element: impl AsRef<[u8]>)
Removes an element to LtHash, actually it generates the hash (of size 2048 bytes) of the object and removes it from the checksum.
Sourcefn to_hex_string(&self) -> String
fn to_hex_string(&self) -> String
Provides the hex value as String of the checksum.
Sourcefn union(&self, rhs: &Self) -> Self
fn union(&self, rhs: &Self) -> Self
Takes the union of self and rhs.
Equivalent to cloning self, then adding all the objects in rhs.
Equivalent to self | other.
Sourcefn difference(&self, rhs: &Self) -> Self
fn difference(&self, rhs: &Self) -> Self
Takes the difference of self and rhs.
Equivalent to cloning self, then removing all the objects in rhs.
Equivalent to self - other.
Sourcefn into_bytes(self) -> Vec<u8> ⓘ
fn into_bytes(self) -> Vec<u8> ⓘ
Converts self into the inner list of bytes.
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.