pub struct NodeIdentityProfile {
pub public_key: PublicKey,
pub role: NodeRole,
pub capabilities: NodeCapabilities,
pub name: Option<String>,
pub location: Option<NodeLocation>,
pub altitude_m: Option<i32>,
pub supported_regions: Option<Vec<u8>>,
pub clock: fn() -> Option<u32>,
}Expand description
This node’s own identity, used to answer Identity Requests.
Holds descriptive fields only — no signing key. Config-like fields
(role, capabilities, name, supported_regions) are typically set once
at bring-up; live fields (location, altitude_m) can be refreshed at any
time via LocalNode::update_identity_profile,
e.g. from a GPS task.
Fields§
§public_key: PublicKeyThis node’s public key. Its hint is matched against a
request’s FILTER_NODE_HINT; the key itself reaches the requester via
the reply’s MAC source address, not the identity payload.
role: NodeRole§capabilities: NodeCapabilities§name: Option<String>§location: Option<NodeLocation>§altitude_m: Option<i32>§supported_regions: Option<Vec<u8>>§clock: fn() -> Option<u32>Where identity option 3 comes from: the current Unix time, or
None on a node that does not know what time it is.
A source rather than a value, because option 3 dates the payload and every payload is built fresh — a stored number would be the time some earlier payload was built. It lives here so that the one canonical builder stamps every framing identically; a node with no clock keeps the default and simply omits the option.
Implementations§
Source§impl NodeIdentityProfile
impl NodeIdentityProfile
Sourcepub fn new(
public_key: PublicKey,
role: NodeRole,
capabilities: NodeCapabilities,
) -> Self
pub fn new( public_key: PublicKey, role: NodeRole, capabilities: NodeCapabilities, ) -> Self
Create a minimal profile (role + capabilities), no descriptive options.
Sourcepub fn with_location(self, location: NodeLocation) -> Self
pub fn with_location(self, location: NodeLocation) -> Self
Set the geographic location (builder style).
Sourcepub fn to_payload(&self, nonce: Option<u32>) -> NodeIdentityPayload
pub fn to_payload(&self, nonce: Option<u32>) -> NodeIdentityPayload
Build the (unsigned) identity payload this node advertises,
stamping nonce into option 5.
The one canonical builder, deliberately shared by both framings of a node identity: the Identity Request reply, which carries a request nonce and is authenticated by the enclosing unicast, and the standalone signed blob, which carries no nonce and is authenticated by a detached signature. They are different objects on the wire and the same statement about the node; the difference must not be able to drift into the contents.
Trait Implementations§
Source§impl Clone for NodeIdentityProfile
impl Clone for NodeIdentityProfile
Source§fn clone(&self) -> NodeIdentityProfile
fn clone(&self) -> NodeIdentityProfile
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for NodeIdentityProfile
impl RefUnwindSafe for NodeIdentityProfile
impl Send for NodeIdentityProfile
impl Sync for NodeIdentityProfile
impl Unpin for NodeIdentityProfile
impl UnwindSafe for NodeIdentityProfile
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)