pub struct NodeId {
pub bytes: [u8; 16],
}Fields§
§bytes: [u8; 16]Implementations§
Source§impl NodeId
impl NodeId
pub const KIND_INDEXED: u8 = 0x00
pub const KIND_SHA256: u8 = 0x01
pub const KIND_SNOWFLAKE: u8 = 0x02
pub const fn new_indexed(id: u64) -> NodeId
pub fn sha256(bytes: &[u8]) -> NodeId
pub fn snowflake() -> NodeId
pub fn to_base64(&self) -> String
pub fn from_base64(s: &str) -> Result<NodeId, DecodeError>
Trait Implementations§
impl Copy for NodeId
Source§impl<'de> Deserialize<'de> for NodeId
impl<'de> Deserialize<'de> for NodeId
Source§fn deserialize<D>(
deserializer: D,
) -> Result<NodeId, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<NodeId, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for NodeId
Source§impl Ord for NodeId
impl Ord for NodeId
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for NodeId
impl PartialOrd for NodeId
Source§impl Serialize for NodeId
impl Serialize for NodeId
Source§fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
fn serialize<S>(
&self,
serializer: S,
) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl StructuralPartialEq for NodeId
Auto Trait Implementations§
impl Freeze for NodeId
impl RefUnwindSafe for NodeId
impl Send for NodeId
impl Sync for NodeId
impl Unpin for NodeId
impl UnsafeUnpin for NodeId
impl UnwindSafe for NodeId
Blanket Implementations§
impl<T> AppData for Twhere
T: OptionalSend + OptionalSync + 'static + OptionalSerde,
impl<T> AppDataResponse for Twhere
T: OptionalSend + OptionalSync + 'static + OptionalSerde,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more