pub struct NamespaceMap { /* private fields */ }Expand description
Utility for handling assignment of namespaces on server startup.
Implementations§
Source§impl NamespaceMap
impl NamespaceMap
Sourcepub fn new_full(map: HashMap<String, u16>) -> Self
pub fn new_full(map: HashMap<String, u16>) -> Self
Create a new namespace map from the given list of namespaces.
Sourcepub fn new_from_variant_array(array: &[Variant]) -> Result<Self, OpcUaError>
pub fn new_from_variant_array(array: &[Variant]) -> Result<Self, OpcUaError>
Create a new namespace map from a vec of variant as we get when reading the namespace array from the server
Sourcepub fn add_namespace(&mut self, namespace: &str) -> u16
pub fn add_namespace(&mut self, namespace: &str) -> u16
Add a new namespace, returning its index in the namespace map. If the namespace is already added, its old index is returned.
Sourcepub fn known_namespaces(&self) -> &HashMap<String, u16>
pub fn known_namespaces(&self) -> &HashMap<String, u16>
Return the inner namespace map.
Sourcepub fn resolve_node_id<'b>(
&self,
id: &'b ExpandedNodeId,
) -> Option<Cow<'b, NodeId>>
pub fn resolve_node_id<'b>( &self, id: &'b ExpandedNodeId, ) -> Option<Cow<'b, NodeId>>
Try to resolve an expanded node ID to a NodeId.
Trait Implementations§
Source§impl Clone for NamespaceMap
impl Clone for NamespaceMap
Source§fn clone(&self) -> NamespaceMap
fn clone(&self) -> NamespaceMap
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for NamespaceMap
impl Debug for NamespaceMap
Source§impl Default for NamespaceMap
impl Default for NamespaceMap
Source§fn default() -> NamespaceMap
fn default() -> NamespaceMap
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for NamespaceMap
impl RefUnwindSafe for NamespaceMap
impl Send for NamespaceMap
impl Sync for NamespaceMap
impl Unpin for NamespaceMap
impl UnwindSafe for NamespaceMap
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