Skip to main content

CodeSetContext

Struct CodeSetContext 

Source
pub struct CodeSetContext {
    pub char_data: u32,
    pub wchar_data: u32,
}
Expand description

CONV_FRAME::CodeSetContext — selected transmission codesets.

Fields§

§char_data: u32

char_data — transmission codeset for char/string (TCSC).

§wchar_data: u32

wchar_data — transmission codeset for wchar/wstring (TCSW).

Implementations§

Source§

impl CodeSetContext

Source

pub const fn new(char_data: u32, wchar_data: u32) -> Self

Constructor.

Source

pub const fn default_pair() -> Self

ZeroDDS default pair: UTF-8 (char) + UTF-16 (wchar).

Source

pub fn encode_encapsulation( &self, endianness: Endianness, ) -> GiopResult<Vec<u8>>

Encodes the body as a CDR encapsulation (byte-order octet + two unsigned long). With standard CDR alignment relative to the start of the encapsulation, char_data sits at offset 4 and wchar_data at offset 8.

§Errors

Buffer write error.

Source

pub fn decode_encapsulation(encap: &[u8]) -> GiopResult<Self>

Decodes a CodeSetContext encapsulation (byte-order octet + body).

§Errors

Truncated/invalid endianness or buffer read error.

Source

pub fn to_service_context( &self, endianness: Endianness, ) -> GiopResult<ServiceContext>

Builds the GIOP ServiceContext (context_id = IOP::CodeSets = 1).

§Errors

Encapsulation write error.

Source

pub fn from_service_context_list( list: &ServiceContextList, ) -> GiopResult<Option<Self>>

Looks up the CodeSets entry in a ServiceContextList and decodes it. Returns Ok(None) if no codeset context is present.

§Errors

Decode error if the entry exists but is corrupt.

Trait Implementations§

Source§

impl Clone for CodeSetContext

Source§

fn clone(&self) -> CodeSetContext

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 Copy for CodeSetContext

Source§

impl Debug for CodeSetContext

Source§

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

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

impl Default for CodeSetContext

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl Eq for CodeSetContext

Source§

impl PartialEq for CodeSetContext

Source§

fn eq(&self, other: &CodeSetContext) -> 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 CodeSetContext

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.