Trait kitsune_p2p_bin_data::KitsuneBinType
source · pub trait KitsuneBinType: 'static + Send + Sync + Debug + Clone + Hash + PartialEq + Eq + PartialOrd + Ord + Into<Vec<u8>> {
// Required methods
fn new(bytes: Vec<u8>) -> 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§
sourcefn new(bytes: Vec<u8>) -> Self
fn new(bytes: Vec<u8>) -> Self
Create an instance, ensuring the proper number of bytes were provided.
sourcefn get_loc(&self) -> DhtLocation
fn get_loc(&self) -> DhtLocation
Fetch the dht “loc” / location for this hash.