pub struct EventEnvelope {Show 16 fields
pub schema_version: String,
pub id: String,
pub timestamp: String,
pub event_type: HookEventType,
pub session_id: String,
pub tool_name: Option<String>,
pub tool_input: Option<Value>,
pub user_prompt: Option<String>,
pub reason: Option<String>,
pub verdict: Verdict,
pub latency_ms: u64,
pub agent_platform: AgentType,
pub agent_version: Option<String>,
pub os: String,
pub arch: String,
pub client_version: String,
}Expand description
Complete event envelope wrapping a raw agent hook event with cross-cutting metadata.
All fields correspond to EVNT-02 requirements. Optional fields are omitted from JSON
when None to keep payloads compact.
§Examples
use openlatch_client::envelope::{EventEnvelope, AgentType, HookEventType, Verdict,
new_event_id, current_timestamp, os_string, arch_string};
let envelope = EventEnvelope {
schema_version: "1.0".to_string(),
id: new_event_id(),
timestamp: current_timestamp(),
event_type: HookEventType::PreToolUse,
session_id: "session-abc".to_string(),
tool_name: Some("bash".to_string()),
tool_input: None,
user_prompt: None,
reason: None,
verdict: Verdict::Allow,
latency_ms: 3,
agent_platform: AgentType::ClaudeCode,
agent_version: None,
os: os_string().to_string(),
arch: arch_string().to_string(),
client_version: env!("CARGO_PKG_VERSION").to_string(),
};Fields§
§schema_version: String§id: String§timestamp: String§event_type: HookEventType§session_id: String§tool_name: Option<String>§tool_input: Option<Value>§user_prompt: Option<String>§reason: Option<String>§verdict: Verdict§latency_ms: u64§agent_platform: AgentType§agent_version: Option<String>§os: String§arch: String§client_version: StringTrait Implementations§
Source§impl Clone for EventEnvelope
impl Clone for EventEnvelope
Source§fn clone(&self) -> EventEnvelope
fn clone(&self) -> EventEnvelope
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EventEnvelope
impl Debug for EventEnvelope
Source§impl<'de> Deserialize<'de> for EventEnvelope
impl<'de> Deserialize<'de> for EventEnvelope
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for EventEnvelope
impl PartialEq for EventEnvelope
Source§impl Serialize for EventEnvelope
impl Serialize for EventEnvelope
impl StructuralPartialEq for EventEnvelope
Auto Trait Implementations§
impl Freeze for EventEnvelope
impl RefUnwindSafe for EventEnvelope
impl Send for EventEnvelope
impl Sync for EventEnvelope
impl Unpin for EventEnvelope
impl UnsafeUnpin for EventEnvelope
impl UnwindSafe for EventEnvelope
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