pub struct Advertisement {
pub v: u32,
pub pk: String,
pub inst: InstanceId,
pub name: String,
pub seq: u64,
pub ts: u64,
pub ep: Vec<String>,
pub caps: Vec<String>,
pub repos: Vec<String>,
pub ver: String,
pub rt: String,
}Expand description
The advertised body: everything the signature covers. Field names are one or two characters because this travels in a single UDP datagram; the types above the wire spell things out.
Fields§
§v: u32Protocol version.
pk: StringThe Ed25519 public key, hex. The node id is derived from it, never carried: a field that could disagree with the key is a field somebody will forge.
inst: InstanceIdThis run of the node.
name: StringA human name for the node. Presentation only.
seq: u64Monotonic per instance: a replayed datagram carries a counter the reader has already seen and is dropped.
ts: u64Seconds since the Unix epoch at signing time.
ep: Vec<String>Where this node answers HTTP, as host:port authorities, at most
MAX_ENDPOINTS. Advisory: an endpoint is where to try, identity is the key.
caps: Vec<String>The transports the node serves: http, mcp, ws. Sanitized capability
awareness, never an authorization.
repos: Vec<String>The repositories this node serves, as mesh repository ids (32 hex, see
super::repository): derived from the repository’s root commits or its declared
identity, never from a path, so that one repository cloned on two machines is
recognised as one. A digest discloses nothing; a reader that serves the same
repository recognises it, anyone else learns only “some repo”.
ver: StringThe executable version, informational.
rt: StringThe runtime slot (16 hex): which server of this node — one per checkout. Empty in version 1. Omitted from the signed bytes when empty, so a version-1 signature verifies unchanged.
Implementations§
Source§impl Advertisement
impl Advertisement
Sourcepub fn signing_bytes(&self) -> Vec<u8> ⓘ
pub fn signing_bytes(&self) -> Vec<u8> ⓘ
The bytes the signature covers: the canonical JSON of the advertisement alone. Field order is the struct’s, which serde keeps stable, so signer and verifier serialize identically without a second canonicalization scheme.
Trait Implementations§
Source§impl Clone for Advertisement
impl Clone for Advertisement
Source§fn clone(&self) -> Advertisement
fn clone(&self) -> Advertisement
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for Advertisement
impl Debug for Advertisement
Source§impl<'de> Deserialize<'de> for Advertisement
impl<'de> Deserialize<'de> for Advertisement
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 Advertisement
Source§impl JsonSchema for Advertisement
impl JsonSchema for Advertisement
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read moreSource§impl PartialEq for Advertisement
impl PartialEq for Advertisement
Source§fn eq(&self, other: &Advertisement) -> bool
fn eq(&self, other: &Advertisement) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for Advertisement
impl Serialize for Advertisement
impl StructuralPartialEq for Advertisement
Auto Trait Implementations§
impl Freeze for Advertisement
impl RefUnwindSafe for Advertisement
impl Send for Advertisement
impl Sync for Advertisement
impl Unpin for Advertisement
impl UnsafeUnpin for Advertisement
impl UnwindSafe for Advertisement
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.