pub struct InvocationBatch {
pub invocation: Option<InvocationRecord>,
pub outputs: Vec<(String, Vec<u8>)>,
pub session: Option<SessionRecord>,
pub events: Option<Vec<EventRecord>>,
}Expand description
A batch of related records to write atomically.
Use this when you want to write an invocation along with its outputs, session, and/or events in a single transaction.
Fields§
§invocation: Option<InvocationRecord>The invocation record (required).
outputs: Vec<(String, Vec<u8>)>Output streams with their content: (stream_name, content). Common streams: “stdout”, “stderr”, “combined”.
session: Option<SessionRecord>Session record (optional, created if not already registered).
events: Option<Vec<EventRecord>>Pre-extracted events (optional).
Implementations§
Source§impl InvocationBatch
impl InvocationBatch
Sourcepub fn new(invocation: InvocationRecord) -> Self
pub fn new(invocation: InvocationRecord) -> Self
Create a new batch with an invocation.
Sourcepub fn with_output(self, stream: impl Into<String>, content: Vec<u8>) -> Self
pub fn with_output(self, stream: impl Into<String>, content: Vec<u8>) -> Self
Add an output stream.
Sourcepub fn with_session(self, session: SessionRecord) -> Self
pub fn with_session(self, session: SessionRecord) -> Self
Add a session record.
Sourcepub fn with_events(self, events: Vec<EventRecord>) -> Self
pub fn with_events(self, events: Vec<EventRecord>) -> Self
Add pre-extracted events.
Trait Implementations§
Source§impl Debug for InvocationBatch
impl Debug for InvocationBatch
Source§impl Default for InvocationBatch
impl Default for InvocationBatch
Source§fn default() -> InvocationBatch
fn default() -> InvocationBatch
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for InvocationBatch
impl RefUnwindSafe for InvocationBatch
impl Send for InvocationBatch
impl Sync for InvocationBatch
impl Unpin for InvocationBatch
impl UnsafeUnpin for InvocationBatch
impl UnwindSafe for InvocationBatch
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