pub struct HostState { /* private fields */ }Implementations§
Source§impl HostState
impl HostState
pub fn new() -> Self
pub async fn subscribe(&self, client_id: &str, channel: Arc<WsChannel>)
pub async fn unsubscribe(&self, client_id: &str)
pub async fn register_agent( &self, client_id: &str, req: RegisterHostAgentRequest, ) -> Result<HostAgent, String>
pub async fn unregister_agent(&self, agent_id: &str) -> Result<(), String>
pub async fn set_status( &self, req: SetHostAgentStatusRequest, ) -> Result<HostAgent, String>
pub async fn create_approval( &self, req: CreateHostApprovalRequest, ) -> Result<HostApprovalRequest, String>
pub async fn resolve_approval( &self, req: ResolveHostApprovalRequest, ) -> Result<HostApprovalRequest, String>
pub async fn agents(&self) -> Vec<HostAgent>
pub async fn approvals(&self) -> Vec<HostApprovalRequest>
pub async fn events(&self, limit: usize) -> Vec<HostEvent>
pub async fn record_event( &self, kind: impl Into<String>, agent_id: Option<String>, message: impl Into<String>, payload: Value, ) -> HostEvent
Trait Implementations§
Auto Trait Implementations§
impl !Freeze for HostState
impl !RefUnwindSafe for HostState
impl Send for HostState
impl Sync for HostState
impl Unpin for HostState
impl UnsafeUnpin for HostState
impl !UnwindSafe for HostState
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<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
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