pub struct BrainEvent {
pub kind: BrainEventKind,
pub actor: UserId,
pub actor_is_agent: bool,
pub via_agent: Option<String>,
pub occurred_at: DateTime<Utc>,
pub payload: Value,
}Expand description
One thing that happened that the brain may learn from.
Fields§
§kind: BrainEventKind§actor: UserId§actor_is_agent: bool§via_agent: Option<String>§occurred_at: DateTime<Utc>§payload: ValueImplementations§
Source§impl BrainEvent
impl BrainEvent
pub const fn new( kind: BrainEventKind, actor: UserId, occurred_at: DateTime<Utc>, ) -> Self
pub const fn with_actor_is_agent(self, actor_is_agent: bool) -> Self
pub fn with_via_agent(self, via_agent: impl Into<String>) -> Self
pub fn with_payload(self, payload: Value) -> Self
Trait Implementations§
Source§impl Clone for BrainEvent
impl Clone for BrainEvent
Source§impl Debug for BrainEvent
impl Debug for BrainEvent
Source§impl<'de> Deserialize<'de> for BrainEvent
impl<'de> Deserialize<'de> for BrainEvent
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 JsonSchema for BrainEvent
impl JsonSchema for BrainEvent
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
Whether JSON Schemas generated for this type should be included directly in parent schemas,
rather than being re-used where possible using the
$ref keyword. Read moreSource§impl PartialEq for BrainEvent
impl PartialEq for BrainEvent
Source§impl Serialize for BrainEvent
impl Serialize for BrainEvent
impl StructuralPartialEq for BrainEvent
Auto Trait Implementations§
impl Freeze for BrainEvent
impl RefUnwindSafe for BrainEvent
impl Send for BrainEvent
impl Sync for BrainEvent
impl Unpin for BrainEvent
impl UnsafeUnpin for BrainEvent
impl UnwindSafe for BrainEvent
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more