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.
Sourcepub fn create_type_w_type_object_in(
type_obj: &TypeObject,
registry: &TypeRegistry,
) -> Result<DynamicType, DynamicError>
pub fn create_type_w_type_object_in( type_obj: &TypeObject, registry: &TypeRegistry, ) -> Result<DynamicType, DynamicError>
Registry-aware create_type_w_type_object (XTypes §7.6.4 with a
TypeLookupService). Unlike the bare overload, composite member types
referenced by EquivalenceHash are resolved recursively against
registry, so a struct/union with nested struct/union/enum/bitmask/
bitset MEMBERS yields a fully-populated DynamicType (members carry
their own members). Covers all 10 top-level Complete kinds.
Residual (honest Unsupported, not silent): a COLLECTION whose element
is itself a composite keeps a shallow element descriptor — the
TypeDescriptor::element_type model holds a descriptor, not a full
DynamicType, so sequence<NestedStruct> cannot yet carry the nested
members (needs a model change); likewise Minimal TypeObjects and
alias-to-composite targets.
§Errors
Unsupported for the residual cases above and unresolvable hashes.
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).