pub struct Code { /* private fields */ }Expand description
Implementations§
source§impl Code
impl Code
sourcepub fn call_func_with_args(&mut self, func: &str, args: Vec<CArg>)
pub fn call_func_with_args(&mut self, func: &str, args: Vec<CArg>)
§Call a function WITH arguments.
§Example
use c_emit::{Code, CArg};
fn main() {
let mut code = Code::new();
code.call_func_with_args("printf", vec![CArg::String("Hello, world!".to_string())]);
assert_eq!(code.to_string(), r#"
int main() {
printf("Hello, world!",);
return 0;
}
"#.trim_start().to_string());
}Trait Implementations§
Auto Trait Implementations§
impl RefUnwindSafe for Code
impl Send for Code
impl Sync for Code
impl Unpin for Code
impl UnwindSafe for Code
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