pub struct TypeRef<'a>(/* private fields */);Expand description
A type reference that can be either borrowed or owned.
Implementations§
Methods from Deref<Target = Type<'a>>§
Sourcepub fn as_optional(&self) -> Option<&TypeRef<'a>>
pub fn as_optional(&self) -> Option<&TypeRef<'a>>
The child type if this type is optional.
Sourcepub fn as_array(&self) -> Option<&TypeRef<'a>>
pub fn as_array(&self) -> Option<&TypeRef<'a>>
The array element type if this type is an array.
Sourcepub fn as_enum(&self) -> Option<&List<'a, EnumVariant<'a>>>
pub fn as_enum(&self) -> Option<&List<'a, EnumVariant<'a>>>
The enum variants if this type is an enum.
Trait Implementations§
Source§impl<'a> PartialEq<TypeRef<'a>> for Type<'a>
impl<'a> PartialEq<TypeRef<'a>> for Type<'a>
Source§impl<'a> PartialEq for TypeRef<'a>
impl<'a> PartialEq for TypeRef<'a>
impl<'a> Eq for TypeRef<'a>
impl<'a> StructuralPartialEq for TypeRef<'a>
Auto Trait Implementations§
impl<'a> Freeze for TypeRef<'a>
impl<'a> RefUnwindSafe for TypeRef<'a>
impl<'a> Send for TypeRef<'a>
impl<'a> Sync for TypeRef<'a>
impl<'a> Unpin for TypeRef<'a>
impl<'a> UnsafeUnpin for TypeRef<'a>
impl<'a> UnwindSafe for TypeRef<'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