[−][src]Struct lifeline::dyn_bus::DynBusStorage
Dynamic bus storage based on trait object slots, for Senders, Receivers, and Resources.
Most values are stored as HashMap<TypeId, BusSlot>
Implementations
impl<B: Bus> DynBusStorage<B>
[src]
pub fn link_channel<Msg, Bus>(&self) where
Msg: Message<B> + 'static,
[src]
Msg: Message<B> + 'static,
Links a channel on the bus, locking the state and inserting BusSlots for the sender/receiver pair
pub fn clone_rx<Msg, Bus>(
&self
) -> Result<<Msg::Channel as Channel>::Rx, TakeChannelError> where
Msg: Message<B> + 'static,
[src]
&self
) -> Result<<Msg::Channel as Channel>::Rx, TakeChannelError> where
Msg: Message<B> + 'static,
Takes or clones the channel receiver, using the Channel
trait implementation.
Returns an error if the endpoint cannot be taken.
pub fn clone_tx<Msg, Bus>(
&self
) -> Result<<Msg::Channel as Channel>::Tx, TakeChannelError> where
Msg: Message<B> + 'static,
[src]
&self
) -> Result<<Msg::Channel as Channel>::Tx, TakeChannelError> where
Msg: Message<B> + 'static,
Takes or clones the channel sender, using the Channel
trait implementation.
Returns an error if the endpoint cannot be taken.
pub fn clone_resource<Res>(&self) -> Result<Res, TakeResourceError> where
Res: Resource<B> + 'static,
[src]
Res: Resource<B> + 'static,
Takes or clones the resource, using the Storage
trait implementation.
Returns an error if the resource cannot be taken.
pub fn store_resource<Res: Send + 'static, Bus>(&self, value: Res)
[src]
Stores the resource on the bus, overwriting it if it already exists
pub fn store_channel<Msg, Chan, Bus>(
&self,
rx: Option<Chan::Rx>,
tx: Option<Chan::Tx>
) -> Result<(), AlreadyLinkedError> where
Chan: Channel,
Msg: 'static,
[src]
&self,
rx: Option<Chan::Rx>,
tx: Option<Chan::Tx>
) -> Result<(), AlreadyLinkedError> where
Chan: Channel,
Msg: 'static,
Stores the (Rx, Tx) pair, or either of them if Nones are provided. This consumes the bus slot for this message type. Future calls to store on this message type will fail.
pub fn capacity<Msg>(&self, capacity: usize) -> Result<(), AlreadyLinkedError> where
Msg: Message<B> + 'static,
[src]
Msg: Message<B> + 'static,
Writes a capacity to the bus storage, for the given message type. Returns an error if the channel is already linked in the bus storage (as this capacity would do nothing).
Trait Implementations
impl<B: Debug> Debug for DynBusStorage<B>
[src]
impl<B: Bus> Default for DynBusStorage<B>
[src]
Auto Trait Implementations
impl<B> RefUnwindSafe for DynBusStorage<B> where
B: RefUnwindSafe,
[src]
B: RefUnwindSafe,
impl<B> Send for DynBusStorage<B> where
B: Send,
[src]
B: Send,
impl<B> !Sync for DynBusStorage<B>
[src]
impl<B> Unpin for DynBusStorage<B> where
B: Unpin,
[src]
B: Unpin,
impl<B> UnwindSafe for DynBusStorage<B> where
B: UnwindSafe,
[src]
B: UnwindSafe,
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub 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, 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.
pub 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>,