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.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PluginResponse
impl !RefUnwindSafe for PluginResponse
impl Send for PluginResponse
impl Sync for PluginResponse
impl Unpin for PluginResponse
impl !UnwindSafe for PluginResponse
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