pub struct DataTypeTreeBuilder<T> { /* private fields */ }
Expand description
Utility for constructing a DataTypeTree instance by browsing the server type hierarchy.
§Example
ⓘ
// Set a filter restrict which nodes to include in the
// data type tree.
use std::sync::Arc;
use opcua::types::custom::DynamicTypeLoader;
use opcua::client::custom_types::DataTypeTreeBuilder;
// Note that this must include any data type that your custom types depend on,
// including built-in types.
let type_tree = DataTypeTreeBuilder::new(|node_id| node_id.namespace <= 2)
.build(&session)
.await?;
session.add_type_loader(Arc::new(DynamicTypeLoader::new(Arc::new(type_tree))));
// You will also need to load the namespace map.
Implementations§
Source§impl<T: FnMut(&NodeId) -> bool> DataTypeTreeBuilder<T>
impl<T: FnMut(&NodeId) -> bool> DataTypeTreeBuilder<T>
Sourcepub fn new(filter: T) -> Self
pub fn new(filter: T) -> Self
Create a new data type tree builder with the given filter method.
Sourcepub fn token(self, token: CancellationToken) -> Self
pub fn token(self, token: CancellationToken) -> Self
Set a new cancellation token for the internal browser.
Sourcepub fn config(self, config: BrowserConfig) -> Self
pub fn config(self, config: BrowserConfig) -> Self
Set the configuration for the internal browser.
Sourcepub fn values_per_read(self, values_per_read: usize) -> Self
pub fn values_per_read(self, values_per_read: usize) -> Self
Set the maximum number of values per Read request.
Auto Trait Implementations§
impl<T> Freeze for DataTypeTreeBuilder<T>where
T: Freeze,
impl<T> RefUnwindSafe for DataTypeTreeBuilder<T>where
T: RefUnwindSafe,
impl<T> Send for DataTypeTreeBuilder<T>where
T: Send,
impl<T> Sync for DataTypeTreeBuilder<T>where
T: Sync,
impl<T> Unpin for DataTypeTreeBuilder<T>where
T: Unpin,
impl<T> UnwindSafe for DataTypeTreeBuilder<T>where
T: UnwindSafe,
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