Skip to main content

Reply

Struct Reply 

Source
struct Reply {
    kind: &'static str,
    id: String<16>,
    config: Option<Config>,
    system: Option<SystemInfo>,
    code: Option<String<24>>,
    message: Option<String<64>>,
}
Expand description

Server reply envelope — flat struct (same JSON as a tagged enum).

Fields§

§kind: &'static str

Message discriminator: ok, err, pong.

§id: String<16>

Correlation id from the request.

§config: Option<Config>

Full config (config.get).

§system: Option<SystemInfo>

Runtime info (system.get).

§code: Option<String<24>>

Machine-readable error code (err).

§message: Option<String<64>>

Human-readable error detail (err).

Implementations§

Source§

impl Reply

Source

fn ok(id: String<16>) -> Self

ok without payload.

Source

fn ok_config(id: String<16>, config: Config) -> Self

ok carrying the full config.

Source

fn ok_system(id: String<16>, system: SystemInfo) -> Self

ok carrying runtime info.

Source

fn pong(id: String<16>) -> Self

pong liveness reply.

Source

fn err(id: String<16>, code: &str, message: &str) -> Self

err with code and message.

Trait Implementations§

Source§

impl Serialize for Reply

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl Freeze for Reply

§

impl RefUnwindSafe for Reply

§

impl Send for Reply

§

impl Sync for Reply

§

impl Unpin for Reply

§

impl UnsafeUnpin for Reply

§

impl UnwindSafe for Reply

Blanket Implementations§

§

impl<T> Any for T
where T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> Borrow<T> for T
where T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for T
where T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for T
where U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.