Skip to main content

ExpandedNodeId

Struct ExpandedNodeId 

Source
pub struct ExpandedNodeId(/* private fields */);
Expand description

Wrapper for UA_ExpandedNodeId from open62541_sys.

This owns the wrapped data. When the wrapper is dropped, the inner value is cleaned up with UA_clear() to release dynamically allocated memory held by the value.

Implementations§

Source§

impl ExpandedNodeId

Source

pub fn new(node_id: NodeId, namespace_uri: String, server_index: u32) -> Self

Creates expanded node ID.

Constructs a new instance from parts by taking ownership.

§Example
use open62541::ua;

let node_id = ua::NodeId::numeric(1, 234);
let namespace_uri = ua::String::new("http://www.example.com").unwrap();
let server_index = 99;

let expanded_node_id = ua::ExpandedNodeId::new(
    node_id.clone(),
    namespace_uri.clone(),
    server_index);

assert_eq!(expanded_node_id.node_id(), &node_id);
assert_eq!(expanded_node_id.namespace_uri(), &namespace_uri);
assert_eq!(expanded_node_id.server_index(), server_index);
Source

pub fn numeric(ns_index: u16, numeric: u32) -> Self

Creates numeric expanded node ID.

Source

pub fn node_id(&self) -> &NodeId

Source

pub fn namespace_uri(&self) -> &String

Source

pub const fn server_index(&self) -> u32

Trait Implementations§

Source§

impl Clone for ExpandedNodeId

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 DataType for ExpandedNodeId

Source§

type Inner = UA_ExpandedNodeId

Inner type. Read more
Source§

fn data_type() -> *const UA_DataType

Gets open62541 data type record. Read more
Source§

unsafe fn from_raw(src: Self::Inner) -> Self

Creates wrapper by taking ownership of value. Read more
Source§

fn into_raw(self) -> Self::Inner

Gives up ownership and returns value. Read more
Source§

fn type_name() -> &'static str

Gets data type name.
Source§

fn init() -> Self

Creates wrapper initialized with defaults. Read more
Source§

fn raw_ref(src: &Self::Inner) -> &Self

Creates wrapper reference from value.
Source§

fn raw_mut(src: &mut Self::Inner) -> &mut Self

Creates mutable wrapper reference from value.
Source§

fn clone_raw(src: &Self::Inner) -> Self

Creates wrapper by cloning value from src. Read more
Source§

fn take_raw(src: &mut Self::Inner) -> Self

Creates wrapper by moving value from src. Read more
Source§

fn clone_into_raw(&self, dst: &mut Self::Inner)

Clones value into dst. Read more
Source§

fn move_into_raw(self, dst: &mut Self::Inner)

Moves value into dst, giving up ownership. Read more
Source§

fn leak_into_raw(self) -> *mut Self::Inner

Leaks wrapped value onto the heap. Read more
Source§

unsafe fn to_raw_copy(this: &Self) -> Self::Inner

Creates copy without giving up ownership. Read more
Source§

unsafe fn as_ref(&self) -> &Self::Inner

Returns shared reference to value. Read more
Source§

unsafe fn as_mut(&mut self) -> &mut Self::Inner

Returns exclusive reference to value. Read more
Source§

unsafe fn as_ptr(&self) -> *const Self::Inner

Returns const pointer to value. Read more
Source§

unsafe fn as_mut_ptr(&mut self) -> *mut Self::Inner

Returns mutable pointer to value. Read more
Source§

fn print(this: &Self) -> Option<String>

Prints value to string. Read more
Source§

fn order(this: &Self, other: &Self) -> UA_Order

Compares value to other. Read more
Source§

impl Debug for ExpandedNodeId

Source§

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

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

impl Display for ExpandedNodeId

Source§

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

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

impl Drop for ExpandedNodeId

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more
Source§

impl Eq for ExpandedNodeId

Source§

impl From<NodeId> for ExpandedNodeId

Source§

fn from(node_id: NodeId) -> Self

Converts to this type from the input type.
Source§

impl FromStr for ExpandedNodeId

Source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses expanded node ID from string.

§Examples
use open62541::ua;

// Valid expanded node IDs can be parsed.
let node_xid: ua::ExpandedNodeId = "nsu=urn:example.com:my-server;s=myVariable".parse().expect("should be valid expanded node ID");

assert_eq!(node_xid.to_string(), "nsu=urn:example.com:my-server;s=myVariable");

// Parsing expanded node IDs can fail.
"LoremIpsum".parse::<ua::ExpandedNodeId>().expect_err("should be invalid expanded node ID");
Source§

type Err = Error

The associated error which can be returned from parsing.
Source§

impl Ord for ExpandedNodeId

Source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
Source§

fn clamp_to<R>(self, range: R) -> Self
where Self: Sized, R: ClampBounds<Self>,

🔬This is a nightly-only experimental API. (clamp_to)
Restrict a value to a certain range. Read more
Source§

impl PartialEq for ExpandedNodeId

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 PartialOrd for ExpandedNodeId

Source§

fn partial_cmp(&self, other: &Self) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · Source§

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

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 (const: unstable) · Source§

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

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl Send for ExpandedNodeId

Source§

impl Sync for ExpandedNodeId

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> DataTypeExt for T
where T: DataType,

Source§

type Inner = T

Inner type sent over the wire.
Source§

fn from_inner(value: <T as DataTypeExt>::Inner) -> Result<T, Error>

Creates instance for inner type. Read more
Source§

fn into_inner(self) -> <T as DataTypeExt>::Inner

Returns inner type representation.
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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. 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.