Browse documentation
New to Rust
The Rust concepts needed to read the examples and guide a coding agent.
You can start with Septa’s small examples without learning all of Rust. The main concepts are structs, enums, functions, ownership and explicit results. Septa supports a curated profile, so its reference matters alongside general Rust documentation.
Read the counter
In the first actor, this field stores a signed 64-bit integer:
pub struct State {
pub count: i64,
}
The handler takes a mutable reference to that state and replaces the value:
pub fn set(&mut self, count: i64) {
self.count = count;
}
&mut self means the function can change the state it receives. The surrounding #[durable_server] and #[cast] attributes connect this Rust code to Septa’s actor model.
Learn these next
| Rust concept | Why it matters |
|---|---|
| Struct | Groups named data fields |
| Enum | Represents distinct alternatives, such as accepted or refused |
Option<T> |
Represents a value that may be absent |
Result<T, E> |
Represents success or a typed error |
match |
Handles the alternatives of a value |
| Ownership and borrowing | Control how values are moved, shared or changed |
Support for particular forms depends on the supported Rust profile.
Give the agent a concrete task
Specify the input, expected result and invalid cases. Ask it to use the supported profile and explain any effects or authority the change requires. Review the types and tests against that requirement.
Start by running the counter unchanged. Then build a library and consumer and change one return value. Use review an agent’s change before expanding the example.