pub struct NodeSet2Import { /* private fields */ }Expand description
NodeSetImport implementation for dynamically loading NodeSet2 files at
runtime. Note that structures must be loaded with a type loader. By default
the type loader for the base types is registered, but if your NodeSet2 file uses custom types
you will have to add an TypeLoader using NodeSet2Import::add_type_loader.
Implementations§
Source§impl NodeSet2Import
impl NodeSet2Import
Sourcepub fn new(
preferred_locale: &str,
path: impl AsRef<Path>,
dependent_namespaces: Vec<String>,
) -> Result<Self, LoadXmlError>
pub fn new( preferred_locale: &str, path: impl AsRef<Path>, dependent_namespaces: Vec<String>, ) -> Result<Self, LoadXmlError>
Create a new NodeSet2 importer.
The dependent_namespaces array contains namespaces that this nodeset requires, in order,
but that are not included in the nodeset file itself.
It does not need to include the base namespace, but it may.
§Example
NodeSet2Import::new(
"en",
"My.ISA95.Extension.NodeSet2.xml",
// Since we depend on ISA95, we need to include the ISA95 namespace.
// Typically, the NodeSet will reference ns=1 as ISA95, and ns=2 as its own
// namespace, this will allow us to interpret ns=1 correctly. Without this,
// we would panic when failing to look up ns=2.
vec!["http://www.OPCFoundation.org/UA/2013/01/ISA95"]
)Sourcepub fn new_str(
preferred_locale: &str,
nodeset: &str,
dependent_namespaces: Vec<String>,
) -> Result<Self, LoadXmlError>
pub fn new_str( preferred_locale: &str, nodeset: &str, dependent_namespaces: Vec<String>, ) -> Result<Self, LoadXmlError>
Create a new NodeSet2 importer from an already loaded NodeSet2.xml file.
See documentation of NodeSet2Import::new.
Sourcepub fn new_nodeset(
preferred_locale: &str,
nodeset: UANodeSet,
dependent_namespaces: Vec<String>,
) -> Self
pub fn new_nodeset( preferred_locale: &str, nodeset: UANodeSet, dependent_namespaces: Vec<String>, ) -> Self
Create a new importer with a pre-loaded nodeset.
The dependent_namespaces array contains namespaces that this nodeset requires, in order,
but that are not included in the nodeset file itself.
It does not need to include the base namespace, but it may.
Sourcepub fn add_type_loader(&mut self, loader: Arc<dyn TypeLoader>)
pub fn add_type_loader(&mut self, loader: Arc<dyn TypeLoader>)
Add a type loader for importing types from XML.
Any custom variable Value must be supported by one of the added type loaders in order for the node set import to work.
Trait Implementations§
Source§impl NodeSetImport for NodeSet2Import
impl NodeSetImport for NodeSet2Import
Source§fn register_namespaces(&self, namespaces: &mut NodeSetNamespaceMapper<'_>)
fn register_namespaces(&self, namespaces: &mut NodeSetNamespaceMapper<'_>)
Source§fn get_own_namespaces(&self) -> Vec<String>
fn get_own_namespaces(&self) -> Vec<String>
register_namespaces