pub struct Hello {
pub client_version: String,
pub protocol: u32,
pub dog_name: Option<String>,
}Expand description
Client’s opening frame
Fields§
§client_version: StringClient crate version (semver string)
protocol: u32crate::protocol::PROTOCOL_VERSION the client speaks
dog_name: Option<String>The name this client was registered under as a dog, when it is one.
None is what every other client truthfully is, and what a dog built
before this field existed sends. The CLI never sets it: a bare
Client has no way to, by construction, so shep stop cannot
impersonate a dog however its environment is set.
The daemon needs it on exactly one path, and it is the path where
nothing else can supply it. A handshake refused for protocol skew
never reaches a request, so Request::DogConfig’s name — the one
place a dog otherwise identifies itself — is unreachable precisely
when the daemon has to know WHICH dog it just refused in order to
restart it (the handover design’s G8). A dog already knows its own
name: the daemon put it in $SHEP_DOG_NAME when it spawned it.
Additive by construction: absent on the wire rather than null, and
ignored by a daemon too old to know it, so
crate::protocol::PROTOCOL_VERSION does not move for it. That
argument deserves more care here than anywhere else, because Hello
IS the version-negotiation frame: a daemon that rejected unknown
fields would refuse a newer client BEFORE reading protocol, and
that would be a hard break rather than an additive change. It does
not — this type carries no #[serde(deny_unknown_fields)], and
a_hello_without_a_dog_name_still_parses pins both directions.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Hello
impl<'de> Deserialize<'de> for Hello
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 Hello
impl StructuralPartialEq for Hello
Auto Trait Implementations§
impl Freeze for Hello
impl RefUnwindSafe for Hello
impl Send for Hello
impl Sync for Hello
impl Unpin for Hello
impl UnsafeUnpin for Hello
impl UnwindSafe for Hello
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.