pub trait BinaryEncoder<T> {
    fn byte_len(&self) -> usize;
    fn encode<S>(&self, stream: &mut S) -> Result<usize, StatusCode>
    where
        S: Write
; fn decode<S>(
        stream: &mut S,
        decoding_options: &DecodingOptions
    ) -> Result<T, StatusCode>
    where
        S: Read
; fn encode_to_vec(&self) -> Vec<u8, Global>Notable traits for Vec<u8, A>impl<A> Write for Vec<u8, A> where
    A: Allocator
{ ... } }
Expand description

OPC UA Binary Encoding interface. Anything that encodes to binary must implement this. It provides functions to calculate the size in bytes of the struct (for allocating memory), encoding to a stream and decoding from a stream.

Required methods

Returns the exact byte length of the structure as it would be if encode were called. This may be called prior to writing to ensure the correct amount of space is available.

Encodes the instance to the write stream.

Decodes an instance from the read stream. The decoding options contains restrictions set by the server / client on the length of strings, arrays etc. If these limits are exceeded the implementation should return with a BadDecodingError as soon as possible.

Provided methods

Implementations on Foreign Types

An unsigned integer value between 0 and 18446744073709551615.

A signed integer value between −2147483648 and 2147483647.

An IEEE double precision (64 bit) floating point value.

An unsigned byt integer value between 0 and 255.

An unsigned integer value between 0 and 65535.

An unsigned integer value between 0 and 4294967295.

A signed integer value between −32768 and 32767.

An IEEE single precision (32 bit) floating point value.

A signed integer value between −9223372036854775808 and 9223372036854775807.

Implementors

DateTime encoded as 64-bit signed int