Skip to main content

FieldType

Struct FieldType 

Source
pub struct FieldType {
    pub type_id: u8,
    pub capacity: u64,
    pub string_capacity: u64,
    pub nested_type_name: String,
}
Expand description

Type information for a field

Fields§

§type_id: u8

Type ID from FieldType.msg constants

§capacity: u64

Array/sequence capacity (0 if not applicable)

§string_capacity: u64

String capacity (0 if not applicable)

§nested_type_name: String

Nested type name (empty if not a nested type)

Implementations§

Source§

impl FieldType

Source

pub fn primitive(type_id: u8) -> Self

Create a primitive field type

Source

pub fn nested(type_name: impl Into<String>) -> Self

Create a nested type field

Source

pub fn nested_sequence(type_name: impl Into<String>) -> Self

Create an unbounded sequence of nested types (Vec)

Source

pub fn array(base_type_id: u8, capacity: u64) -> Self

Create a fixed-size array field type (e.g., [T; N]) For nested types: [NestedType; N] For primitives: [primitive; N]

Source

pub fn nested_array(type_name: impl Into<String>, capacity: u64) -> Self

Create a fixed-size array of nested types

Source

pub fn sequence(base_type_id: u8) -> Self

Create an unbounded sequence (Vec) of primitives

Source

pub fn string_with_capacity(type_id: u8, string_capacity: u64) -> Self

Create a string field type with capacity

Source

pub fn bounded_string(string_capacity: u64) -> Self

Create a bounded string (string with maximum size)

Source

pub fn bounded_wstring(string_capacity: u64) -> Self

Create a bounded wstring (wide string with maximum size)

Source

pub fn bounded_sequence(base_type_id: u8, capacity: u64) -> Self

Create a bounded sequence of primitives

Source

pub fn bounded_sequence_with_string_capacity( base_type_id: u8, capacity: u64, string_capacity: u64, ) -> Self

Create a bounded sequence with string_capacity for bounded string elements Used for sequence<string, N> where M is string_capacity and N is capacity

Source

pub fn sequence_with_string_capacity( base_type_id: u8, string_capacity: u64, ) -> Self

Create an unbounded sequence with string_capacity for bounded string elements Used for sequence<string> where M is string_capacity

Source

pub fn nested_bounded_sequence( type_name: impl Into<String>, capacity: u64, ) -> Self

Create a bounded sequence of nested types

Trait Implementations§

Source§

impl Clone for FieldType

Source§

fn clone(&self) -> FieldType

Returns a duplicate of the value. Read more
1.0.0 · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for FieldType

Source§

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

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

impl<'de> Deserialize<'de> for FieldType

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for FieldType

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

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> CdrSerde for T

Source§

fn serialize(&self) -> Result<Vec<u8>, Error>

Serialize to CDR-encoded bytes with encapsulation header Read more
Source§

fn serialize_with_header( &self, header: CdrEncapsulationHeader, ) -> Result<Vec<u8>, Error>

Serialize with a specific encapsulation header
Source§

fn deserialize(bytes: &[u8]) -> Result<T, Error>

Deserialize from CDR-encoded bytes 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> Same for T

Source§

type Output = T

Should always be Self
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.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,