pub struct ForcedSetResetCommand { /* private fields */ }Expand description
Command for forcing bits ON/OFF.
Implementations§
Source§impl ForcedSetResetCommand
impl ForcedSetResetCommand
Sourcepub fn new(
destination: NodeAddress,
source: NodeAddress,
sid: u8,
specs: Vec<ForcedBit>,
) -> Result<Self>
pub fn new( destination: NodeAddress, source: NodeAddress, sid: u8, specs: Vec<ForcedBit>, ) -> Result<Self>
Creates a new forced set/reset command.
§Arguments
destination- Destination node addresssource- Source node addresssid- Service ID for request/response matchingspecs- List of bits to force
§Errors
Returns an error if specs is empty, any area doesn’t support bit access, or any bit position is > 15.
§Example
use omron_fins::{ForcedSetResetCommand, ForcedBit, ForceSpec, MemoryArea, NodeAddress};
let cmd = ForcedSetResetCommand::new(
NodeAddress::new(0, 10, 0),
NodeAddress::new(0, 1, 0),
0x01,
vec![
ForcedBit { area: MemoryArea::CIO, address: 0, bit: 0, spec: ForceSpec::ForceOn },
],
).unwrap();Trait Implementations§
Source§impl Clone for ForcedSetResetCommand
impl Clone for ForcedSetResetCommand
Source§fn clone(&self) -> ForcedSetResetCommand
fn clone(&self) -> ForcedSetResetCommand
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 ForcedSetResetCommand
impl RefUnwindSafe for ForcedSetResetCommand
impl Send for ForcedSetResetCommand
impl Sync for ForcedSetResetCommand
impl Unpin for ForcedSetResetCommand
impl UnsafeUnpin for ForcedSetResetCommand
impl UnwindSafe for ForcedSetResetCommand
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