Struct Type
pub struct Type<'a> {
kind: TypeKind<'a>,
nullable: bool,
}Expand description
The type of a field.
A type has a kind and may be nullable, written as ? in IDL text. A
nullable type can’t be nullable again, so ??T can’t be built.
use varlet_idl::{Type, TypeKind};
// ?[]string
const NAMES: Type<'static> = Type::nullable(TypeKind::Array(&Type::STRING));
assert!(NAMES.is_nullable());Fields§
§kind: TypeKind<'a>§nullable: boolImplementations§
Trait Implementations§
impl<'a> Copy for Type<'a>
impl<'a> Eq for Type<'a>
impl<'a> StructuralPartialEq for Type<'a>
Auto Trait Implementations§
impl<'a> Freeze for Type<'a>
impl<'a> RefUnwindSafe for Type<'a>
impl<'a> Send for Type<'a>
impl<'a> Sync for Type<'a>
impl<'a> Unpin for Type<'a>
impl<'a> UnsafeUnpin for Type<'a>
impl<'a> UnwindSafe for Type<'a>
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