pub struct CommandInterfaceView<'a> {
pub command: &'a mut u16,
pub command_code: &'a mut u32,
pub command_arg_1: &'a mut f64,
pub command_arg_2: &'a mut f64,
pub command_status: &'a mut u16,
pub command_result: &'a mut f64,
}Expand description
View struct for mapping command interface signals to GlobalMemory fields.
Create one of these each scan cycle by borrowing the appropriate fields
from your GlobalMemory struct, then pass it to CommandInterface::call.
§Example
ⓘ
fn cmd_view(gm: &mut GlobalMemory) -> CommandInterfaceView<'_> {
CommandInterfaceView {
command: &mut gm.robot_command,
command_code: &mut gm.robot_command_code,
command_arg_1: &mut gm.robot_arg_1,
command_arg_2: &mut gm.robot_arg_2,
command_status: &mut gm.robot_status,
command_result: &mut gm.robot_result,
}
}Fields§
§command: &'a mut u16Request from external source (CommandRequest values stored as u16).
command_code: &'a mut u32Identifies the specific command to execute.
command_arg_1: &'a mut f64First argument to the command. Meaning is defined per command code.
command_arg_2: &'a mut f64Second argument to the command. Meaning is defined per command code.
command_status: &'a mut u16Current status of the interface (CommandStatus values stored as u16).
command_result: &'a mut f64Result value from the most recently completed command.
Auto Trait Implementations§
impl<'a> Freeze for CommandInterfaceView<'a>
impl<'a> RefUnwindSafe for CommandInterfaceView<'a>
impl<'a> Send for CommandInterfaceView<'a>
impl<'a> Sync for CommandInterfaceView<'a>
impl<'a> Unpin for CommandInterfaceView<'a>
impl<'a> UnsafeUnpin for CommandInterfaceView<'a>
impl<'a> !UnwindSafe for CommandInterfaceView<'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