aboutsummaryrefslogtreecommitdiff
path: root/doc/usage
diff options
context:
space:
mode:
Diffstat (limited to 'doc/usage')
-rw-r--r--doc/usage/func.rs4
-rw-r--r--doc/usage/func_async_expand.rs3
-rw-r--r--doc/usage/func_async_expand.rs.lock3
-rw-r--r--doc/usage/func_expand.rs3
-rw-r--r--doc/usage/func_expand.rs.lock3
-rw-r--r--doc/usage/invoke.rs10
-rw-r--r--doc/usage/invoke_async_expand.rs6
-rw-r--r--doc/usage/invoke_async_expand.rs.lock6
-rw-r--r--doc/usage/invoke_expand.rs6
-rw-r--r--doc/usage/invoke_expand.rs.lock6
-rw-r--r--doc/usage/select.rs3
-rw-r--r--doc/usage/select_async_expand.rs5
-rw-r--r--doc/usage/select_async_expand.rs.lock5
-rw-r--r--doc/usage/select_expand.rs5
-rw-r--r--doc/usage/select_expand.rs.lock5
15 files changed, 73 insertions, 0 deletions
diff --git a/doc/usage/func.rs b/doc/usage/func.rs
new file mode 100644
index 0000000..f407019
--- /dev/null
+++ b/doc/usage/func.rs
@@ -0,0 +1,4 @@
+#[func]
+pub fn greet(name: &str) -> String {
+ "Hello, {name}!".to_string()
+}
diff --git a/doc/usage/func_async_expand.rs b/doc/usage/func_async_expand.rs
new file mode 100644
index 0000000..ac52411
--- /dev/null
+++ b/doc/usage/func_async_expand.rs
@@ -0,0 +1,3 @@
+pub async fn greet(name: &str) -> String {
+ "Hello, {name}!".to_string()
+}
diff --git a/doc/usage/func_async_expand.rs.lock b/doc/usage/func_async_expand.rs.lock
new file mode 100644
index 0000000..ac52411
--- /dev/null
+++ b/doc/usage/func_async_expand.rs.lock
@@ -0,0 +1,3 @@
+pub async fn greet(name: &str) -> String {
+ "Hello, {name}!".to_string()
+}
diff --git a/doc/usage/func_expand.rs b/doc/usage/func_expand.rs
new file mode 100644
index 0000000..70dee21
--- /dev/null
+++ b/doc/usage/func_expand.rs
@@ -0,0 +1,3 @@
+pub fn greet(name: &str) -> String {
+ "Hello, {name}!".to_string()
+}
diff --git a/doc/usage/func_expand.rs.lock b/doc/usage/func_expand.rs.lock
new file mode 100644
index 0000000..70dee21
--- /dev/null
+++ b/doc/usage/func_expand.rs.lock
@@ -0,0 +1,3 @@
+pub fn greet(name: &str) -> String {
+ "Hello, {name}!".to_string()
+}
diff --git a/doc/usage/invoke.rs b/doc/usage/invoke.rs
new file mode 100644
index 0000000..0ae90d2
--- /dev/null
+++ b/doc/usage/invoke.rs
@@ -0,0 +1,10 @@
+#[func]
+fn compute(x: i32) -> i32 {
+ x * 2
+}
+
+#[func]
+fn example() -> i32 {
+ // invoke! macro should be used with #[func]
+ invoke!(compute(5))
+}
diff --git a/doc/usage/invoke_async_expand.rs b/doc/usage/invoke_async_expand.rs
new file mode 100644
index 0000000..4b8d93f
--- /dev/null
+++ b/doc/usage/invoke_async_expand.rs
@@ -0,0 +1,6 @@
+async fn compute(x: i32) -> i32 {
+ x * 2
+}
+async fn example() -> i32 {
+ { { compute(5).await } }
+}
diff --git a/doc/usage/invoke_async_expand.rs.lock b/doc/usage/invoke_async_expand.rs.lock
new file mode 100644
index 0000000..4b8d93f
--- /dev/null
+++ b/doc/usage/invoke_async_expand.rs.lock
@@ -0,0 +1,6 @@
+async fn compute(x: i32) -> i32 {
+ x * 2
+}
+async fn example() -> i32 {
+ { { compute(5).await } }
+}
diff --git a/doc/usage/invoke_expand.rs b/doc/usage/invoke_expand.rs
new file mode 100644
index 0000000..3274d77
--- /dev/null
+++ b/doc/usage/invoke_expand.rs
@@ -0,0 +1,6 @@
+fn compute(x: i32) -> i32 {
+ x * 2
+}
+fn example() -> i32 {
+ { { compute(5) } }
+}
diff --git a/doc/usage/invoke_expand.rs.lock b/doc/usage/invoke_expand.rs.lock
new file mode 100644
index 0000000..3274d77
--- /dev/null
+++ b/doc/usage/invoke_expand.rs.lock
@@ -0,0 +1,6 @@
+fn compute(x: i32) -> i32 {
+ x * 2
+}
+fn example() -> i32 {
+ { { compute(5) } }
+}
diff --git a/doc/usage/select.rs b/doc/usage/select.rs
new file mode 100644
index 0000000..8cffcf8
--- /dev/null
+++ b/doc/usage/select.rs
@@ -0,0 +1,3 @@
+fn example() {
+ select! [{ 100 } else { 200 }];
+}
diff --git a/doc/usage/select_async_expand.rs b/doc/usage/select_async_expand.rs
new file mode 100644
index 0000000..b2553f3
--- /dev/null
+++ b/doc/usage/select_async_expand.rs
@@ -0,0 +1,5 @@
+fn example() {
+ {
+ { { 100 } }
+ };
+}
diff --git a/doc/usage/select_async_expand.rs.lock b/doc/usage/select_async_expand.rs.lock
new file mode 100644
index 0000000..b2553f3
--- /dev/null
+++ b/doc/usage/select_async_expand.rs.lock
@@ -0,0 +1,5 @@
+fn example() {
+ {
+ { { 100 } }
+ };
+}
diff --git a/doc/usage/select_expand.rs b/doc/usage/select_expand.rs
new file mode 100644
index 0000000..8caed8e
--- /dev/null
+++ b/doc/usage/select_expand.rs
@@ -0,0 +1,5 @@
+fn example() {
+ {
+ { { 200 } }
+ };
+}
diff --git a/doc/usage/select_expand.rs.lock b/doc/usage/select_expand.rs.lock
new file mode 100644
index 0000000..8caed8e
--- /dev/null
+++ b/doc/usage/select_expand.rs.lock
@@ -0,0 +1,5 @@
+fn example() {
+ {
+ { { 200 } }
+ };
+}