pub struct Mock {
version: ProtocolVersion,
ops: VecDeque<Operation>,
}Available on crate feature
wire and (crate features test) only.Fields§
§version: ProtocolVersion§ops: VecDeque<Operation>Trait Implementations§
Source§impl NixWrite for Mock
impl NixWrite for Mock
type Error = Error
Source§fn version(&self) -> ProtocolVersion
fn version(&self) -> ProtocolVersion
Some types are serialized differently depending on the version
of the protocol and so this can be used for implementing that.
Source§async fn write_number(&mut self, value: u64) -> Result<(), Self::Error>
async fn write_number(&mut self, value: u64) -> Result<(), Self::Error>
Write a single u64 to the protocol.
Source§async fn write_slice(&mut self, buf: &[u8]) -> Result<(), Self::Error>
async fn write_slice(&mut self, buf: &[u8]) -> Result<(), Self::Error>
Write a slice of bytes to the protocol.
Source§async fn write_display<D>(&mut self, msg: D) -> Result<(), Self::Error>
async fn write_display<D>(&mut self, msg: D) -> Result<(), Self::Error>
Write a value that implements
std::fmt::Display to the protocol.
The protocol uses many small string formats and instead of allocating
a String each time we want to write one an implementation of NixWrite
can instead use Display to dump these formats to a reusable buffer.Auto Trait Implementations§
impl Freeze for Mock
impl RefUnwindSafe for Mock
impl Send for Mock
impl Sync for Mock
impl Unpin for Mock
impl UnwindSafe for Mock
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more