pub trait CdrEncode {
const IS_PRIMITIVE: bool = false;
// Required method
fn encode(&self, writer: &mut BufferWriter) -> Result<(), EncodeError>;
}Expand description
Value can be encoded into a BufferWriter.
Provided Associated Constants§
Sourceconst IS_PRIMITIVE: bool = false
const IS_PRIMITIVE: bool = false
XCDR2 primitive classification (OMG XTypes 1.3 §7.4.3.5): true
only for primitives (bool, octet, int8/16/32/64, uint8/16/32/64,
float, double, char/wchar). false for aggregate/variable
types (string, struct, union, enum, sequence, array, map).
Controls DHEADER prepending for sequence<T>/T[N]:
collections with NON-primitive elements need a DHEADER (uint32 =
byte length of the following content) under XCDR2.
Required Methods§
Sourcefn encode(&self, writer: &mut BufferWriter) -> Result<(), EncodeError>
fn encode(&self, writer: &mut BufferWriter) -> Result<(), EncodeError>
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".
Implementations on Foreign Types§
Source§impl CdrEncode for String
impl CdrEncode for String
fn encode(&self, writer: &mut BufferWriter) -> Result<(), EncodeError>
Source§impl CdrEncode for bool
Available on crate feature alloc only.
impl CdrEncode for bool
Available on crate feature
alloc only.const IS_PRIMITIVE: bool = true
fn encode(&self, writer: &mut BufferWriter) -> Result<(), EncodeError>
Source§impl CdrEncode for char
Available on crate feature alloc only.
impl CdrEncode for char
Available on crate feature
alloc only.const IS_PRIMITIVE: bool = true
fn encode(&self, writer: &mut BufferWriter) -> Result<(), EncodeError>
Source§impl CdrEncode for f32
Available on crate feature alloc only.
impl CdrEncode for f32
Available on crate feature
alloc only.const IS_PRIMITIVE: bool = true
fn encode(&self, writer: &mut BufferWriter) -> Result<(), EncodeError>
Source§impl CdrEncode for f64
Available on crate feature alloc only.
impl CdrEncode for f64
Available on crate feature
alloc only.const IS_PRIMITIVE: bool = true
fn encode(&self, writer: &mut BufferWriter) -> Result<(), EncodeError>
Source§impl CdrEncode for i8
Available on crate feature alloc only.
impl CdrEncode for i8
Available on crate feature
alloc only.const IS_PRIMITIVE: bool = true
fn encode(&self, writer: &mut BufferWriter) -> Result<(), EncodeError>
Source§impl CdrEncode for i16
Available on crate feature alloc only.
impl CdrEncode for i16
Available on crate feature
alloc only.const IS_PRIMITIVE: bool = true
fn encode(&self, writer: &mut BufferWriter) -> Result<(), EncodeError>
Source§impl CdrEncode for i32
Available on crate feature alloc only.
impl CdrEncode for i32
Available on crate feature
alloc only.const IS_PRIMITIVE: bool = true
fn encode(&self, writer: &mut BufferWriter) -> Result<(), EncodeError>
Source§impl CdrEncode for i64
Available on crate feature alloc only.
impl CdrEncode for i64
Available on crate feature
alloc only.const IS_PRIMITIVE: bool = true
fn encode(&self, writer: &mut BufferWriter) -> Result<(), EncodeError>
Source§impl CdrEncode for str
impl CdrEncode for str
fn encode(&self, writer: &mut BufferWriter) -> Result<(), EncodeError>
Source§impl CdrEncode for u8
Available on crate feature alloc only.
impl CdrEncode for u8
Available on crate feature
alloc only.const IS_PRIMITIVE: bool = true
fn encode(&self, writer: &mut BufferWriter) -> Result<(), EncodeError>
Source§impl CdrEncode for u16
Available on crate feature alloc only.
impl CdrEncode for u16
Available on crate feature
alloc only.const IS_PRIMITIVE: bool = true
fn encode(&self, writer: &mut BufferWriter) -> Result<(), EncodeError>
Source§impl CdrEncode for u32
Available on crate feature alloc only.
impl CdrEncode for u32
Available on crate feature
alloc only.const IS_PRIMITIVE: bool = true
fn encode(&self, writer: &mut BufferWriter) -> Result<(), EncodeError>
Source§impl CdrEncode for u64
Available on crate feature alloc only.
impl CdrEncode for u64
Available on crate feature
alloc only.