pub trait Agent: 'static + Sync + Send + Sized {
    // Required method
    fn new_session(&mut self) -> impl Session;

    // Provided method
    fn listen<'async_trait, S>(
        self,
        socket: S
    ) -> Pin<Box<dyn Future<Output = Result<(), AgentError>> + Send + 'async_trait>>
       where S: ListeningSocket + Debug + Send + 'async_trait,
             Self: 'async_trait { ... }
}

Required Methods§

source

fn new_session(&mut self) -> impl Session

Provided Methods§

source

fn listen<'async_trait, S>( self, socket: S ) -> Pin<Box<dyn Future<Output = Result<(), AgentError>> + Send + 'async_trait>>
where S: ListeningSocket + Debug + Send + 'async_trait, Self: 'async_trait,

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<T> Agent for T
where T: Default + Session,