pub struct IdrisInterfaceExt {
pub name: String,
pub params: Vec<(String, IdrisType)>,
pub constraints: Vec<IdrisType>,
pub methods: Vec<(String, IdrisType, Option<IdrisExpr>)>,
pub visibility: Visibility,
pub doc: Option<String>,
}Expand description
An Idris 2 interface definition.
Fields§
§name: StringInterface name.
params: Vec<(String, IdrisType)>Type parameters.
constraints: Vec<IdrisType>Superclass constraints.
methods: Vec<(String, IdrisType, Option<IdrisExpr>)>Method declarations: (name, type, optional default impl).
visibility: VisibilityVisibility.
doc: Option<String>Optional doc comment.
Implementations§
Source§impl IdrisInterfaceExt
impl IdrisInterfaceExt
Sourcepub fn new(name: impl Into<String>, params: Vec<(String, IdrisType)>) -> Self
pub fn new(name: impl Into<String>, params: Vec<(String, IdrisType)>) -> Self
Create a minimal interface definition.
Sourcepub fn add_method(&mut self, name: impl Into<String>, ty: IdrisType)
pub fn add_method(&mut self, name: impl Into<String>, ty: IdrisType)
Add a method signature.
Trait Implementations§
Source§impl Clone for IdrisInterfaceExt
impl Clone for IdrisInterfaceExt
Source§fn clone(&self) -> IdrisInterfaceExt
fn clone(&self) -> IdrisInterfaceExt
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 IdrisInterfaceExt
impl RefUnwindSafe for IdrisInterfaceExt
impl Send for IdrisInterfaceExt
impl Sync for IdrisInterfaceExt
impl Unpin for IdrisInterfaceExt
impl UnsafeUnpin for IdrisInterfaceExt
impl UnwindSafe for IdrisInterfaceExt
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