pub struct UnifiedAgent {
pub broadcast_emitter: Sender<NodeMessageTransporter>,
pub broadcast_receiver: Arc<Mutex<Receiver<NodeMessageTransporter>>>,
pub shutdown_send: UnboundedSender<String>,
pub shutdown_recv: Arc<Mutex<UnboundedReceiver<String>>>,
/* private fields */
}Fields§
§broadcast_emitter: Sender<NodeMessageTransporter>§broadcast_receiver: Arc<Mutex<Receiver<NodeMessageTransporter>>>§shutdown_send: UnboundedSender<String>§shutdown_recv: Arc<Mutex<UnboundedReceiver<String>>>Implementations§
Source§impl UnifiedAgent
impl UnifiedAgent
pub fn new( config: Option<UnifiedAgentConfig>, config_path: Option<String>, on_message: Arc<dyn MessageHandler>, processor: Arc<dyn Processor>, on_event: Arc<dyn EventHandler>, ) -> Self
pub async fn send_direct(&self, to_peer: String, message: Vec<u8>)
pub async fn broadcast(&self, message: Vec<u8>)
pub fn details(&self) -> AgentDetail
pub async fn get_connected_agents(&self) -> Vec<AgentDetail>
pub async fn start( &self, inputs: Vec<u8>, agents: Option<Vec<Arc<UnifiedAgent>>>, )
pub async fn stop(&self)
Auto Trait Implementations§
impl Freeze for UnifiedAgent
impl !RefUnwindSafe for UnifiedAgent
impl Send for UnifiedAgent
impl Sync for UnifiedAgent
impl Unpin for UnifiedAgent
impl !UnwindSafe for UnifiedAgent
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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