pub struct TypeDef {
pub kind: TypeKind,
pub name: StringId,
pub members: Slice<TypeMember>,
/* private fields */
}Expand description
Type definition in the compiled query.
The members field has dual semantics based on kind:
- Wrappers (Optional/ArrayStar/ArrayPlus):
members.start_indexis inner TypeId - Composites (Record/Enum):
membersis slice into type_members segment
Fields§
§kind: TypeKind§name: StringIdSynthetic or explicit type name. STRING_NONE for unnamed wrappers.
members: Slice<TypeMember>See struct-level docs for dual semantics.
Implementations§
Source§impl TypeDef
impl TypeDef
Sourcepub fn wrapper(kind: TypeKind, inner: TypeId) -> Self
pub fn wrapper(kind: TypeKind, inner: TypeId) -> Self
Create a wrapper type (Optional, ArrayStar, ArrayPlus).
Sourcepub fn composite(
kind: TypeKind,
name: StringId,
members: Slice<TypeMember>,
) -> Self
pub fn composite( kind: TypeKind, name: StringId, members: Slice<TypeMember>, ) -> Self
Create a composite type (Record, Enum).
Sourcepub fn inner_type(&self) -> Option<TypeId>
pub fn inner_type(&self) -> Option<TypeId>
For wrapper types, returns the inner type ID.
Sourcepub fn members_slice(&self) -> Option<Slice<TypeMember>>
pub fn members_slice(&self) -> Option<Slice<TypeMember>>
For composite types, returns the members slice.
pub fn is_wrapper(&self) -> bool
pub fn is_composite(&self) -> bool
Trait Implementations§
Auto Trait Implementations§
impl Freeze for TypeDef
impl RefUnwindSafe for TypeDef
impl Send for TypeDef
impl Sync for TypeDef
impl Unpin for TypeDef
impl UnwindSafe for TypeDef
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
🔬This is a nightly-only experimental API. (
clone_to_uninit)