pub struct NodeId(pub [u8; 32]);Expand description
NodeId is the 32-byte identifier that uniquely names a node in the NWEP
network.
A node ID is derived by applying a cryptographic hash to the node’s Ed25519 public key, so it is bound to the key material and cannot be forged without possession of the private key.
Node IDs are displayed as lowercase hex strings (64 characters). The
all-zero value is reserved and considered invalid; use NodeId::is_zero
to test for it.
§Example
use nwep::types::NodeId;
let id = NodeId([0u8; 32]);
assert!(id.is_zero());
println!("{id}"); // 0000...0000Tuple Fields§
§0: [u8; 32]Implementations§
Trait Implementations§
impl Copy for NodeId
impl Eq for NodeId
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§
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