pub struct Function {
pub return_type: PTypeExpr,
pub name: String,
pub parameters: Vec<(PTypeExpr, String)>,
pub body: Option<Block>,
}
Expand description
A c function (potentially with a body).
§Example
use c_ast::*;
// float f(int x) {
// return x;
// }
let f = Function {
return_type: tvar("float"),
name: "main".to_string(),
parameters: vec![],
body: Some(vec![
return_(0_i32.literal())
]),
};
Fields§
§return_type: PTypeExpr
§name: String
§parameters: Vec<(PTypeExpr, String)>
§body: Option<Block>
Trait Implementations§
impl StructuralPartialEq for Function
Auto Trait Implementations§
impl Freeze for Function
impl RefUnwindSafe for Function
impl !Send for Function
impl !Sync for Function
impl Unpin for Function
impl UnwindSafe for Function
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