pub enum Command<'a> {
PrepareStream(PrepareStream),
Begin(Begin),
PointRate(PointRate),
Data(Data<'a>),
Stop(Stop),
EmergencyStop(EmergencyStop),
ClearEmergencyStop(ClearEmergencyStop),
Ping(Ping),
}Expand description
A command whose kind is determined at runtime.
This is particularly useful when Reading a command from bytes or from a TCP stream. The ReadFromBytes implementation will automatically determine the kind by reading the first byte.
Variants§
PrepareStream(PrepareStream)
Begin(Begin)
PointRate(PointRate)
Data(Data<'a>)
Stop(Stop)
EmergencyStop(EmergencyStop)
ClearEmergencyStop(ClearEmergencyStop)
Ping(Ping)
Trait Implementations§
Source§impl<'a> From<ClearEmergencyStop> for Command<'a>
impl<'a> From<ClearEmergencyStop> for Command<'a>
Source§fn from(command: ClearEmergencyStop) -> Self
fn from(command: ClearEmergencyStop) -> Self
Converts to this type from the input type.
Source§impl<'a> From<EmergencyStop> for Command<'a>
impl<'a> From<EmergencyStop> for Command<'a>
Source§fn from(command: EmergencyStop) -> Self
fn from(command: EmergencyStop) -> Self
Converts to this type from the input type.
Source§impl<'a> From<EmergencyStopAlt> for Command<'a>
impl<'a> From<EmergencyStopAlt> for Command<'a>
Source§fn from(_: EmergencyStopAlt) -> Self
fn from(_: EmergencyStopAlt) -> Self
Converts to this type from the input type.
Source§impl<'a> From<PrepareStream> for Command<'a>
impl<'a> From<PrepareStream> for Command<'a>
Source§fn from(command: PrepareStream) -> Self
fn from(command: PrepareStream) -> Self
Converts to this type from the input type.
Source§impl ReadFromBytes for Command<'static>
impl ReadFromBytes for Command<'static>
Source§fn read_from_bytes<R: ReadBytesExt>(reader: R) -> Result<Self>
fn read_from_bytes<R: ReadBytesExt>(reader: R) -> Result<Self>
Read the command from bytes.
Source§impl<'a> WriteToBytes for Command<'a>
impl<'a> WriteToBytes for Command<'a>
Source§fn write_to_bytes<W: WriteBytesExt>(&self, writer: W) -> Result<()>
fn write_to_bytes<W: WriteBytesExt>(&self, writer: W) -> Result<()>
Write the command to bytes.
impl<'a> Eq for Command<'a>
impl<'a> StructuralPartialEq for Command<'a>
Auto Trait Implementations§
impl<'a> Freeze for Command<'a>
impl<'a> RefUnwindSafe for Command<'a>
impl<'a> Send for Command<'a>
impl<'a> Sync for Command<'a>
impl<'a> Unpin for Command<'a>
impl<'a> UnsafeUnpin for Command<'a>
impl<'a> UnwindSafe for Command<'a>
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