pub struct Method {
pub name: Name,
pub ty: Expr,
pub has_default: bool,
pub index: usize,
}Expand description
A single method belonging to a type class.
Fields§
§name: NameName of the method.
ty: ExprType signature of the method (as a kernel expression).
has_default: boolWhether the method has a default implementation.
index: usizeIndex of this method in the class declaration (0-based).
Implementations§
Source§impl Method
impl Method
Sourcepub fn new(name: Name, ty: Expr, index: usize) -> Self
pub fn new(name: Name, ty: Expr, index: usize) -> Self
Create a new method without a default implementation.
Sourcepub fn with_default(name: Name, ty: Expr, index: usize) -> Self
pub fn with_default(name: Name, ty: Expr, index: usize) -> Self
Create a method that has a default implementation.
Sourcepub fn set_default(self) -> Self
pub fn set_default(self) -> Self
Return a copy marked as having a default.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Method
impl RefUnwindSafe for Method
impl Send for Method
impl Sync for Method
impl Unpin for Method
impl UnsafeUnpin for Method
impl UnwindSafe for Method
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