pub enum TraitMemberSignature {
Property {
name: String,
optional: bool,
type_annotation: TypeAnnotation,
span: Span,
doc_comment: Option<DocComment>,
},
Method {
name: String,
optional: bool,
params: Vec<FunctionParam>,
return_type: TypeAnnotation,
is_async: bool,
span: Span,
doc_comment: Option<DocComment>,
},
IndexSignature {
param_name: String,
param_type: String,
return_type: TypeAnnotation,
span: Span,
doc_comment: Option<DocComment>,
},
}Expand description
A body-less trait member signature: property, method, or index signature.
Used inside TraitMember::Required(..) to express the obligation an impl
must satisfy. Trait bodies that include a body (method) use
TraitMember::Default(MethodDef) instead.
Variants§
Property
Property signature
Method
Method signature
IndexSignature
Index signature
Implementations§
Source§impl TraitMemberSignature
impl TraitMemberSignature
pub fn span(&self) -> Span
pub fn doc_comment(&self) -> Option<&DocComment>
Trait Implementations§
Source§impl Clone for TraitMemberSignature
impl Clone for TraitMemberSignature
Source§fn clone(&self) -> TraitMemberSignature
fn clone(&self) -> TraitMemberSignature
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 moreSource§impl Debug for TraitMemberSignature
impl Debug for TraitMemberSignature
Source§impl<'de> Deserialize<'de> for TraitMemberSignature
impl<'de> Deserialize<'de> for TraitMemberSignature
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for TraitMemberSignature
impl RefUnwindSafe for TraitMemberSignature
impl Send for TraitMemberSignature
impl Sync for TraitMemberSignature
impl Unpin for TraitMemberSignature
impl UnsafeUnpin for TraitMemberSignature
impl UnwindSafe for TraitMemberSignature
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