pub trait Agent:
Sized
+ Send
+ 'static {
type Context: AgentContext<Self>;
type Output: Output;
// Provided methods
fn initialize(&mut self, _ctx: &mut Self::Context) -> Next<Self> { ... }
fn begin(&mut self) -> Next<Self> { ... }
fn interrupt(&mut self, ctx: &mut Self::Context) { ... }
fn event<'life0, 'life1, 'async_trait>(
&'life0 mut self,
ctx: &'life1 mut Self::Context,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait { ... }
fn finalize(&mut self, _ctx: &mut Self::Context) -> Self::Output { ... }
fn end(&mut self) -> Self::Output { ... }
}Required Associated Types§
Provided Methods§
fn initialize(&mut self, _ctx: &mut Self::Context) -> Next<Self>
fn begin(&mut self) -> Next<Self>
fn interrupt(&mut self, ctx: &mut Self::Context)
fn event<'life0, 'life1, 'async_trait>(
&'life0 mut self,
ctx: &'life1 mut Self::Context,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn finalize(&mut self, _ctx: &mut Self::Context) -> Self::Output
fn end(&mut self) -> Self::Output
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.