Struct marker_api::ast::BindingArg
source · #[repr(C)]pub struct BindingArg<'ast> { /* private fields */ }Expand description
A generic bound in form <identifier=type>. For example, Item=i32 would be
the generic binding here:
ⓘ
let _baz: &dyn Iterator<Item=i32> = todo!();
// ^^^^^^^^The corresponding instance would provide the name (Item), the defined type
(i32) and potentially the Span if this bound originates from source code.
See paths in expressions for more information.
Implementations§
source§impl<'ast> BindingArg<'ast>
impl<'ast> BindingArg<'ast>
sourcepub fn ident(&self) -> &str
pub fn ident(&self) -> &str
The name of the identifier used in the binding. For example:
ⓘ
let _baz: &dyn Iterator<Item=i32> = todo!();
// ^^^^Would return Item as the identifier.
Trait Implementations§
Auto Trait Implementations§
impl<'ast> RefUnwindSafe for BindingArg<'ast>
impl<'ast> !Send for BindingArg<'ast>
impl<'ast> !Sync for BindingArg<'ast>
impl<'ast> Unpin for BindingArg<'ast>
impl<'ast> UnwindSafe for BindingArg<'ast>
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