pub struct GenericSignature<'ctx> { /* private fields */ }Expand description
A generic signature describing generic parameters and their constraints.
Implementations§
Source§impl<'ctx> GenericSignature<'ctx>
impl<'ctx> GenericSignature<'ctx>
Sourcepub fn new(raw: Node<'ctx>) -> Self
pub fn new(raw: Node<'ctx>) -> Self
Create a GenericSignature from a raw DependentGenericSignature node.
Sourcepub fn param_counts(&self) -> Vec<u64>
pub fn param_counts(&self) -> Vec<u64>
Get the number of generic parameters at each depth level.
Returns a vector where index 0 is depth 0 params, index 1 is depth 1 params, etc.
Sourcepub fn requirements(&self) -> Vec<GenericRequirement<'ctx>>
pub fn requirements(&self) -> Vec<GenericRequirement<'ctx>>
Get all generic requirements (constraints).
Trait Implementations§
Source§impl<'ctx> Clone for GenericSignature<'ctx>
impl<'ctx> Clone for GenericSignature<'ctx>
Source§fn clone(&self) -> GenericSignature<'ctx>
fn clone(&self) -> GenericSignature<'ctx>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for GenericSignature<'_>
impl Debug for GenericSignature<'_>
impl<'ctx> Copy for GenericSignature<'ctx>
Auto Trait Implementations§
impl<'ctx> Freeze for GenericSignature<'ctx>
impl<'ctx> RefUnwindSafe for GenericSignature<'ctx>
impl<'ctx> !Send for GenericSignature<'ctx>
impl<'ctx> !Sync for GenericSignature<'ctx>
impl<'ctx> Unpin for GenericSignature<'ctx>
impl<'ctx> UnsafeUnpin for GenericSignature<'ctx>
impl<'ctx> UnwindSafe for GenericSignature<'ctx>
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