pub struct RustTraitMethod {
pub name: String,
pub params: Vec<RustMethodParam>,
pub return_type: Option<RustType>,
pub doc_comment: Option<String>,
pub is_default: bool,
pub default_body: Option<String>,
pub self_param: Option<String>,
}Expand description
Represents a method declaration in a trait
Fields§
§name: String§params: Vec<RustMethodParam>§return_type: Option<RustType>§doc_comment: Option<String>§is_default: bool§default_body: Option<String>§self_param: Option<String>The self parameter type: None (no self), Some(“&self”), Some(“&mut self”), Some(“self”)
Implementations§
Source§impl RustTraitMethod
impl RustTraitMethod
pub fn new(name: String) -> Self
pub fn with_param(self, param: RustMethodParam) -> Self
pub fn with_parameter(self, name: String, param_type: RustType) -> Self
pub fn with_return_type(self, return_type: RustType) -> Self
pub fn with_doc(self, doc: String) -> Self
pub fn with_default_implementation(self, body: String) -> Self
pub fn with_body(self, body: String) -> Self
pub fn with_self_param(self, self_param: Option<String>) -> Self
Trait Implementations§
Source§impl Clone for RustTraitMethod
impl Clone for RustTraitMethod
Source§fn clone(&self) -> RustTraitMethod
fn clone(&self) -> RustTraitMethod
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 moreAuto Trait Implementations§
impl Freeze for RustTraitMethod
impl RefUnwindSafe for RustTraitMethod
impl Send for RustTraitMethod
impl Sync for RustTraitMethod
impl Unpin for RustTraitMethod
impl UnsafeUnpin for RustTraitMethod
impl UnwindSafe for RustTraitMethod
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