Trait spectrusty::bus::NamedBusDevice
source · 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> dyn NamedBusDevice<T, Timestamp = T, NextDevice = NullDevice<T>> + 'staticwhere
T: 'static,
impl<T> dyn NamedBusDevice<T, Timestamp = T, NextDevice = NullDevice<T>> + 'staticwhere
T: 'static,
sourcepub fn downcast<D>(
self: Box<dyn NamedBusDevice<T, Timestamp = T, NextDevice = NullDevice<T>> + 'static, Global>
) -> Result<Box<D, Global>, Box<dyn NamedBusDevice<T, Timestamp = T, NextDevice = NullDevice<T>> + 'static, Global>>where
D: 'static + NamedBusDevice<T>,
pub fn downcast<D>(
self: Box<dyn NamedBusDevice<T, Timestamp = T, NextDevice = NullDevice<T>> + 'static, Global>
) -> Result<Box<D, Global>, Box<dyn NamedBusDevice<T, Timestamp = T, NextDevice = NullDevice<T>> + 'static, Global>>where
D: 'static + NamedBusDevice<T>,
Attempts to downcast the box to a concrete type.
source§impl<T> dyn NamedBusDevice<T, Timestamp = T, NextDevice = NullDevice<T>> + 'staticwhere
T: 'static,
impl<T> dyn NamedBusDevice<T, Timestamp = T, NextDevice = NullDevice<T>> + 'staticwhere
T: 'static,
sourcepub fn is<D>(&self) -> boolwhere
D: 'static + NamedBusDevice<T>,
pub fn is<D>(&self) -> boolwhere
D: 'static + NamedBusDevice<T>,
Returns true
if the boxed type is the same as D
sourcepub fn downcast_ref<D>(&self) -> Option<&D>where
D: 'static + NamedBusDevice<T>,
pub fn downcast_ref<D>(&self) -> Option<&D>where
D: 'static + NamedBusDevice<T>,
Returns some reference to the boxed value if it is of type D
, or
None
if it isn’t.
sourcepub fn downcast_mut<D>(&mut self) -> Option<&mut D>where
D: 'static + NamedBusDevice<T>,
pub fn downcast_mut<D>(&mut self) -> Option<&mut D>where
D: 'static + NamedBusDevice<T>,
Returns some mutable reference to the boxed value if it is of type D
, or
None
if it isn’t.
Trait Implementations§
source§impl<T> AyAudioBusDevice for dyn NamedBusDevice<T, Timestamp = T, NextDevice = NullDevice<T>> + 'staticwhere
T: 'static + Into<i32> + Copy + Debug,
impl<T> AyAudioBusDevice for dyn NamedBusDevice<T, Timestamp = T, NextDevice = NullDevice<T>> + 'staticwhere
T: 'static + Into<i32> + Copy + Debug,
source§fn render_ay_audio<L, B>(
&mut self,
blep: &mut B,
end_ts: T,
frame_tstates: i32,
chans: [usize; 3]
)where
L: AmpLevels<<B as Blep>::SampleDelta>,
B: Blep,
fn render_ay_audio<L, B>(
&mut self,
blep: &mut B,
end_ts: T,
frame_tstates: i32,
chans: [usize; 3]
)where
L: AmpLevels<<B as Blep>::SampleDelta>,
B: Blep,
Note
Because we need to guess the concrete type of the dynamic BusDevice
we can currently handle
only the most common cases: Ay3_891xMelodik and Ay3_891xFullerBox. If you use a customized
Ay3_891xBusDevice for a dynamic BusDevice
you need to render audio directly on the device
downcasted to your custom type.