pub struct MemoryEvent {
pub kind: MemoryEventKind,
pub session_id: Option<String>,
pub source_ref: String,
pub text: String,
pub metadata: BTreeMap<String, String>,
pub observed_at_unix: Option<i64>,
pub token_estimate: usize,
pub imported_from: Option<String>,
pub imported_id: Option<String>,
}Fields§
§kind: MemoryEventKind§session_id: Option<String>§source_ref: String§text: String§metadata: BTreeMap<String, String>§observed_at_unix: Option<i64>§token_estimate: usize§imported_from: Option<String>§imported_id: Option<String>Implementations§
Source§impl MemoryEvent
impl MemoryEvent
pub fn new( kind: MemoryEventKind, source_ref: impl Into<String>, text: impl Into<String>, ) -> Self
pub fn with_session_id(self, session_id: impl Into<String>) -> Self
pub fn with_metadata( self, key: impl Into<String>, value: impl Into<String>, ) -> Self
pub fn with_observed_at_unix(self, observed_at_unix: i64) -> Self
pub fn with_import( self, source: impl Into<String>, id: impl Into<String>, ) -> Self
pub fn stable_id(&self) -> String
Trait Implementations§
Source§impl Clone for MemoryEvent
impl Clone for MemoryEvent
Source§fn clone(&self) -> MemoryEvent
fn clone(&self) -> MemoryEvent
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 MemoryEvent
impl Debug for MemoryEvent
Source§impl<'de> Deserialize<'de> for MemoryEvent
impl<'de> Deserialize<'de> for MemoryEvent
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 MemoryEvent
Source§impl PartialEq for MemoryEvent
impl PartialEq for MemoryEvent
Source§fn eq(&self, other: &MemoryEvent) -> bool
fn eq(&self, other: &MemoryEvent) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for MemoryEvent
impl Serialize for MemoryEvent
impl StructuralPartialEq for MemoryEvent
Auto Trait Implementations§
impl Freeze for MemoryEvent
impl RefUnwindSafe for MemoryEvent
impl Send for MemoryEvent
impl Sync for MemoryEvent
impl Unpin for MemoryEvent
impl UnsafeUnpin for MemoryEvent
impl UnwindSafe for MemoryEvent
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