Skip to main content

Locator

Struct Locator 

Source
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: i32

The transport; see the KIND_* constants.

§port: u32

The port.

§address: [u8; 16]

The address. IPv4 addresses use the last four octets.

Implementations§

Source§

impl Locator

Source

pub const KIND_INVALID: i32 = -1

LOCATOR_KIND_INVALID.

Source

pub const KIND_RESERVED: i32 = 0

LOCATOR_KIND_RESERVED.

Source

pub const KIND_UDPV4: i32 = 1

LOCATOR_KIND_UDPv4.

Source

pub const KIND_UDPV6: i32 = 2

LOCATOR_KIND_UDPv6.

Source

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).

Source

pub const PORT_INVALID: u32 = 0

LOCATOR_PORT_INVALID.

Source

pub const ADDRESS_INVALID: [u8; 16]

LOCATOR_ADDRESS_INVALID.

Source

pub const INVALID: Locator

LOCATOR_INVALID.

Source

pub fn udpv4(addr: SocketAddrV4) -> Self

A UDPv4 locator.

Source

pub fn udpv6(addr: SocketAddrV6) -> Self

A UDPv6 locator.

Source

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§

Source§

impl Clone for Locator

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for Locator

Source§

impl Debug for Locator

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Locator

Source§

impl Hash for Locator

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for Locator

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Locator

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.