pub enum IpcResponse {
Ok(Value),
Err(String),
Alert(MonitorAlert),
}Expand description
A response (or pushed event) sent from the daemon back to a client.
Application-level failures travel in-band as IpcResponse::Err so a
failing check never tears down the transport (mirrors the audit “run never
aborts” rule, PRODUCT.md B.2). Transport/auth failures use IpcError.
serde internally tagged, camelCase - frozen wire contract (A.5).
Variants§
Ok(Value)
Success carrying an arbitrary JSON payload (e.g. a serialized
AuditReport or MonitorStatus).
Err(String)
In-band application error with a human-readable message.
Alert(MonitorAlert)
A pushed alert frame delivered on a IpcRequest::Subscribe stream
(PRODUCT.md B.4).
Implementations§
Source§impl IpcResponse
impl IpcResponse
Sourcepub fn ok<T: Serialize>(value: &T) -> IpcResult<Self>
pub fn ok<T: Serialize>(value: &T) -> IpcResult<Self>
Build an IpcResponse::Ok from any serializable value.
PRODUCT.md A.4 - convenience used by the daemon’s request handler to wrap
typed results (reports, status) into the generic Ok(Value) frame.
Sourcepub fn err(msg: impl Display) -> Self
pub fn err(msg: impl Display) -> Self
Build an IpcResponse::Err from any displayable error.
Trait Implementations§
Source§impl Clone for IpcResponse
impl Clone for IpcResponse
Source§fn clone(&self) -> IpcResponse
fn clone(&self) -> IpcResponse
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for IpcResponse
impl Debug for IpcResponse
Source§impl<'de> Deserialize<'de> for IpcResponse
impl<'de> Deserialize<'de> for IpcResponse
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>,
Source§impl PartialEq for IpcResponse
impl PartialEq for IpcResponse
Source§fn eq(&self, other: &IpcResponse) -> bool
fn eq(&self, other: &IpcResponse) -> bool
self and other values to be equal, and is used by ==.