[go: up one dir, main page]

bastion 0.2.0

Fault-tolerant Runtime for Rust applications
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
//!
//! Implementations for message gating, receiving and destination definitions.

use crate::child::Message;

///
/// In-process message receive implementation
pub struct Receive<T>(pub Option<T>);

impl<T: 'static + Clone> From<Box<dyn Message>> for Receive<T> {
    fn from(message: Box<dyn Message>) -> Self {
        Receive(message.as_any().downcast_ref::<T>().cloned())
    }
}