#[non_exhaustive]pub struct RegisterPayload {
pub capabilities: BTreeSet<Capability>,
pub runtime_instance_id: Option<Uuid>,
}Expand description
Payload sent by every service on connect to declare its capabilities.
Sent from on_connected before any other messages. The controller uses
this as the authoritative source for capability detection on the current
session and persists the capability set to the DB.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.capabilities: BTreeSet<Capability>Capabilities declared by this service instance.
runtime_instance_id: Option<Uuid>Runtime instance identity for restart-vs-reconnect detection.
Optional for mixed-version compatibility: legacy services omit this field and are treated as service-scoped (not instance-scoped).
Implementations§
Source§impl RegisterPayload
impl RegisterPayload
Sourcepub fn new(capabilities: impl IntoIterator<Item = Capability>) -> Self
pub fn new(capabilities: impl IntoIterator<Item = Capability>) -> Self
Create a new RegisterPayload with the given capability set.
§Example
use std::collections::BTreeSet;
use uptrakit_wire::{Capability, RegisterPayload};
let payload = RegisterPayload::new([Capability::SoftwareDiscovery, Capability::UpdateHooks]);
assert!(payload.capabilities.contains(&Capability::SoftwareDiscovery));Sourcepub fn with_runtime_instance_id(self, runtime_instance_id: Uuid) -> Self
pub fn with_runtime_instance_id(self, runtime_instance_id: Uuid) -> Self
Set a runtime instance id on this register payload.
Trait Implementations§
Source§impl Clone for RegisterPayload
impl Clone for RegisterPayload
Source§fn clone(&self) -> RegisterPayload
fn clone(&self) -> RegisterPayload
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RegisterPayload
impl Debug for RegisterPayload
Source§impl Default for RegisterPayload
impl Default for RegisterPayload
Source§fn default() -> RegisterPayload
fn default() -> RegisterPayload
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for RegisterPayload
impl<'de> Deserialize<'de> for RegisterPayload
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>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for RegisterPayload
Source§impl PartialEq for RegisterPayload
impl PartialEq for RegisterPayload
Source§impl Serialize for RegisterPayload
impl Serialize for RegisterPayload
impl StructuralPartialEq for RegisterPayload
Source§impl WireValidate for RegisterPayload
impl WireValidate for RegisterPayload
Source§fn wire_validate(&self) -> Result<(), WireValidationError>
fn wire_validate(&self) -> Result<(), WireValidationError>
Validate that all fields are within wire protocol size limits.
Auto Trait Implementations§
impl Freeze for RegisterPayload
impl RefUnwindSafe for RegisterPayload
impl Send for RegisterPayload
impl Sync for RegisterPayload
impl Unpin for RegisterPayload
impl UnsafeUnpin for RegisterPayload
impl UnwindSafe for RegisterPayload
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
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
Compare self to
key and return true if they are equal.