Mercurial > lbo > hg > lazycall
view examples/test_functions.rs @ 0:7401c615042c
Initial commit
author | Lewin Bormann <lbo@spheniscida.de> |
---|---|
date | Fri, 20 Nov 2020 22:15:20 +0100 |
parents | |
children | babb2f9cb5ad |
line wrap: on
line source
use lazycall::lazy; #[lazy] fn test_function_empty() -> i32 { 3 } struct TestStruct(i32); #[lazy] fn test_function_someargs(a: i32, b: usize, c: TestStruct) -> bool { a%2 == 0 } #[lazy] fn test_function_onearg(a: i32) -> bool { a%2 == 0 } impl TestStruct { #[lazy] fn test_receiving_func(&mut self, a: i32) -> bool { a%2 == 0 } } fn main() { }