pub struct ZigType {
pub tree: Type,
pub enum_like: bool,
pub integer_alias: bool,
}Expand description
A Zig type, with the two properties CodecTarget::cast needs and
the tree cannot carry: whether the type is an enumeration once
typedefs are seen through, which decides @enumFromInt against
@intCast, and whether a named type is an integer alias, which
decides @intCast against a bare @as.
Fields§
§tree: TypeThe type as written.
enum_like: boolWhether a cast into it converts from an integer with
@enumFromInt.
integer_alias: boolWhether the type names an integer under its own name — a
bitmask, whose Zig form is pub const Flags = u8;. The tree
says Named("Flags") and @as(Flags, zd_bits) on the walk’s
sixty-four-bit holder is expected type 'u8', found 'u64';
the narrowing has to be stated.
Trait Implementations§
impl Eq for ZigType
impl StructuralPartialEq for ZigType
Auto Trait Implementations§
impl Freeze for ZigType
impl RefUnwindSafe for ZigType
impl Send for ZigType
impl Sync for ZigType
impl Unpin for ZigType
impl UnsafeUnpin for ZigType
impl UnwindSafe for ZigType
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more