pub struct FutharkFun {
pub name: String,
pub type_params: Vec<String>,
pub params: Vec<(String, FutharkType)>,
pub return_type: FutharkType,
pub body: Vec<FutharkStmt>,
pub is_entry: bool,
pub attrs: Vec<FutharkAttr>,
}Expand description
A Futhark function (or entry point).
Fields§
§name: StringFunction name
type_params: Vec<String>Type parameters (e.g., 't)
params: Vec<(String, FutharkType)>Parameters: (name : type)
return_type: FutharkTypeReturn type
body: Vec<FutharkStmt>Body statements
is_entry: boolWhether this is an entry point
attrs: Vec<FutharkAttr>Function attributes
Implementations§
Source§impl FutharkFun
impl FutharkFun
Sourcepub fn new(
name: impl Into<String>,
params: Vec<(String, FutharkType)>,
return_type: FutharkType,
body: Vec<FutharkStmt>,
) -> Self
pub fn new( name: impl Into<String>, params: Vec<(String, FutharkType)>, return_type: FutharkType, body: Vec<FutharkStmt>, ) -> Self
Create a new regular function.
Sourcepub fn entry(
name: impl Into<String>,
params: Vec<(String, FutharkType)>,
return_type: FutharkType,
body: Vec<FutharkStmt>,
) -> Self
pub fn entry( name: impl Into<String>, params: Vec<(String, FutharkType)>, return_type: FutharkType, body: Vec<FutharkStmt>, ) -> Self
Create a new entry point.
Sourcepub fn with_type_param(self, tp: impl Into<String>) -> Self
pub fn with_type_param(self, tp: impl Into<String>) -> Self
Add a type parameter.
Sourcepub fn with_attr(self, attr: FutharkAttr) -> Self
pub fn with_attr(self, attr: FutharkAttr) -> Self
Add an attribute.
Trait Implementations§
Source§impl Clone for FutharkFun
impl Clone for FutharkFun
Source§fn clone(&self) -> FutharkFun
fn clone(&self) -> FutharkFun
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 FutharkFun
impl RefUnwindSafe for FutharkFun
impl Send for FutharkFun
impl Sync for FutharkFun
impl Unpin for FutharkFun
impl UnsafeUnpin for FutharkFun
impl UnwindSafe for FutharkFun
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