pub struct NodeIdentity {
pub v: u8,
pub id: String,
pub nm: Option<String>,
pub pr: Option<String>,
pub ver: Option<String>,
pub pv: Option<u16>,
pub pl: Option<String>,
}Expand description
A drone’s identity, sent less often than status because it does not change.
This is the frame that lets a ground station answer “who is my peer” with the node’s real identity. The presence beacon carries a device id, but the beacon is a fixed 68-byte HMAC-signed frame with its identity field already full, so there is no room in it for a name or an agent version.
Fields§
§v: u8Schema version (NODE_STATUS_VERSION).
id: StringThe node’s persistent device id, the key everything else correlates on.
nm: Option<String>Human-facing node name, when the node has one configured.
pr: Option<String>The node’s profile (drone, ground-station, …), when known.
ver: Option<String>Agent version string.
pv: Option<u16>The highest plugin contract version any installed plugin declares, a
coarse node-wide signal a peer can glance at. The authoritative per-plugin
detail is Self::pl. Absent when no plugin is installed.
pl: Option<String>The installed plugin inventory as a comma-joined list of
pluginId@contractVersion, clipped to MAX_PLUGIN_LIST. Lets a peer
compare per-plugin contract versions and detect an AD05-class wire
disagreement instead of silently misreading a field.
Implementations§
Source§impl NodeIdentity
impl NodeIdentity
Sourcepub fn build(
device_id: &str,
name: Option<&str>,
profile: Option<&str>,
version: Option<&str>,
plugins: &[(String, u16)],
) -> Self
pub fn build( device_id: &str, name: Option<&str>, profile: Option<&str>, version: Option<&str>, plugins: &[(String, u16)], ) -> Self
Build a bounded identity frame. Every field is clipped here, so no caller can put an unbounded string on the lane.
Trait Implementations§
Source§impl Clone for NodeIdentity
impl Clone for NodeIdentity
Source§impl Debug for NodeIdentity
impl Debug for NodeIdentity
Source§impl<'de> Deserialize<'de> for NodeIdentity
impl<'de> Deserialize<'de> for NodeIdentity
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
impl Eq for NodeIdentity
Source§impl PartialEq for NodeIdentity
impl PartialEq for NodeIdentity
Source§impl Serialize for NodeIdentity
impl Serialize for NodeIdentity
impl StructuralPartialEq for NodeIdentity
Auto Trait Implementations§
impl Freeze for NodeIdentity
impl RefUnwindSafe for NodeIdentity
impl Send for NodeIdentity
impl Sync for NodeIdentity
impl Unpin for NodeIdentity
impl UnsafeUnpin for NodeIdentity
impl UnwindSafe for NodeIdentity
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.