pub struct TraitMethod {
pub doc: Option<String>,
pub name: Ident,
pub is_async: bool,
pub receiver: Option<Receiver>,
pub params: Vec<Param>,
pub return_type: Option<Type>,
pub default: Option<Block>,
pub span: Span,
}Expand description
One method signature a trait declares, with an optional default body.
A method with a default body is supplied by every conformance that does not override it; one without must be supplied by every conformance.
Fields§
§doc: Option<String>§name: Ident§is_async: bool§receiver: Option<Receiver>self / var self. A method without one is an associated function,
which has no receiver and so cannot be called through dyn Trait.
params: Vec<Param>§return_type: Option<Type>§default: Option<Block>§span: SpanTrait Implementations§
Source§impl Clone for TraitMethod
impl Clone for TraitMethod
Source§fn clone(&self) -> TraitMethod
fn clone(&self) -> TraitMethod
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for TraitMethod
impl RefUnwindSafe for TraitMethod
impl Send for TraitMethod
impl Sync for TraitMethod
impl Unpin for TraitMethod
impl UnsafeUnpin for TraitMethod
impl UnwindSafe for TraitMethod
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