pub struct BinaryFrameEncoder;Expand description
Simple little-endian binary frame encoder.
Implementations§
Source§impl BinaryFrameEncoder
impl BinaryFrameEncoder
Sourcepub fn encode_command_dispatch_envelope(
&mut self,
station_id: StationId,
envelope: &CommandEnvelope,
out: &mut Vec<u8>,
) -> Result<(), BinaryEncodeError>
pub fn encode_command_dispatch_envelope( &mut self, station_id: StationId, envelope: &CommandEnvelope, out: &mut Vec<u8>, ) -> Result<(), BinaryEncodeError>
Encodes a stamped command envelope directly as a dispatch frame.
This avoids cloning the opaque payload into an intermediate owned
CommandDispatchFrame when the frame is immediately transmitted.
Trait Implementations§
Source§impl Clone for BinaryFrameEncoder
impl Clone for BinaryFrameEncoder
Source§fn clone(&self) -> BinaryFrameEncoder
fn clone(&self) -> BinaryFrameEncoder
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for BinaryFrameEncoder
Source§impl Debug for BinaryFrameEncoder
impl Debug for BinaryFrameEncoder
Source§impl Default for BinaryFrameEncoder
impl Default for BinaryFrameEncoder
Source§fn default() -> BinaryFrameEncoder
fn default() -> BinaryFrameEncoder
Returns the “default value” for a type. Read more
Source§impl FrameEncoder for BinaryFrameEncoder
impl FrameEncoder for BinaryFrameEncoder
Source§type Error = BinaryEncodeError
type Error = BinaryEncodeError
Encoder error type.
Source§fn encode_replication(
&mut self,
frame: &ReplicationFrame,
out: &mut Vec<u8>,
) -> Result<(), Self::Error>
fn encode_replication( &mut self, frame: &ReplicationFrame, out: &mut Vec<u8>, ) -> Result<(), Self::Error>
Encodes a replication frame into
out.Source§fn encode_command_ack(
&mut self,
frame: &CommandAckFrame,
out: &mut Vec<u8>,
) -> Result<(), Self::Error>
fn encode_command_ack( &mut self, frame: &CommandAckFrame, out: &mut Vec<u8>, ) -> Result<(), Self::Error>
Encodes a command acknowledgement frame into
out.Source§fn encode_command(
&mut self,
frame: &CommandFrame,
out: &mut Vec<u8>,
) -> Result<(), Self::Error>
fn encode_command( &mut self, frame: &CommandFrame, out: &mut Vec<u8>, ) -> Result<(), Self::Error>
Encodes a client command frame into
out.Source§fn encode_command_dispatch(
&mut self,
frame: &CommandDispatchFrame,
out: &mut Vec<u8>,
) -> Result<(), Self::Error>
fn encode_command_dispatch( &mut self, frame: &CommandDispatchFrame, out: &mut Vec<u8>, ) -> Result<(), Self::Error>
Encodes an internal command dispatch frame into
out.Source§fn encode_station_event(
&mut self,
frame: &StationEventFrame,
out: &mut Vec<u8>,
) -> Result<(), Self::Error>
fn encode_station_event( &mut self, frame: &StationEventFrame, out: &mut Vec<u8>, ) -> Result<(), Self::Error>
Encodes a cross-station event frame into
out.Source§fn encode_barrier(
&mut self,
frame: &BarrierFrame,
out: &mut Vec<u8>,
) -> Result<(), Self::Error>
fn encode_barrier( &mut self, frame: &BarrierFrame, out: &mut Vec<u8>, ) -> Result<(), Self::Error>
Encodes a barrier frame into
out.Auto Trait Implementations§
impl Freeze for BinaryFrameEncoder
impl RefUnwindSafe for BinaryFrameEncoder
impl Send for BinaryFrameEncoder
impl Sync for BinaryFrameEncoder
impl Unpin for BinaryFrameEncoder
impl UnsafeUnpin for BinaryFrameEncoder
impl UnwindSafe for BinaryFrameEncoder
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