pub struct DynamicTypeBuilderFactory;Expand description
XTypes §7.5.5 DynamicTypeBuilderFactory — Singleton im Spec-Sinne.
Stateless: no global caches except the primitive singleton pool,
which is lazily initialized via OnceLock.
Implementations§
Source§impl DynamicTypeBuilderFactory
impl DynamicTypeBuilderFactory
Sourcepub fn create_type_w_type_object(
type_obj: &TypeObject,
) -> Result<DynamicTypeBuilder, DynamicError>
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:
CompleteStructTypewith primitive + string members.MinimalStructTypeas read-only with hash names.- Other kinds:
Unsupported.
§Errors
Unsupported for kinds outside the current implementation scope.
Source§impl DynamicTypeBuilderFactory
impl DynamicTypeBuilderFactory
Sourcepub fn create_type(
descriptor: TypeDescriptor,
) -> Result<DynamicTypeBuilder, DynamicError>
pub fn create_type( descriptor: TypeDescriptor, ) -> Result<DynamicTypeBuilder, DynamicError>
Sourcepub fn create_struct(name: impl Into<String>) -> DynamicTypeBuilder
pub fn create_struct(name: impl Into<String>) -> DynamicTypeBuilder
Convenience variant: creates a struct builder directly.
Sourcepub fn create_union(
name: impl Into<String>,
discriminator: TypeDescriptor,
) -> Result<DynamicTypeBuilder, DynamicError>
pub fn create_union( name: impl Into<String>, discriminator: TypeDescriptor, ) -> Result<DynamicTypeBuilder, DynamicError>
Convenience variant: creates a union builder directly with the given discriminator type.
§Errors
Inconsistent if the discriminator is not permitted.
Sourcepub fn get_primitive_type(kind: TypeKind) -> Result<DynamicType, DynamicError>
pub fn get_primitive_type(kind: TypeKind) -> Result<DynamicType, DynamicError>
Spec §7.5.5.1.2 get_primitive_type(kind) — Singleton-Cache.
Repeated calls with the same kind return the same
DynamicType instance (same Arc pointer).
§Errors
IllegalOperation if kind is not a primitive.
Sourcepub fn create_string_type(bound: u32) -> DynamicType
pub fn create_string_type(bound: u32) -> DynamicType
Spec §7.5.5.1.3 create_string_type(bound) — bounded string<N>.
Sourcepub fn create_wstring_type(bound: u32) -> DynamicType
pub fn create_wstring_type(bound: u32) -> DynamicType
Spec §7.5.5.1.4 create_wstring_type(bound).