Skip to main content

DynamicTypeBuilderFactory

Struct DynamicTypeBuilderFactory 

Source
pub struct DynamicTypeBuilderFactory;
Expand description

XTypes §7.5.5 DynamicTypeBuilderFactory — Singleton im Spec-Sinne.

Stateless: keine globalen Caches außer dem Primitive-Singleton- Pool, der über OnceLock lazy initialisiert wird.

Implementations§

Source§

impl DynamicTypeBuilderFactory

Source

pub fn create_type_w_type_object( type_obj: &TypeObject, ) -> Result<DynamicTypeBuilder, DynamicError>

Spec §7.6.4 / §7.5.5.1.4 create_type_w_type_object(type_object).

Scope:

  • CompleteStructType mit primitiven + String-Members.
  • MinimalStructType als read-only mit Hash-Names.
  • Andere Kinds: Unsupported.
§Errors

Unsupported fuer Kinds ausserhalb des aktuellen Implementations-Scopes.

Source§

impl DynamicTypeBuilderFactory

Source

pub fn create_type( descriptor: TypeDescriptor, ) -> Result<DynamicTypeBuilder, DynamicError>

Spec §7.5.5.1.1 create_type(descriptor).

§Errors

Inconsistent wenn Descriptor invalid.

Source

pub fn create_struct(name: impl Into<String>) -> DynamicTypeBuilder

Convenience-Variante: erstellt direkt einen Struct-Builder.

Source

pub fn create_union( name: impl Into<String>, discriminator: TypeDescriptor, ) -> Result<DynamicTypeBuilder, DynamicError>

Convenience-Variante: erstellt direkt einen Union-Builder mit gegebenem Discriminator-Type.

§Errors

Inconsistent wenn der Discriminator nicht zugelassen ist.

Source

pub fn get_primitive_type(kind: TypeKind) -> Result<DynamicType, DynamicError>

Spec §7.5.5.1.2 get_primitive_type(kind) — Singleton-Cache.

Mehrfach-Aufrufe mit gleichem kind liefern dieselbe DynamicType-Instanz (gleicher Arc-Pointer).

§Errors

IllegalOperation wenn kind kein Primitive ist.

Source

pub fn create_string_type(bound: u32) -> DynamicType

Spec §7.5.5.1.3 create_string_type(bound) — bounded string<N>.

Source

pub fn create_wstring_type(bound: u32) -> DynamicType

Spec §7.5.5.1.4 create_wstring_type(bound).

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.