Trait opcua_server::prelude::BinaryEncoder [−][src]
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 encode_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 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.
fn decode<S>(
stream: &mut S,
decoding_limits: &DecodingLimits
) -> Result<T, StatusCode> where
S: Read,
fn decode<S>(
stream: &mut S,
decoding_limits: &DecodingLimits
) -> Result<T, StatusCode> where
S: Read,
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
fn encode_to_vec(&self) -> Vec<u8, Global>
Implementations on Foreign Types
An unsigned integer value between 0 and 18446744073709551615.
An unsigned integer value between 0 and 4294967295.
A signed integer value between −32768 and 32767.
An unsigned byt integer value between 0 and 255.
An unsigned integer value between 0 and 65535.
A signed integer value between −9223372036854775808 and 9223372036854775807.
An IEEE single precision (32 bit) floating point value.
A signed integer value between −2147483648 and 2147483647.
An IEEE double precision (64 bit) floating point value.