Skip to content

Commit 9a9c7cf

Browse files
authored
Change return type of greet handlers Rust templates (#215)
1 parent d5bb855 commit 9a9c7cf

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

templates/rust-shuttle/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,13 @@ use std::time::Duration;
99

1010
#[restate_sdk::service]
1111
trait Greeter {
12-
async fn greet(name: String) -> HandlerResult<String>;
12+
async fn greet(name: String) -> Result<String, HandlerError>;
1313
}
1414

1515
struct GreeterImpl;
1616

1717
impl Greeter for GreeterImpl {
18-
async fn greet(&self, mut ctx: Context<'_>, name: String) -> HandlerResult<String> {
18+
async fn greet(&self, mut ctx: Context<'_>, name: String) -> Result<String, HandlerError> {
1919
// Durably execute a set of steps; resilient against failures
2020
let greeting_id = ctx.rand_uuid().to_string();
2121
ctx.run(|| send_notification(&greeting_id, &name)).await?;

templates/rust/src/main.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ use utils::{send_notification, send_reminder};
66

77
#[restate_sdk::service]
88
trait Greeter {
9-
async fn greet(name: String) -> HandlerResult<String>;
9+
async fn greet(name: String) -> Result<String, HandlerError>;
1010
}
1111

1212
struct GreeterImpl;
1313

1414
impl Greeter for GreeterImpl {
15-
async fn greet(&self, mut ctx: Context<'_>, name: String) -> HandlerResult<String> {
15+
async fn greet(&self, mut ctx: Context<'_>, name: String) -> Result<String, HandlerError> {
1616
// Durably execute a set of steps; resilient against failures
1717
let greeting_id = ctx.rand_uuid().to_string();
1818
ctx.run(|| send_notification(&greeting_id, &name)).await?;

0 commit comments

Comments
 (0)