pub struct RoutePath { /* private fields */ }Expand description
Route path for PLC communication.
Implementations§
Source§impl RoutePath
impl RoutePath
Sourcepub fn add_address(self, address: String) -> Self
pub fn add_address(self, address: String) -> Self
Adds a network address to the route
Sourcepub fn add_backplane(self, port: u8, slot: u8) -> Self
pub fn add_backplane(self, port: u8, slot: u8) -> Self
Adds a backplane hop with an explicit port number.
Sourcepub fn add_ethernet(self, address: impl Into<String>) -> Self
pub fn add_ethernet(self, address: impl Into<String>) -> Self
Adds an Ethernet hop using the common Rockwell Ethernet port number, 2.
Sourcepub fn add_ethernet_with_port(
self,
port: u8,
address: impl Into<String>,
) -> Self
pub fn add_ethernet_with_port( self, port: u8, address: impl Into<String>, ) -> Self
Adds an Ethernet hop with an explicit port number.
Sourcepub fn slots(&self) -> Vec<u8> ⓘ
pub fn slots(&self) -> Vec<u8> ⓘ
Returns legacy grouped backplane slots derived from the ordered hops.
Sourcepub fn ports(&self) -> Vec<u8> ⓘ
pub fn ports(&self) -> Vec<u8> ⓘ
Returns legacy grouped Ethernet ports derived from the ordered hops.
Sourcepub fn addresses(&self) -> Vec<String>
pub fn addresses(&self) -> Vec<String>
Returns legacy grouped Ethernet addresses derived from the ordered hops.
Sourcepub fn to_cip_bytes(&self) -> Vec<u8> ⓘ
pub fn to_cip_bytes(&self) -> Vec<u8> ⓘ
Builds CIP route path bytes
Reference: EtherNetIP_Connection_Paths_and_Routing.md, Port Segment Encoding According to the examples: Port 1 (backplane), Slot X = [0x01, X] The 0x01 byte encodes both “Port Segment (8-bit link)” AND “Port 1 (backplane)” Examples from documentation:
- Slot 0:
01 00 - Slot 1:
01 01 - Slot 2:
01 02
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RoutePath
impl RefUnwindSafe for RoutePath
impl Send for RoutePath
impl Sync for RoutePath
impl Unpin for RoutePath
impl UnsafeUnpin for RoutePath
impl UnwindSafe for RoutePath
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