Struct capnp::introspect::Type
source · pub struct Type { /* private fields */ }
Expand description
A description of a Cap’n Proto type. The representation is optimized to avoid heap allocation.
To examine a Type
, you should call the which()
method.
Implementations§
source§impl Type
impl Type
sourcepub fn list_of(element_type: Type) -> Self
pub fn list_of(element_type: Type) -> Self
Constructs a new Type
that is a list wrapping some other Type
.
sourcepub fn which(&self) -> TypeVariant
pub fn which(&self) -> TypeVariant
Unfolds a single layer of the Type
, to allow for pattern matching.
sourcepub fn is_pointer_type(&self) -> bool
pub fn is_pointer_type(&self) -> bool
Is the Type
a pointer type?
Trait Implementations§
source§impl From<TypeVariant> for Type
impl From<TypeVariant> for Type
source§fn from(tv: TypeVariant) -> Type
fn from(tv: TypeVariant) -> Type
Converts to this type from the input type.
source§impl PartialEq for Type
impl PartialEq for Type
impl Copy for Type
impl Eq for Type
impl StructuralPartialEq for Type
Auto Trait Implementations§
impl Freeze for Type
impl RefUnwindSafe for Type
impl Send for Type
impl Sync for Type
impl Unpin for Type
impl UnwindSafe for Type
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