pub struct MockCiDataDevice {
pub descrambled: VecDeque<Vec<u8>>,
pub written: Vec<Vec<u8>>,
}Expand description
In-memory CiDataDevice for tests and the differential harness.
descrambledis a scripted queue of TS the “module” returns; eachreadpops one entry (the “scripted descramble”).- every byte the host writes is recorded in
written, so a test (or a byte-exact comparison against an external reference) can assert the exact scrambled TS that was pushed in.
Fields§
§descrambled: VecDeque<Vec<u8>>Scripted descrambled-TS the module returns to the host (FIFO).
written: Vec<Vec<u8>>Scrambled TS the host wrote, in order.
Implementations§
Source§impl MockCiDataDevice
impl MockCiDataDevice
Sourcepub fn new(descrambled: impl IntoIterator<Item = Vec<u8>>) -> Self
pub fn new(descrambled: impl IntoIterator<Item = Vec<u8>>) -> Self
New mock returning the given descrambled-TS script.
Sourcepub fn written_ts(&self) -> Vec<u8> ⓘ
pub fn written_ts(&self) -> Vec<u8> ⓘ
All scrambled TS the host wrote, concatenated.
Trait Implementations§
Source§impl CiDataDevice for MockCiDataDevice
impl CiDataDevice for MockCiDataDevice
Source§fn write(&mut self, ts: &[u8]) -> Result<()>
fn write(&mut self, ts: &[u8]) -> Result<()>
Write scrambled TS to the module.
ts must be a whole number of
TS_PACKET_LEN-byte packets.Source§impl Debug for MockCiDataDevice
impl Debug for MockCiDataDevice
Source§impl Default for MockCiDataDevice
impl Default for MockCiDataDevice
Source§fn default() -> MockCiDataDevice
fn default() -> MockCiDataDevice
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for MockCiDataDevice
impl RefUnwindSafe for MockCiDataDevice
impl Send for MockCiDataDevice
impl Sync for MockCiDataDevice
impl Unpin for MockCiDataDevice
impl UnsafeUnpin for MockCiDataDevice
impl UnwindSafe for MockCiDataDevice
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