Trait holochain::prelude::KitsuneBinType
pub trait KitsuneBinType: 'static + Send + Sync + Debug + Clone + Hash + PartialEq<Self> + Eq + PartialOrd<Self> + Ord + Into<Vec<u8, Global>> {
// Required methods
fn new(bytes: Vec<u8, Global>) -> Self;
fn get_bytes(&self) -> &[u8] ⓘ;
fn get_loc(&self) -> DhtLocation;
}
Expand description
Kitsune hashes are expected to be 36 bytes. The first 32 bytes are the proper hash. The final 4 bytes are a hash-of-the-hash that can be treated like a u32 “location”.
Required Methods§
fn new(bytes: Vec<u8, Global>) -> Self
fn new(bytes: Vec<u8, Global>) -> Self
Create an instance, ensuring the proper number of bytes were provided.
fn get_loc(&self) -> DhtLocation
fn get_loc(&self) -> DhtLocation
Fetch the dht “loc” / location for this hash.