pub struct AgentLink<AGN>where
AGN: Agent,{ /* private fields */ }Expand description
Link to agent’s scope for creating callbacks.
Implementations
sourceimpl<AGN> AgentLink<AGN>where
AGN: Agent,
impl<AGN> AgentLink<AGN>where
AGN: Agent,
sourcepub fn respond(&self, id: HandlerId, output: <AGN as Agent>::Output)
pub fn respond(&self, id: HandlerId, output: <AGN as Agent>::Output)
Send response to an agent.
sourcepub fn send_message<T>(&self, msg: T)where
T: Into<<AGN as Agent>::Message>,
pub fn send_message<T>(&self, msg: T)where
T: Into<<AGN as Agent>::Message>,
Send a message to the agent
sourcepub fn send_input<T>(&self, input: T)where
T: Into<<AGN as Agent>::Input>,
pub fn send_input<T>(&self, input: T)where
T: Into<<AGN as Agent>::Input>,
Send an input to self
sourcepub fn callback<F, IN, M>(&self, function: F) -> Callback<IN>where
M: Into<<AGN as Agent>::Message>,
F: 'static + Fn(IN) -> M,
pub fn callback<F, IN, M>(&self, function: F) -> Callback<IN>where
M: Into<<AGN as Agent>::Message>,
F: 'static + Fn(IN) -> M,
Create a callback which will send a message to the agent when invoked.
sourcepub fn callback_future<FN, FU, IN, M>(&self, function: FN) -> Callback<IN>where
M: Into<<AGN as Agent>::Message>,
FU: 'static + Future<Output = M>,
FN: 'static + Fn(IN) -> FU,
pub fn callback_future<FN, FU, IN, M>(&self, function: FN) -> Callback<IN>where
M: Into<<AGN as Agent>::Message>,
FU: 'static + Future<Output = M>,
FN: 'static + Fn(IN) -> FU,
Trait Implementations
Auto Trait Implementations
impl<AGN> !RefUnwindSafe for AgentLink<AGN>
impl<AGN> !Send for AgentLink<AGN>
impl<AGN> !Sync for AgentLink<AGN>
impl<AGN> Unpin for AgentLink<AGN>
impl<AGN> !UnwindSafe for AgentLink<AGN>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> IntoPropValue<Option<T>> for T
impl<T> IntoPropValue<Option<T>> for T
sourcefn into_prop_value(self) -> Option<T>
fn into_prop_value(self) -> Option<T>
Convert
self to a value of a Properties struct.sourceimpl<T> IntoPropValue<T> for T
impl<T> IntoPropValue<T> for T
sourcefn into_prop_value(self) -> T
fn into_prop_value(self) -> T
Convert
self to a value of a Properties struct.