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§
source§impl PluginResponse
impl PluginResponse
sourcepub fn new(kind: PluginResponseKind) -> Self
pub fn new(kind: PluginResponseKind) -> Self
Creates a new response which doesn’t close the connection.
sourcepub fn error(data: impl Into<Vec<u8>>) -> Self
pub fn error(data: impl Into<Vec<u8>>) -> Self
Creates a new response signalling an error, with content.
sourcepub fn error_empty() -> Self
pub fn error_empty() -> Self
Creates a new response signalling an error, without content.