pub enum TypeParamRef<'a> {
TypeVar(&'a TypeParamTypeVar),
TypeVarTuple(&'a TypeParamTypeVarTuple),
ParamSpec(&'a TypeParamParamSpec),
}Expand description
See also type_param
Variants§
TypeVar(&'a TypeParamTypeVar)
TypeVarTuple(&'a TypeParamTypeVarTuple)
ParamSpec(&'a TypeParamParamSpec)
Implementations§
Source§impl<'a> TypeParamRef<'a>
impl<'a> TypeParamRef<'a>
Sourcepub const fn is_type_var(&self) -> bool
pub const fn is_type_var(&self) -> bool
Returns true if self is of variant TypeVar.
Sourcepub fn as_type_var(&self) -> Option<&&'a TypeParamTypeVar>
pub fn as_type_var(&self) -> Option<&&'a TypeParamTypeVar>
Returns Some if self is a reference of variant TypeVar, and None otherwise.
Sourcepub fn as_mut_type_var(&mut self) -> Option<&mut &'a TypeParamTypeVar>
pub fn as_mut_type_var(&mut self) -> Option<&mut &'a TypeParamTypeVar>
Returns Some if self is a mutable reference of variant TypeVar, and None otherwise.
Sourcepub fn expect_type_var(self) -> &'a TypeParamTypeVarwhere
TypeParamRef<'a>: Debug,
pub fn expect_type_var(self) -> &'a TypeParamTypeVarwhere
TypeParamRef<'a>: Debug,
Sourcepub fn type_var(self) -> Option<&'a TypeParamTypeVar>
pub fn type_var(self) -> Option<&'a TypeParamTypeVar>
Returns Some if self is of variant TypeVar, and None otherwise.
Sourcepub const fn is_type_var_tuple(&self) -> bool
pub const fn is_type_var_tuple(&self) -> bool
Returns true if self is of variant TypeVarTuple.
Sourcepub fn as_type_var_tuple(&self) -> Option<&&'a TypeParamTypeVarTuple>
pub fn as_type_var_tuple(&self) -> Option<&&'a TypeParamTypeVarTuple>
Returns Some if self is a reference of variant TypeVarTuple, and None otherwise.
Sourcepub fn as_mut_type_var_tuple(
&mut self,
) -> Option<&mut &'a TypeParamTypeVarTuple>
pub fn as_mut_type_var_tuple( &mut self, ) -> Option<&mut &'a TypeParamTypeVarTuple>
Returns Some if self is a mutable reference of variant TypeVarTuple, and None otherwise.
Sourcepub fn expect_type_var_tuple(self) -> &'a TypeParamTypeVarTuplewhere
TypeParamRef<'a>: Debug,
pub fn expect_type_var_tuple(self) -> &'a TypeParamTypeVarTuplewhere
TypeParamRef<'a>: Debug,
Unwraps the value, yielding the content of TypeVarTuple.
§Panics
Panics if the value is not TypeVarTuple, with a panic message including the content of self.
Sourcepub fn type_var_tuple(self) -> Option<&'a TypeParamTypeVarTuple>
pub fn type_var_tuple(self) -> Option<&'a TypeParamTypeVarTuple>
Returns Some if self is of variant TypeVarTuple, and None otherwise.
Sourcepub const fn is_param_spec(&self) -> bool
pub const fn is_param_spec(&self) -> bool
Returns true if self is of variant ParamSpec.
Sourcepub fn as_param_spec(&self) -> Option<&&'a TypeParamParamSpec>
pub fn as_param_spec(&self) -> Option<&&'a TypeParamParamSpec>
Returns Some if self is a reference of variant ParamSpec, and None otherwise.
Sourcepub fn as_mut_param_spec(&mut self) -> Option<&mut &'a TypeParamParamSpec>
pub fn as_mut_param_spec(&mut self) -> Option<&mut &'a TypeParamParamSpec>
Returns Some if self is a mutable reference of variant ParamSpec, and None otherwise.
Sourcepub fn expect_param_spec(self) -> &'a TypeParamParamSpecwhere
TypeParamRef<'a>: Debug,
pub fn expect_param_spec(self) -> &'a TypeParamParamSpecwhere
TypeParamRef<'a>: Debug,
Sourcepub fn param_spec(self) -> Option<&'a TypeParamParamSpec>
pub fn param_spec(self) -> Option<&'a TypeParamParamSpec>
Returns Some if self is of variant ParamSpec, and None otherwise.
Trait Implementations§
Source§impl<'a> Clone for TypeParamRef<'a>
impl<'a> Clone for TypeParamRef<'a>
Source§fn clone(&self) -> TypeParamRef<'a>
fn clone(&self) -> TypeParamRef<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl<'a> Debug for TypeParamRef<'a>
impl<'a> Debug for TypeParamRef<'a>
Source§impl<'a> From<&'a TypeParam> for TypeParamRef<'a>
impl<'a> From<&'a TypeParam> for TypeParamRef<'a>
Source§fn from(node: &'a TypeParam) -> TypeParamRef<'a>
fn from(node: &'a TypeParam) -> TypeParamRef<'a>
Source§impl<'a> From<&'a TypeParamParamSpec> for TypeParamRef<'a>
impl<'a> From<&'a TypeParamParamSpec> for TypeParamRef<'a>
Source§fn from(node: &'a TypeParamParamSpec) -> TypeParamRef<'a>
fn from(node: &'a TypeParamParamSpec) -> TypeParamRef<'a>
Source§impl<'a> From<&'a TypeParamTypeVar> for TypeParamRef<'a>
impl<'a> From<&'a TypeParamTypeVar> for TypeParamRef<'a>
Source§fn from(node: &'a TypeParamTypeVar) -> TypeParamRef<'a>
fn from(node: &'a TypeParamTypeVar) -> TypeParamRef<'a>
Source§impl<'a> From<&'a TypeParamTypeVarTuple> for TypeParamRef<'a>
impl<'a> From<&'a TypeParamTypeVarTuple> for TypeParamRef<'a>
Source§fn from(node: &'a TypeParamTypeVarTuple) -> TypeParamRef<'a>
fn from(node: &'a TypeParamTypeVarTuple) -> TypeParamRef<'a>
Source§impl<'a> From<TypeParamRef<'a>> for AnyNodeRef<'a>
impl<'a> From<TypeParamRef<'a>> for AnyNodeRef<'a>
Source§fn from(node: TypeParamRef<'a>) -> AnyNodeRef<'a>
fn from(node: TypeParamRef<'a>) -> AnyNodeRef<'a>
Source§impl<'a> GetSize for TypeParamRef<'a>
impl<'a> GetSize for TypeParamRef<'a>
Source§fn get_heap_size(&self) -> usize
fn get_heap_size(&self) -> usize
Source§fn get_heap_size_with_tracker<TRACKER>(
&self,
tracker: TRACKER,
) -> (usize, TRACKER)where
TRACKER: GetSizeTracker,
fn get_heap_size_with_tracker<TRACKER>(
&self,
tracker: TRACKER,
) -> (usize, TRACKER)where
TRACKER: GetSizeTracker,
tracker. Read moreSource§fn get_stack_size() -> usize
fn get_stack_size() -> usize
Source§fn get_size_with_tracker<T>(&self, tracker: T) -> (usize, T)where
T: GetSizeTracker,
fn get_size_with_tracker<T>(&self, tracker: T) -> (usize, T)where
T: GetSizeTracker,
tracker. Read moreSource§impl HasNodeIndex for TypeParamRef<'_>
impl HasNodeIndex for TypeParamRef<'_>
Source§fn node_index(&self) -> &AtomicNodeIndex
fn node_index(&self) -> &AtomicNodeIndex
AtomicNodeIndex for this node.Source§impl<'a> PartialEq for TypeParamRef<'a>
impl<'a> PartialEq for TypeParamRef<'a>
Source§impl Ranged for TypeParamRef<'_>
impl Ranged for TypeParamRef<'_>
impl<'a> Copy for TypeParamRef<'a>
impl<'a> StructuralPartialEq for TypeParamRef<'a>
Auto Trait Implementations§
impl<'a> Freeze for TypeParamRef<'a>
impl<'a> RefUnwindSafe for TypeParamRef<'a>
impl<'a> Send for TypeParamRef<'a>
impl<'a> Sync for TypeParamRef<'a>
impl<'a> Unpin for TypeParamRef<'a>
impl<'a> UnsafeUnpin for TypeParamRef<'a>
impl<'a> UnwindSafe for TypeParamRef<'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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more