pub struct WString(pub String);Expand description
IDL wstring wrapper. Holds the text as a Rust String (Unicode), but the
wire format differs from string: GIOP 1.2 encodes a wstring as a
uint32 length in octets (NOT characters, NOT incl. terminator)
followed by the UTF-16 code units in the message byte order — without a
null terminator. This makes wstring distinct from string (UTF-8) and
interop-capable with ORBs whose transmission codeset is UTF-16 (the default
for omniORB/TAO/JacORB).
Tuple Fields§
§0: StringImplementations§
Source§impl WString
impl WString
Sourcepub fn encode_with_bom(
&self,
writer: &mut BufferWriter,
with_bom: bool,
) -> Result<(), EncodeError>
pub fn encode_with_bom( &self, writer: &mut BufferWriter, with_bom: bool, ) -> Result<(), EncodeError>
Encodes the GIOP 1.2 wstring with an explicit BOM choice,
bypassing the global corba_wstring_bom policy. with_bom = true
= omniORB/TAO form (a 0xFEFF byte-order mark prepended, counted in
the octet length); false = JacORB form (no BOM, units in message
byte order). An empty wstring is length 0 either way.
§Errors
ValueOutOfRange if the octet length exceeds u32::MAX.
Trait Implementations§
Source§impl CdrDecode for WString
impl CdrDecode for WString
Source§fn decode(reader: &mut BufferReader<'_>) -> Result<Self, DecodeError>
fn decode(reader: &mut BufferReader<'_>) -> Result<Self, DecodeError>
Source§const IS_PRIMITIVE: bool = false
const IS_PRIMITIVE: bool = false
CdrEncode::IS_PRIMITIVE. Controls DHEADER reading when
decoding sequence<T>/T[N] with non-primitive T.Source§impl CdrEncode for WString
impl CdrEncode for WString
Source§fn encode(&self, writer: &mut BufferWriter) -> Result<(), EncodeError>
fn encode(&self, writer: &mut BufferWriter) -> Result<(), EncodeError>
Source§const IS_PRIMITIVE: bool = false
const IS_PRIMITIVE: bool = false
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.