Struct RunAgent

Source
pub struct RunAgent<A: Agent> {
    pub agent: Option<A>,
    pub context: Context<A>,
    pub level: InterruptionLevel,
}

Fields§

§agent: Option<A>§context: Context<A>§level: InterruptionLevel

Implementations§

Source§

impl<A: Agent> RunAgent<A>

Source

pub fn new(agent: A) -> Self
where A::Context: Default,

Source

pub async fn operate(self)

Source

pub fn report(&mut self, interrupted: bool)

Source

pub async fn perform_and_report(&mut self)

Source

pub async fn perform(&mut self)

Source

pub async fn perform_abortable_task(&mut self) -> Result<()>

Trait Implementations§

Source§

impl<A: Agent> InteractiveRuntime for RunAgent<A>

Source§

type Context = <A as Agent>::Context

Type of the composable block’s contenxt.
Source§

fn address(&self) -> <Self::Context as ReachableContext>::Address

Source§

impl<A: Agent> InteractiveTask<A> for RunAgent<A>

Source§

impl<A: Agent> IntoFuture for RunAgent<A>

Source§

type Output = ()

The output that the future will produce on completion.
Source§

type IntoFuture = Pin<Box<dyn Future<Output = ()> + Send>>

Which kind of future are we turning this into?
Source§

fn into_future(self) -> Self::IntoFuture

Creates a future from a value. Read more
Source§

impl<A> Runtime for RunAgent<A>
where A: Agent,

Source§

fn get_interruptor(&mut self) -> Box<dyn Interruptor>

The get_interruptor method returns an instance of an interruptor. Read more
Source§

fn interruption_level(&self) -> InterruptionLevel

The interruption_level method returns the default level at which the runtime should be interrupted. Read more
Source§

fn routine<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

The asynchronous routine method is the primary execution method of the Runtime. Read more
Source§

impl<A: Agent> Task<A> for RunAgent<A>

Source§

fn spawn(self) -> TaskHandle<T>

Source§

fn run<'async_trait>( self, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where Self: Send + 'async_trait,

Auto Trait Implementations§

§

impl<A> Freeze for RunAgent<A>
where A: Freeze, <A as Agent>::Context: Freeze,

§

impl<A> !RefUnwindSafe for RunAgent<A>

§

impl<A> Send for RunAgent<A>

§

impl<A> !Sync for RunAgent<A>

§

impl<A> Unpin for RunAgent<A>
where A: Unpin, <A as Agent>::Context: Unpin,

§

impl<A> !UnwindSafe for RunAgent<A>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> AgentState for T
where T: Send + 'static,

Source§

impl<T> Msg for T
where T: Send + 'static,

Source§

impl<T> Tag for T
where T: Send + 'static,

Source§

impl<T> TheEvent for T
where T: Send + 'static,