pub struct IdrisImplementation {
pub name: Option<String>,
pub interface: String,
pub type_args: Vec<IdrisType>,
pub constraints: Vec<IdrisType>,
pub clauses: Vec<IdrisFunction>,
pub visibility: Visibility,
}Expand description
An Idris 2 implementation (instance) of an interface.
Fields§
§name: Option<String>Optional implementation name.
interface: StringInterface name being implemented.
type_args: Vec<IdrisType>Type arguments.
constraints: Vec<IdrisType>Constraints on the implementation.
clauses: Vec<IdrisFunction>Method clauses: function definitions.
visibility: VisibilityVisibility.
Implementations§
Source§impl IdrisImplementation
impl IdrisImplementation
Sourcepub fn new(interface: impl Into<String>, type_args: Vec<IdrisType>) -> Self
pub fn new(interface: impl Into<String>, type_args: Vec<IdrisType>) -> Self
Create a new implementation.
Sourcepub fn add_method(&mut self, func: IdrisFunction)
pub fn add_method(&mut self, func: IdrisFunction)
Add a method clause.
Sourcepub fn emit(&self, backend: &IdrisBackend) -> String
pub fn emit(&self, backend: &IdrisBackend) -> String
Emit the implementation block.
Trait Implementations§
Source§impl Clone for IdrisImplementation
impl Clone for IdrisImplementation
Source§fn clone(&self) -> IdrisImplementation
fn clone(&self) -> IdrisImplementation
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 IdrisImplementation
impl RefUnwindSafe for IdrisImplementation
impl Send for IdrisImplementation
impl Sync for IdrisImplementation
impl Unpin for IdrisImplementation
impl UnsafeUnpin for IdrisImplementation
impl UnwindSafe for IdrisImplementation
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