pub trait SimpleBinaryEncodable {
// Required methods
fn byte_len(&self) -> usize;
fn encode<S: Write + ?Sized>(&self, stream: &mut S) -> EncodingResult<()>;
// Provided method
fn encode_to_vec(&self) -> Vec<u8> ⓘ { ... }
}Expand description
Trait for encoding a type that cannot contain any custom types to OPC UA binary. Used in some core modules to encode raw binary messages.
Required Methods§
Provided Methods§
Sourcefn encode_to_vec(&self) -> Vec<u8> ⓘ
fn encode_to_vec(&self) -> Vec<u8> ⓘ
Convenience method for encoding a message straight into an array of bytes. It is preferable to reuse buffers than to call this so it should be reserved for tests and trivial code.
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.
Implementations on Foreign Types§
Source§impl SimpleBinaryEncodable for bool
impl SimpleBinaryEncodable for bool
Source§impl SimpleBinaryEncodable for f32
An IEEE single precision (32 bit) floating point value.
impl SimpleBinaryEncodable for f32
An IEEE single precision (32 bit) floating point value.
Source§impl SimpleBinaryEncodable for f64
An IEEE double precision (64 bit) floating point value.
impl SimpleBinaryEncodable for f64
An IEEE double precision (64 bit) floating point value.
Source§impl SimpleBinaryEncodable for i8
impl SimpleBinaryEncodable for i8
Source§impl SimpleBinaryEncodable for i16
A signed integer value between −32768 and 32767.
impl SimpleBinaryEncodable for i16
A signed integer value between −32768 and 32767.
Source§impl SimpleBinaryEncodable for i32
A signed integer value between −2147483648 and 2147483647.
impl SimpleBinaryEncodable for i32
A signed integer value between −2147483648 and 2147483647.
Source§impl SimpleBinaryEncodable for i64
A signed integer value between −9223372036854775808 and 9223372036854775807.
impl SimpleBinaryEncodable for i64
A signed integer value between −9223372036854775808 and 9223372036854775807.
Source§impl SimpleBinaryEncodable for u8
An unsigned byt integer value between 0 and 255.
impl SimpleBinaryEncodable for u8
An unsigned byt integer value between 0 and 255.
Source§impl SimpleBinaryEncodable for u16
An unsigned integer value between 0 and 65535.
impl SimpleBinaryEncodable for u16
An unsigned integer value between 0 and 65535.
Source§impl SimpleBinaryEncodable for u32
An unsigned integer value between 0 and 4294967295.
impl SimpleBinaryEncodable for u32
An unsigned integer value between 0 and 4294967295.
Source§impl SimpleBinaryEncodable for u64
An unsigned integer value between 0 and 18446744073709551615.
impl SimpleBinaryEncodable for u64
An unsigned integer value between 0 and 18446744073709551615.