Skip to content

Commit a167e80

Browse files
committed
Merge branch 'docs' of github.com:restatedev/sdk-rust into docs
2 parents 43357e6 + b9864db commit a167e80

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/errors.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@
44
//! By default, Restate does infinite retries with an exponential backoff strategy.
55
//!
66
//! For failures for which you do not want retries, but instead want the invocation to end and the error message
7-
//! to be propagated back to the caller, you can throw a **terminal error**.
7+
//! to be propagated back to the caller, you can return a [`TerminalError`].
88
//!
9-
//! You can throw a terminal exception with an optional HTTP status code and a message anywhere in your handler, as follows:
9+
//! You can return a [`TerminalError`] with an optional HTTP status code and a message anywhere in your handler, as follows:
1010
//!
1111
//! ```rust,no_run
1212
//! # use restate_sdk::prelude::*;

src/lib.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -59,11 +59,11 @@
5959
//!
6060
//! - Specify that you want to create a service by using the [`#[restate_sdk::service]` macro](restate_sdk_macros::service).
6161
//! - Create a trait with the service handlers.
62-
//! - Handlers can accept zero or one parameter and return a `Result`.
63-
//! - The type of the input parameter of the handler needs to implement [`Serialize`](crate::serde::Deserialize) and [`Deserialize`](crate::serde::Deserialize). See [Serialization docs](crate::serde).
64-
//! - The Result contains the return value or a [`HandlerError`][crate::errors::HandlerError], which can be a [`TerminalError`] or any other Rust's `StdError`.
62+
//! - Handlers can accept zero or one parameter and return a [`Result`].
63+
//! - The type of the input parameter of the handler needs to implement [`Serialize`](crate::serde::Deserialize) and [`Deserialize`](crate::serde::Deserialize). See [`crate::serde`].
64+
//! - The Result contains the return value or a [`HandlerError`][crate::errors::HandlerError], which can be a [`TerminalError`](crate::errors::TerminalError) or any other Rust's [`std::error::Error`].
6565
//! - The service handler can now be called at `<RESTATE_INGRESS_URL>/MyService/myHandler`. You can optionally override the handler name used via `#[name = "myHandler"]`. More details on handler invocations can be found in the [docs](https://docs.restate.dev/invoke/http).
66-
//! - Implement the trait on a struct. The struct will contain the actual implementation of the handlers.
66+
//! - Implement the trait on a concrete type, for example on a struct.
6767
//! - The first parameter of a handler after `&self` is always a [`Context`](crate::context::Context) to interact with Restate.
6868
//! The SDK stores the actions you do on the context in the Restate journal to make them durable.
6969
//! - Finally, create an HTTP endpoint and bind the service(s) to it. Listen on the specified port (here 9080) for connections and requests.
@@ -117,7 +117,7 @@
117117
//!
118118
//! - Specify that you want to create a Virtual Object by using the [`#[restate_sdk::object]` macro](restate_sdk_macros::object).
119119
//! - The first argument of each handler must be the [`ObjectContext`](crate::context::ObjectContext) parameter. Handlers with the `ObjectContext` parameter can write to the K/V state store. Only one handler can be active at a time per object, to ensure consistency.
120-
//! - You can retrieve the key of the object you are in via `ctx.key()`.
120+
//! - You can retrieve the key of the object you are in via [`ObjectContext.key`].
121121
//! - If you want to have a handler that executes concurrently to the others and doesn't have write access to the K/V state, add `#[shared]` to the handler definition in the trait.
122122
//! Shared handlers need to use the [`SharedObjectContext`](crate::context::SharedObjectContext).
123123
//! You can use these handlers, for example, to read K/V state and expose it to the outside world, or to interact with the blocking handler and resolve awakeables etc.

0 commit comments

Comments
 (0)