pub struct Locator {
pub kind: i32,
pub port: u32,
pub address: [u8; 16],
}Expand description
A transport address (DDSI-RTPS 2.5, 9.3.2.4).
Fields§
§kind: i32The transport; see the KIND_* constants.
port: u32The port.
address: [u8; 16]The address. IPv4 addresses use the last four octets.
Implementations§
Source§impl Locator
impl Locator
Sourcepub const KIND_INVALID: i32 = -1
pub const KIND_INVALID: i32 = -1
LOCATOR_KIND_INVALID.
Sourcepub const KIND_RESERVED: i32 = 0
pub const KIND_RESERVED: i32 = 0
LOCATOR_KIND_RESERVED.
Sourcepub const KIND_UDPV4: i32 = 1
pub const KIND_UDPV4: i32 = 1
LOCATOR_KIND_UDPv4.
Sourcepub const KIND_UDPV6: i32 = 2
pub const KIND_UDPV6: i32 = 2
LOCATOR_KIND_UDPv6.
Sourcepub const KIND_SHM: i32 = 0x5244_0001
pub const KIND_SHM: i32 = 0x5244_0001
The shared memory transport of rustorb-dds (a vendor kind, “RD”
and 1): the address holds the host and the segment, the port the
traffic (see the module shm).
Sourcepub const PORT_INVALID: u32 = 0
pub const PORT_INVALID: u32 = 0
LOCATOR_PORT_INVALID.
Sourcepub const ADDRESS_INVALID: [u8; 16]
pub const ADDRESS_INVALID: [u8; 16]
LOCATOR_ADDRESS_INVALID.
Sourcepub fn udpv4(addr: SocketAddrV4) -> Self
pub fn udpv4(addr: SocketAddrV4) -> Self
A UDPv4 locator.
Sourcepub fn udpv6(addr: SocketAddrV6) -> Self
pub fn udpv6(addr: SocketAddrV6) -> Self
A UDPv6 locator.
Sourcepub fn to_socket_addr(&self) -> Option<SocketAddr>
pub fn to_socket_addr(&self) -> Option<SocketAddr>
The UDP socket address, if this is a UDPv4 or UDPv6 locator whose port fits in 16 bits.
Trait Implementations§
impl Copy for Locator
impl Eq for Locator
impl StructuralPartialEq for Locator
Auto Trait Implementations§
impl Forget for Locator
impl Freeze for Locator
impl Move for Locator
impl RefUnwindSafe for Locator
impl Send for Locator
impl Sync for Locator
impl Unpin for Locator
impl UnsafeUnpin for Locator
impl UnwindSafe for Locator
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