pub struct AppendEvent {
pub kind: SessionEventKind,
pub payload: Value,
pub parent_event_id: Option<EventId>,
pub actor: Option<String>,
pub tags: Vec<String>,
pub headers: BTreeMap<String, String>,
}Expand description
Caller-facing event used on append.
Fields§
§kind: SessionEventKind§payload: ValueFree-form payload. Validated for null-bytes only — schema enforcement lives in the structural validator (#2366).
parent_event_id: Option<EventId>Optional caller-asserted parent event id. Stores reject values that point past the current tail.
actor: Option<String>Optional caller actor (e.g. "user", "assistant", persona id).
Tags surface filterable list queries.
headers: BTreeMap<String, String>Caller-supplied metadata copied verbatim onto the stored event.
Implementations§
Source§impl AppendEvent
impl AppendEvent
pub fn new(kind: SessionEventKind, payload: Value) -> Self
pub fn with_actor(self, actor: impl Into<String>) -> Self
pub fn with_parent(self, parent_event_id: EventId) -> Self
Sourcepub fn with_identity(
self,
identity: &EventIdentity,
) -> Result<Self, EventIdentityError>
pub fn with_identity( self, identity: &EventIdentity, ) -> Result<Self, EventIdentityError>
Stamp producer identity into canonical signed headers.
Sourcepub fn identity(&self) -> Result<EventIdentity, EventIdentityError>
pub fn identity(&self) -> Result<EventIdentity, EventIdentityError>
Read the producer identity already present in canonical headers.
Trait Implementations§
Source§impl Clone for AppendEvent
impl Clone for AppendEvent
Source§fn clone(&self) -> AppendEvent
fn clone(&self) -> AppendEvent
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 AppendEvent
impl Debug for AppendEvent
Source§impl<'de> Deserialize<'de> for AppendEvent
impl<'de> Deserialize<'de> for AppendEvent
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
impl Eq for AppendEvent
Source§impl PartialEq for AppendEvent
impl PartialEq for AppendEvent
Source§impl Serialize for AppendEvent
impl Serialize for AppendEvent
impl StructuralPartialEq for AppendEvent
Auto Trait Implementations§
impl Freeze for AppendEvent
impl RefUnwindSafe for AppendEvent
impl Send for AppendEvent
impl Sync for AppendEvent
impl Unpin for AppendEvent
impl UnsafeUnpin for AppendEvent
impl UnwindSafe for AppendEvent
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