pub struct PiperCommand {
pub frame: PiperFrame,
pub priority: CommandPriority,
}Expand description
带优先级的命令
封装 CAN 帧和优先级信息,用于类型安全的命令发送。
Fields§
§frame: PiperFrameCAN 帧
priority: CommandPriority命令优先级
Implementations§
Source§impl PiperCommand
impl PiperCommand
Sourcepub fn realtime(frame: PiperFrame) -> PiperCommand
pub fn realtime(frame: PiperFrame) -> PiperCommand
创建实时控制命令
Sourcepub fn reliable(frame: PiperFrame) -> PiperCommand
pub fn reliable(frame: PiperFrame) -> PiperCommand
创建可靠命令
Sourcepub fn frame(&self) -> PiperFrame
pub fn frame(&self) -> PiperFrame
获取命令帧
Sourcepub fn priority(&self) -> CommandPriority
pub fn priority(&self) -> CommandPriority
获取命令优先级
Trait Implementations§
Source§impl Clone for PiperCommand
impl Clone for PiperCommand
Source§fn clone(&self) -> PiperCommand
fn clone(&self) -> PiperCommand
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for PiperCommand
impl Debug for PiperCommand
Source§impl From<PiperCommand> for PiperFrame
impl From<PiperCommand> for PiperFrame
Source§fn from(cmd: PiperCommand) -> PiperFrame
fn from(cmd: PiperCommand) -> PiperFrame
Converts to this type from the input type.
Source§impl From<PiperFrame> for PiperCommand
impl From<PiperFrame> for PiperCommand
Source§fn from(frame: PiperFrame) -> PiperCommand
fn from(frame: PiperFrame) -> PiperCommand
默认转换为可靠命令(向后兼容)
impl Copy for PiperCommand
Auto Trait Implementations§
impl Freeze for PiperCommand
impl RefUnwindSafe for PiperCommand
impl Send for PiperCommand
impl Sync for PiperCommand
impl Unpin for PiperCommand
impl UnwindSafe for PiperCommand
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more