pub struct Command { /* private fields */ }Expand description
Runtime command value with kind, external sequence, external time, and payload.
Implementations§
Source§impl Command
impl Command
Sourcepub fn new(
command_kind: u8,
ext_seq: u64,
ref_ext_time_us: u64,
payload: Vec<u8>,
) -> Self
pub fn new( command_kind: u8, ext_seq: u64, ref_ext_time_us: u64, payload: Vec<u8>, ) -> Self
Creates a command envelope.
Sourcepub fn command_kind(&self) -> u8
pub fn command_kind(&self) -> u8
Returns the command kind.
Sourcepub fn ingress_dedupe_key(&self) -> u64
pub fn ingress_dedupe_key(&self) -> u64
Returns the dedupe key used by ingress.
Sourcepub fn ref_ext_time_us(&self) -> u64
pub fn ref_ext_time_us(&self) -> u64
Returns the source-provided reference time in microseconds.
Sourcepub fn payload_len(&self) -> usize
pub fn payload_len(&self) -> usize
Returns the payload byte length.
Sourcepub fn into_payload(self) -> Vec<u8> ⓘ
pub fn into_payload(self) -> Vec<u8> ⓘ
Consumes the command and returns the encoded payload.
Trait Implementations§
impl Eq for Command
impl StructuralPartialEq for Command
Auto Trait Implementations§
impl Freeze for Command
impl RefUnwindSafe for Command
impl Send for Command
impl Sync for Command
impl Unpin for Command
impl UnsafeUnpin for Command
impl UnwindSafe for Command
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