pub struct Locator {
pub kind: LocatorKind,
pub port: u32,
pub address: [u8; 16],
}Expand description
Locator: 24-byte address (kind + port + 16-byte address).
Fields§
§kind: LocatorKindAddress family.
port: u32UDP port.
address: [u8; 16]16-byte address. UDPv4 uses the last 4 bytes, 0 before that.
Implementations§
Source§impl Locator
impl Locator
Sourcepub const RESERVED: Self
pub const RESERVED: Self
Spec §8.3.5.7 LOCATOR_KIND_RESERVED template (kind=0,
port=0, address=0).
Sourcepub const UDP_V4_ANY: Self
pub const UDP_V4_ANY: Self
Spec §8.3.5.7 — default UDPv4 locator (kind=1, port=0, addr=0).
Sourcepub const UDP_V6_ANY: Self
pub const UDP_V6_ANY: Self
Spec §8.3.5.7 — default UDPv6 locator (kind=2, port=0, addr=0).
Sourcepub const PORT_INVALID: u32 = 0
pub const PORT_INVALID: u32 = 0
Spec §8.3.5.7 — LOCATOR_PORT_INVALID sentinel.
Sourcepub const ADDRESS_INVALID: [u8; 16]
pub const ADDRESS_INVALID: [u8; 16]
Spec §8.3.5.7 — LOCATOR_ADDRESS_INVALID sentinel.
Sourcepub fn udp_v6(addr: [u8; 16], port: u32) -> Self
pub fn udp_v6(addr: [u8; 16], port: u32) -> Self
Constructor for UDPv6 (16-byte address + port).
Sourcepub fn tcp_v6(addr: [u8; 16], port: u32) -> Self
pub fn tcp_v6(addr: [u8; 16], port: u32) -> Self
Constructor for TCPv6 (DDSI-RTPS 2.5 §9.4, LocatorKind=8). 16-byte network-byte-order address.
Sourcepub fn new_tcp_v4(addr: [u8; 4], port: u32) -> Self
👎Deprecated: use Locator::tcp_v4 instead (naming consistency)
pub fn new_tcp_v4(addr: [u8; 4], port: u32) -> Self
use Locator::tcp_v4 instead (naming consistency)
Legacy alias for Self::tcp_v4. Deprecated: rename
call sites to tcp_v4 (consistent with udp_v4).
Sourcepub fn uds(id: [u8; 16]) -> Self
pub fn uds(id: [u8; 16]) -> Self
Constructor for a Unix domain socket endpoint with a 16-byte
ID. The port stays 0 (not meaningful for UDS). The transport
resolves the ID to /<base_dir>/<hex>.sock.
Sourcepub fn shm(id: [u8; 16]) -> Self
pub fn shm(id: [u8; 16]) -> Self
Constructor for a shared-memory segment with an ID (16-byte token). The port field stays 0 (not meaningful for SHM).
Sourcepub fn tsn(mac: [u8; 6], vlan_vid: u16) -> Self
pub fn tsn(mac: [u8; 6], vlan_vid: u16) -> Self
Constructor for a TSN L2 endpoint (DDS-TSN 1.0 Annex A).
mac is the 6-byte destination MAC, vlan_vid the IEEE 802.1Q VID
(0 = untagged). Layout in the 16-byte address field: bytes 0..6 MAC,
bytes 6..8 VID (big-endian), rest 0. The port stays 0.
Sourcepub fn to_bytes_le(self) -> [u8; 24]
pub fn to_bytes_le(self) -> [u8; 24]
LE encoder.
Sourcepub fn to_bytes_be(self) -> [u8; 24]
pub fn to_bytes_be(self) -> [u8; 24]
BE encoder (for PL_CDR_BE, e.g. handshake c.pdata).