pub struct TransferCommand { /* private fields */ }Expand description
Command for transferring memory from one area to another.
Implementations§
Source§impl TransferCommand
impl TransferCommand
Sourcepub fn new(
destination: NodeAddress,
source: NodeAddress,
sid: u8,
src_area: MemoryArea,
src_address: u16,
dst_area: MemoryArea,
dst_address: u16,
count: u16,
) -> Result<Self>
pub fn new( destination: NodeAddress, source: NodeAddress, sid: u8, src_area: MemoryArea, src_address: u16, dst_area: MemoryArea, dst_address: u16, count: u16, ) -> Result<Self>
Creates a new transfer command.
§Arguments
destination- Destination node addresssource- Source node addresssid- Service ID for request/response matchingsrc_area- Source memory areasrc_address- Source starting addressdst_area- Destination memory areadst_address- Destination starting addresscount- Number of words to transfer (1 to maximum area capacity of the smallest area)
§Errors
Returns an error if count is 0 or exceeds the available capacity of either source or destination.
§Example
use omron_fins::{TransferCommand, MemoryArea, NodeAddress};
let cmd = TransferCommand::new(
NodeAddress::new(0, 10, 0),
NodeAddress::new(0, 1, 0),
0x01,
MemoryArea::DM,
100,
MemoryArea::DM,
200,
10,
).unwrap();Trait Implementations§
Source§impl Clone for TransferCommand
impl Clone for TransferCommand
Source§fn clone(&self) -> TransferCommand
fn clone(&self) -> TransferCommand
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 moreAuto Trait Implementations§
impl Freeze for TransferCommand
impl RefUnwindSafe for TransferCommand
impl Send for TransferCommand
impl Sync for TransferCommand
impl Unpin for TransferCommand
impl UnsafeUnpin for TransferCommand
impl UnwindSafe for TransferCommand
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