Expand description
Durable Objects provide low-latency coordination and consistent storage for the Workers platform. A given namespace can support essentially unlimited Durable Objects, with each Object having access to a transactional, key-value storage API.
Durable Objects consist of two components: a class that defines a template for creating Durable Objects and a Workers script that instantiates and uses those Durable Objects.
The class and the Workers script are linked together with a binding.
Learn more about using Durable Objects.
Structs§
- GetAlarm
Options - List
Options - Object
Id - An ObjectId is used to identify, locate, and access a Durable Object via interaction with its Stub.
- Object
Namespace - Use an ObjectNamespace to get access to Stubs for communication with a Durable Object instance. A given namespace can support essentially unlimited Durable Objects, with each Object having access to a transactional, key-value storage API.
- Scheduled
Time - Determines when a Durable Object alarm should be ran, based on a timestamp or offset in milliseconds.
- SetAlarm
Options - State
- Passed from the runtime to provide access to the Durable Object’s storage as well as various metadata about the Object.
- Storage
- Access a Durable Object’s Storage API. Each method is implicitly wrapped inside a transaction, such that its results are atomic and isolated from all other storage operations, even when accessing multiple key-value pairs.
- Stub
- A Durable Object stub is a client object used to send requests to a remote Durable Object.
- Transaction
Enums§
Traits§
- Durable
Object - Note: Implement this trait with a standard
impl DurableObject for YourType
block, but in order to integrate them with the Workers Runtime, you must also add the#[durable_object]
attribute to the struct.