[−][src]Struct bastion::envelope::RefAddr
Message signature used to identify message sender and send messages to it.
Example
Bastion::children(|children| { children.with_exec(|ctx: BastionContext| { async move { // Wait for a message to be received... let msg: SignedMessage = ctx.recv().await?; ctx.tell(msg.signature(), "reply").expect("Unable to reply"); Ok(()) } }) }).expect("Couldn't create the children group.");
Methods
impl RefAddr
[src]
pub fn is_sender_identified(&self) -> bool
[src]
Checks whether the sender is identified. Usually anonymous sender means messages sent by broadcast and it's other methods implied to be called outside of the Bastion context.
Example
let msg = "A message containing data."; children_ref.broadcast(msg).expect("Couldn't send the message."); msg! { ctx.recv().await?, ref msg: &'static str => { assert!(signature!().is_sender_identified()); }; // We are only sending a `&'static str` in this // example, so we know that this won't happen... _: _ => (); }
pub fn path(&self) -> &Arc<BastionPath>
[src]
Returns BastionPath
of a sender
Example
let msg = "A message containing data."; children_ref.broadcast(msg).expect("Couldn't send the message."); msg! { ctx.recv().await?, ref msg: &'static str => { let path = signature!().path(); assert!(path.is_dead_letters()); }; // We are only sending a `&'static str` in this // example, so we know that this won't happen... _: _ => (); }
Trait Implementations
Auto Trait Implementations
impl !RefUnwindSafe for RefAddr
impl Send for RefAddr
impl Sync for RefAddr
impl Unpin for RefAddr
impl !UnwindSafe for RefAddr
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> AsAny for T where
T: Any,
[src]
T: Any,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> Message for T where
T: Any + Send + Sync + Debug,
[src]
T: Any + Send + Sync + Debug,
impl<T> State for T where
T: Send + Sync + 'static,
[src]
T: Send + Sync + 'static,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,