pub enum SseEvent {
Started {
call_id: String,
},
Output(Value),
Error(Value),
Custom {
event: String,
data: Value,
},
End,
}Expand description
A tagged event in the spudkit protocol. Used on both the server side (creating events from container output) and the client side (parsing events from SSE streams).
Variants§
Implementations§
Source§impl SseEvent
impl SseEvent
Sourcepub fn from_stdout(line: &str) -> Self
pub fn from_stdout(line: &str) -> Self
Create an event from a raw stdout line. If the line is already tagged JSON (has an “event” field), it is parsed as-is. Otherwise, it is wrapped as an Output event.
Sourcepub fn from_stderr(line: &str) -> Self
pub fn from_stderr(line: &str) -> Self
Create an event from a raw stderr line. If the line is already tagged JSON (has an “event” field), it is parsed as-is. Otherwise, it is wrapped as an Error event.
Sourcepub fn display_data(&self) -> Option<String>
pub fn display_data(&self) -> Option<String>
Format the event’s data for human-readable display. Strings are returned unwrapped, everything else as JSON.
Auto Trait Implementations§
impl Freeze for SseEvent
impl RefUnwindSafe for SseEvent
impl Send for SseEvent
impl Sync for SseEvent
impl Unpin for SseEvent
impl UnsafeUnpin for SseEvent
impl UnwindSafe for SseEvent
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