pub struct Environment { /* private fields */ }Implementations§
Source§impl Environment
impl Environment
pub async fn new(config: Option<EnvironmentConfig>) -> Self
pub fn config(&self) -> &EnvironmentConfig
pub async fn get_session( &self, session_id: Option<SessionId>, ) -> Option<Arc<Mutex<Session>>>
pub async fn get_session_or_default( &self, session_id: Option<SessionId>, ) -> Result<Arc<Mutex<Session>>, Error>
pub async fn get_session_mut( &self, session_id: Option<SessionId>, ) -> Option<Arc<Mutex<Session>>>
pub async fn register_agent<E>( &self, agent: BaseAgent<E>, session_id: Option<SessionId>, ) -> Result<AgentID, Error>
pub async fn register_agent_with_id<E>( &self, agent_id: AgentID, agent: BaseAgent<E>, session_id: Option<SessionId>, ) -> Result<(), Error>
pub async fn add_task<T: Into<String>>( &self, agent_id: Uuid, task: T, ) -> Result<SubmissionId, Error>
pub async fn run_task( &self, agent_id: AgentID, sub_id: SubmissionId, session_id: Option<SessionId>, ) -> Result<AgentRunResult, Error>
pub async fn run( &self, agent_id: AgentID, session_id: Option<SessionId>, ) -> Result<AgentRunResult, Error>
pub async fn run_all( &self, agent_id: AgentID, session_id: Option<SessionId>, ) -> Result<Vec<AgentRunResult>, Error>
pub async fn event_sender( &self, session_id: Option<SessionId>, ) -> Result<Sender<Event>, Error>
pub async fn take_event_receiver( &mut self, session_id: Option<SessionId>, ) -> Option<ReceiverStream<Event>>
pub async fn shutdown(&mut self)
Auto Trait Implementations§
impl !Freeze for Environment
impl !RefUnwindSafe for Environment
impl Send for Environment
impl Sync for Environment
impl Unpin for Environment
impl !UnwindSafe for Environment
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> 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