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_limits: &DecodingLimits
    ) -> Result<T, StatusCode>
    where
        S: Read
; fn to_vec(&self) -> Vec<u8, Global> { ... } }
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 byte length of the structure. This calculation should be exact and as efficient as possible.

Encodes the instance to the write stream.

Decodes an instance from the read stream. The decoding limits are 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 byt integer value between 0 and 255.

A signed integer value between −2147483648 and 2147483647.

An unsigned integer value between 0 and 65535.

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

An unsigned integer value between 0 and 4294967295.

A signed integer value between −32768 and 32767.

A signed integer value between −9223372036854775808 and 9223372036854775807.

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

An unsigned integer value between 0 and 18446744073709551615.

Implementors§

DateTime encoded as 64-bit signed int