pub struct QaulId {}
Expand description
Qaul ID structure
Implementations
sourceimpl QaulId
impl QaulId
sourcepub fn to_small(qaul_id: PeerId) -> Vec<u8>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn to_small(qaul_id: PeerId) -> Vec<u8>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Convert a qaul ID to it’s small 16 Byte version
The small version is used in the BLE module. It only uses byte 7 to 24 of the qaul id
sourcepub fn small_to_search_prefix(small_id: Vec<u8>) -> Vec<u8>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn small_to_search_prefix(small_id: Vec<u8>) -> Vec<u8>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Create a search key prefix for a small vector
sourcepub fn to_q8id(qaul_id: PeerId) -> Vec<u8>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn to_q8id(qaul_id: PeerId) -> Vec<u8>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Convert a qaul user ID to it’s 8 Byte ID (q8id)
The 8 Byte user ID (q8id) is used for the routing protocol. It only uses byte 7 to 14 of the qaul id. Bytes 1-6 are always the same, as they declare the hash kind.
sourcepub fn bytes_to_q8id(bytes: Vec<u8>) -> Vec<u8>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn bytes_to_q8id(bytes: Vec<u8>) -> Vec<u8>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Converts the binary form of the qaul user ID to the 8 Byte ID (q8id)
sourcepub fn q8id_to_search_prefix(q8id: Vec<u8>) -> Vec<u8>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
pub fn q8id_to_search_prefix(q8id: Vec<u8>) -> Vec<u8>ⓘNotable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
A: Allocator,
A: Allocator,
Create a search key prefix for a small vector
sourcepub fn q8id_to_search_range(q8id: Vec<u8>) -> Result<(PeerId, PeerId), String>
pub fn q8id_to_search_range(q8id: Vec<u8>) -> Result<(PeerId, PeerId), String>
Create the search range for the qaul ID from an q8id
This function returns a tuple with two qaul ID’s for the range selection. (lowest_id, highest_id)
The range can be used to search for the qaul ID in a BTreeMap.
A qaul ID has 38 bytes. {prefix}{q8id}{24 bytes}
Auto Trait Implementations
impl RefUnwindSafe for QaulId
impl Send for QaulId
impl Sync for QaulId
impl Unpin for QaulId
impl UnwindSafe for QaulId
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more