Skip to main content

YoAgentRuntime

Struct YoAgentRuntime 

Source
pub struct YoAgentRuntime<S: EventStore> { /* private fields */ }

Implementations§

Source§

impl<S: EventStore> YoAgentRuntime<S>

Source

pub fn new(state: YoAgentState<S>) -> Self

Source

pub fn state(&self) -> YoAgentState<S>

Source

pub fn register_pack(&mut self, pack: Pack)

Source

pub fn register_behavior<B>(&mut self, behavior: B)
where B: Behavior + 'static,

Source

pub fn register_policy(&mut self, policy: Policy)

Source

pub async fn emit_event(&self, event: Event) -> Result<EventId, StateError>

Source

pub async fn create_typed_node( &self, actor: ActorRef, id: NodeId, kind: impl Into<String>, props: Value, ) -> Result<EventId, StateError>

Source

pub async fn create_typed_relation( &self, actor: ActorRef, from: NodeId, rel: impl Into<String>, to: NodeId, props: Value, ) -> Result<EventId, StateError>

Source

pub async fn request_approval( &self, policy_id: PolicyId, action: PolicyAction, target: Option<NodeId>, requested_by: ActorRef, reason: Option<String>, ) -> Result<EventId, StateError>

Source

pub async fn approve_request( &self, actor: ActorRef, request_id: NodeId, reason: Option<String>, ) -> Result<EventId, StateError>

Source

pub async fn reject_request( &self, actor: ActorRef, request_id: NodeId, reason: Option<String>, ) -> Result<EventId, StateError>

Source

pub async fn graph(&self) -> GraphSnapshot

Auto Trait Implementations§

§

impl<S> !RefUnwindSafe for YoAgentRuntime<S>

§

impl<S> !UnwindSafe for YoAgentRuntime<S>

§

impl<S> Freeze for YoAgentRuntime<S>

§

impl<S> Send for YoAgentRuntime<S>

§

impl<S> Sync for YoAgentRuntime<S>

§

impl<S> Unpin for YoAgentRuntime<S>

§

impl<S> UnsafeUnpin for YoAgentRuntime<S>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.