Struct Browser

Source
pub struct Browser<'a, T, R> { /* private fields */ }
Expand description

A utility for recursively discovering nodes on an OPC-UA server.

Implementations§

Source§

impl<'a, T: BrowserPolicy + 'a, R: RequestRetryPolicy + Clone + 'a> Browser<'a, T, R>

Source

pub fn run( self, initial: Vec<BrowseDescription>, ) -> impl Stream<Item = Result<BrowseResultItem, Error>> + 'a

Start the browser, returning a stream of results.

To stop browsing you can simply stop polling this stream.

Source

pub async fn run_into_result( self, initial: Vec<BrowseDescription>, ) -> Result<BrowserResult, Error>

Run the browser, collecting the results into a BrowserResult struct.

Source§

impl<'a, T, R> Browser<'a, T, R>

Source

pub fn new(session: &'a Session, handler: T, retry_policy: R) -> Self

Create a new browser with the given handler and retry policy.

Source

pub fn handler<T2: BrowserPolicy + 'a>( self, new_handler: T2, ) -> Browser<'a, T2, R>

Set a new browser policy. This is used to generate new browses after each visited node. Note that no matter what, a node will only be browsed once in each direction. (Or once in both at the same time).

Source

pub fn retry_policy<R2: RequestRetryPolicy + Clone + 'a>( self, new_retry_policy: R2, ) -> Browser<'a, T, R2>

Set a new request retry policy.

Source

pub fn token(self, token: CancellationToken) -> Self

Set a new cancellation token. Once this is cancelled, the browser will try to shut down gracefully, which means waiting for any pending requests and then releasing continuation points.

If you don’t care about that (for example if you are shutting down the session soon), then you can just stop polling to the stream.

Source

pub fn max_nodes_per_request(self, max_nodes_per_request: usize) -> Self

Set the maximum number of nodes per request sent to the server.

Note that the browser makes no guarantee that all requests sent will be as large as possible.

Source

pub fn max_references_per_node(self, max_references_per_node: u32) -> Self

Set the maximum number of references requested per node. Can be 0 to let the server decide.

Source

pub fn max_concurrent_requests(self, max_concurrent_requests: usize) -> Self

Set the maximum number of concurrent requests. Defaults to 1.

Source

pub fn max_continuation_point_retries( self, max_continuation_point_retries: usize, ) -> Self

Set the maximum number of times a browse will be retried if the continuation point becomes invalid while the browser is running.

This will start the browse process over from zero for the affected node, meaning that the same references will be returned multiple times.

Source

pub fn config(self, config: BrowserConfig) -> Self

Set the browse configuration.

Auto Trait Implementations§

§

impl<'a, T, R> Freeze for Browser<'a, T, R>
where T: Freeze, R: Freeze,

§

impl<'a, T, R> !RefUnwindSafe for Browser<'a, T, R>

§

impl<'a, T, R> Send for Browser<'a, T, R>
where T: Send, R: Send,

§

impl<'a, T, R> Sync for Browser<'a, T, R>
where T: Sync, R: Sync,

§

impl<'a, T, R> Unpin for Browser<'a, T, R>
where T: Unpin, R: Unpin,

§

impl<'a, T, R> !UnwindSafe for Browser<'a, T, R>

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> MaybeSendSync for T