Skip to main content

Module builder

Module builder 

Source
Expand description

Programmatic builder for TypeObjects.

Enables readable code like:

use zerodds_types::builder::{Extensibility, TypeObjectBuilder};
use zerodds_types::{PrimitiveKind, TypeIdentifier};

let chatter = TypeObjectBuilder::struct_type("::chat::Chatter")
    .extensibility(Extensibility::Appendable)
    .member(
        "msg_id",
        TypeIdentifier::Primitive(PrimitiveKind::Int64),
        |m| m.key(),
    )
    .member(
        "text",
        TypeIdentifier::String8Small { bound: 255 },
        |m| m,
    )
    .build_complete();

Scope in T5: StructBuilder, EnumBuilder, AliasBuilder — the three most frequently used top-level types. Union, collections, bitmask, bitset, annotation follow on demand.

Structs§

AliasBuilder
Builder for alias/typedef.
ArrayBuilder
Builder for T[D1, D2, ...].
BitmaskBuilder
Builder for bitmask types.
BitsetBuilder
Builder for bitset types.
EnumBuilder
Builder for enumerated types.
MapBuilder
Builder for map<K, V, N>.
SequenceBuilder
Builder for sequence<T, N>.
StructBuilder
Builder for struct types.
StructMemberBuilder
Fluent builder for member attributes.
StructMemberSpec
Inner state of a struct member — set via StructMemberBuilder.
TypeObjectBuilder
Einstiegspunkt.
UnionBuilder
Builder for union types.

Enums§

BuilderError
Validation error when building collection types.
Extensibility
Extensibility kind (§7.2.2.4). Simpler representation than the flag bits: exactly one of three values.