pub struct Simulator { /* private fields */ }Expand description
Generates packets from a simulated controller.
Implementations§
Source§impl Simulator
impl Simulator
Sourcepub const PACKET_INTERVAL: Duration
pub const PACKET_INTERVAL: Duration
Time covered by one packet (three samples). Send packets this far apart for real-time playback.
Sourcepub const NAME: &'static str = "Simulated controller"
pub const NAME: &'static str = "Simulated controller"
The name the simulated controller reports.
pub fn new() -> Simulator
Sourcepub fn next_bytes(&mut self) -> [u8; 60]
pub fn next_bytes(&mut self) -> [u8; 60]
The next packet, as raw bytes.
Sourcepub fn next_packet(&mut self) -> Packet
pub fn next_packet(&mut self) -> Packet
The next packet, decoded. Values are quantized exactly as a real controller’s are.
Trait Implementations§
Auto Trait Implementations§
impl Forget for Simulator
impl Freeze for Simulator
impl Move for Simulator
impl RefUnwindSafe for Simulator
impl Send for Simulator
impl Sync for Simulator
impl Unpin for Simulator
impl UnsafeUnpin for Simulator
impl UnwindSafe for Simulator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more