Skip to content

feat(rust): rust sdk docs#4412

Open
flippedcoder wants to merge 4 commits intomainfrom
mm/rust-sdk
Open

feat(rust): rust sdk docs#4412
flippedcoder wants to merge 4 commits intomainfrom
mm/rust-sdk

Conversation

@flippedcoder
Copy link
Copy Markdown
Contributor

@flippedcoder flippedcoder commented Apr 8, 2026

What does this PR do?

This adds the docs for the Rust SDK.

Notes to reviewers

┆Attachments: EDU-6184 feat(rust): rust sdk docs

@vercel
Copy link
Copy Markdown

vercel bot commented Apr 8, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
temporal-documentation Ready Ready Preview, Comment Apr 14, 2026 5:54pm

Request Review

@github-actions
Copy link
Copy Markdown
Contributor

github-actions bot commented Apr 8, 2026

@flippedcoder flippedcoder marked this pull request as ready for review April 14, 2026 17:52
@flippedcoder flippedcoder requested a review from a team as a code owner April 14, 2026 17:52
Copy link
Copy Markdown
Member

@chris-olszewski chris-olszewski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Partial review

Comment on lines +265 to +266
let connection_options =
ConnectionOptions::new(Url::from_str("http://localhost:7233")?).build();
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comment on lines +26 to +40
#[activities]
impl GreetingActivities {
#[activity]
pub async fn greet(_ctx: ActivityContext, name: String) -> Result<String, ActivityError> {
Ok(format!("Hello, {}!", name))
}

#[activity]
pub async fn send_notification(_ctx: ActivityContext, message: String) -> Result<(), ActivityError> {
println!("Sending notification: {}", message);
Ok(())
}
}

pub struct GreetingActivities;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is awkward to declare the struct after the implementation

Suggested change
#[activities]
impl GreetingActivities {
#[activity]
pub async fn greet(_ctx: ActivityContext, name: String) -> Result<String, ActivityError> {
Ok(format!("Hello, {}!", name))
}
#[activity]
pub async fn send_notification(_ctx: ActivityContext, message: String) -> Result<(), ActivityError> {
println!("Sending notification: {}", message);
Ok(())
}
}
pub struct GreetingActivities;
pub struct GreetingActivities;
#[activities]
impl GreetingActivities {
#[activity]
pub async fn greet(_ctx: ActivityContext, name: String) -> Result<String, ActivityError> {
Ok(format!("Hello, {}!", name))
}
#[activity]
pub async fn send_notification(_ctx: ActivityContext, message: String) -> Result<(), ActivityError> {
println!("Sending notification: {}", message);
Ok(())
}
}


**How to define Activity parameters using the Temporal Rust SDK.**

There is no explicit limit to the total number of parameters that an [Activity Definition](/activity-definition) may support. However, there is a limit to the total size of the data that ends up encoded into a gRPC message Payload.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For Rust we actually have a hard cap of 6 parameters for activities.


We recommend that you use a single struct as an argument that wraps all the application data passed to Activities. This way you can change what data is passed to the Activity without breaking the function signature.

Activity parameters must be serializable and deserializable using serde. Use `#[derive(Serialize, Deserialize)]` on your data types:
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This isn't a hard requirement, but implementing the serde traits are the easiest way to ensure they work. If they have a protobuf message they can leverage ProstSerializable for encoding without implementing the serde traits.

I am actively working on improving the ergonomics of using protobuf instead of serde, so I don't have a good sample yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants