Skip to main content

TypeCode

Enum TypeCode 

Source
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.

Fields

§element: Box<TypeCode>

Element TypeCode.

§bound: u32

Bound (0 = unbounded).

§

Struct

tk_struct (and tk_except): RepositoryId, name, ordered members.

Fields

§repo_id: String

IDL:…:1.0.

§name: String

Struct name.

§members: Vec<(String, TypeCode)>

(member_name, member_type) in declaration order.

§is_except: bool

truetk_except instead of tk_struct (same wire form).

§

Enum

tk_enum: RepositoryId, name, enumerator names (index = value).

Fields

§repo_id: String

IDL:…:1.0.

§name: String

Enum name.

§members: Vec<String>

Enumerator names.

§

Alias

tk_alias (typedef): RepositoryId, name, resolved content.

Fields

§repo_id: String

IDL:…:1.0.

§name: String

Alias name.

§content: Box<TypeCode>

Resolved content TypeCode.

§

ObjRef

tk_objref: interface RepositoryId + name.

Fields

§repo_id: String

IDL:…:1.0.

§name: String

Interface 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.

Fields

§repo_id: String

RepositoryId of the recursively referenced type.

Implementations§

Source§

impl TypeCode

Source

pub const fn tckind(&self) -> u32

The TCKind wire value.

Source

pub fn encode(&self, w: &mut BufferWriter) -> Result<(), EncodeError>

Encodes the TypeCode (§15.3.5) into the buffer.

§Errors

Buffer write error or length overflow.

Source

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.

Trait Implementations§

Source§

impl Clone for TypeCode

Source§

fn clone(&self) -> TypeCode

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for TypeCode

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for TypeCode

Source§

impl PartialEq for TypeCode

Source§

fn eq(&self, other: &TypeCode) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for TypeCode

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.