Skip to main content

TypeObjectBuilder

Struct TypeObjectBuilder 

Source
pub struct TypeObjectBuilder;
Expand description

Einstiegspunkt.

Implementations§

Source§

impl TypeObjectBuilder

Source

pub fn struct_type(name: impl Into<String>) -> StructBuilder

Starts a struct builder with the given qualified name (e.g. “::sensors::Chatter”).

Source

pub fn enum_type(name: impl Into<String>) -> EnumBuilder

Starts an enum builder.

Source

pub fn alias(name: impl Into<String>, target: TypeIdentifier) -> AliasBuilder

Starts an alias builder.

Source§

impl TypeObjectBuilder

Source

pub fn union_type( name: impl Into<String>, discriminator_type: TypeIdentifier, ) -> UnionBuilder

Starts a union builder. discriminator_type is typically an enum or an integer primitive.

Source

pub fn sequence(element: TypeIdentifier, bound: u32) -> SequenceBuilder

Starts a sequence builder. bound=0 = unbounded.

Source

pub fn array(element: TypeIdentifier, dimensions: Vec<u32>) -> ArrayBuilder

Starts an array builder with the given list of dimensions.

Source

pub fn map(key: TypeIdentifier, value: TypeIdentifier, bound: u32) -> MapBuilder

Starts a map builder.

Source

pub fn bitmask(name: impl Into<String>) -> BitmaskBuilder

Starts a bitmask builder.

Source

pub fn bitset(name: impl Into<String>) -> BitsetBuilder

Starts a bitset builder.

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