pub enum TypeCode {
Show 24 variants
Null,
Void,
Short,
Long,
UShort,
ULong,
LongLong,
ULongLong,
Float,
Double,
Boolean,
Char,
Octet,
WChar,
Any,
TypeCodeTc,
String(u32),
WString(u32),
Sequence {
element: Box<TypeCode>,
bound: u32,
},
Struct {
repo_id: String,
name: String,
members: Vec<(String, TypeCode)>,
is_except: bool,
},
Enum {
repo_id: String,
name: String,
members: Vec<String>,
},
Alias {
repo_id: String,
name: String,
content: Box<TypeCode>,
},
ObjRef {
repo_id: String,
name: String,
},
Recursive {
repo_id: String,
},
}Expand description
CORBA TypeCode (subset: all scalar kinds + string/wstring + sequence +
struct + enum + alias + objref — the common structured any contents).
Variants§
Null
tk_null.
Void
tk_void.
Short
tk_short.
Long
tk_long.
UShort
tk_ushort.
ULong
tk_ulong.
LongLong
tk_longlong.
ULongLong
tk_ulonglong.
Float
tk_float.
Double
tk_double.
Boolean
tk_boolean.
Char
tk_char.
Octet
tk_octet.
WChar
tk_wchar.
Any
tk_any.
TypeCodeTc
tk_TypeCode.
String(u32)
tk_string with bound (0 = unbounded).
WString(u32)
tk_wstring with bound.
Sequence
tk_sequence: element type + bound.
Struct
tk_struct (and tk_except): RepositoryId, name, ordered members.
Fields
Enum
tk_enum: RepositoryId, name, enumerator names (index = value).
Alias
tk_alias (typedef): RepositoryId, name, resolved content.
Fields
ObjRef
tk_objref: interface RepositoryId + name.
Recursive
Recursive reference (§15.3.5.1 indirection): points via repo_id to an
enclosing TypeCode that is still being decoded (e.g.
struct Node { sequence<Node> kids; }). Decode-only marker — breaks the
otherwise infinite type graph.
Implementations§
Source§impl TypeCode
impl TypeCode
Sourcepub fn encode(&self, w: &mut BufferWriter) -> Result<(), EncodeError>
pub fn encode(&self, w: &mut BufferWriter) -> Result<(), EncodeError>
Sourcepub fn decode(r: &mut BufferReader<'_>) -> Result<Self, DecodeError>
pub fn decode(r: &mut BufferReader<'_>) -> Result<Self, DecodeError>
Decodes a TypeCode (§15.3.5) including indirection (§15.3.5.1):
recursive and repeated TypeCodes (0xffffffff + negative offset)
are resolved — repeated ones cloned via a position cache, recursive
ones as a TypeCode::Recursive marker.
§Errors
InvalidEnum on an unknown TCKind / unresolvable indirection;
buffer read error.