pub trait NamedBusDevice<T>: Display + BusDevice<Timestamp = T, NextDevice = NullDevice<T>> { }Expand description
A trait for dynamic bus devices, which currently includes methods from Display and BusDevice. Devices implementing this trait can be used with a DynamicBus.
Implemented for all types that implement dependent traits.
Implementations§
Source§impl<T: 'static> dyn NamedBusDevice<T>
impl<T: 'static> dyn NamedBusDevice<T>
Sourcepub fn downcast<D>(
self: Box<Self>,
) -> Result<Box<D>, Box<dyn NamedBusDevice<T>>>where
D: NamedBusDevice<T> + 'static,
pub fn downcast<D>(
self: Box<Self>,
) -> Result<Box<D>, Box<dyn NamedBusDevice<T>>>where
D: NamedBusDevice<T> + 'static,
Attempts to downcast the box to a concrete type.
Source§impl<T: 'static> dyn NamedBusDevice<T> + 'static
impl<T: 'static> dyn NamedBusDevice<T> + 'static
Sourcepub fn is<D: NamedBusDevice<T> + 'static>(&self) -> bool
pub fn is<D: NamedBusDevice<T> + 'static>(&self) -> bool
Returns true if the boxed type is the same as D
Sourcepub fn downcast_ref<D: NamedBusDevice<T> + 'static>(&self) -> Option<&D>
pub fn downcast_ref<D: NamedBusDevice<T> + 'static>(&self) -> Option<&D>
Returns some reference to the boxed value if it is of type D, or
None if it isn’t.
Sourcepub fn downcast_mut<D: NamedBusDevice<T> + 'static>(&mut self) -> Option<&mut D>
pub fn downcast_mut<D: NamedBusDevice<T> + 'static>(&mut self) -> Option<&mut D>
Returns some mutable reference to the boxed value if it is of type D, or
None if it isn’t.