Struct kvarn::ctl::PluginResponse

source ·
pub struct PluginResponse {
    pub kind: PluginResponseKind,
    pub close: bool,
    pub post_send: Option<Box<dyn FnOnce() + Send + Sync>>,
}
Available on crate feature handover only.
Expand description

A response in reply to the request kvarnctl sent.

Fields§

§kind: PluginResponseKind

The kind of response.

§close: bool

If the socket should be closed. Should ONLY be used when we are immediately shutting down.

§post_send: Option<Box<dyn FnOnce() + Send + Sync>>

A function to run after sending the response.

Implementations§

Creates a new response which doesn’t close the connection.

Creates a new OK response with content.

Creates a new OK response without content.

Creates a new response signalling an error, with content.

Creates a new response signalling an error, without content.

Close the ctl socket after this is returned. Use this only is you shut Kvarn down immediately in your plugin.

Add a callback to fun after the response is sent.

Trait Implementations§

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

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

Should always be Self
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more