[go: up one dir, main page]

Struct worker::durable::Storage[][src]

pub struct Storage { /* fields omitted */ }
Expand description

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.

Implementations

Retrieves the value associated with the given key. The type of the returned value will be whatever was previously written for the key, or undefined if the key does not exist.

Retrieves the values associated with each of the provided keys.

Stores the value and associates it with the given key.

Takes a serializable struct and stores each of its keys and values to storage.

Deletes the key and associated value. Returns true if the key existed or false if it didn’t.

Deletes the provided keys and their associated values. Returns a count of the number of key-value pairs deleted.

Deletes all keys and associated values, effectively deallocating all storage used by the Durable Object. In the event of a failure while the operation is still in flight, it may be that only a subset of the data is properly deleted.

Returns all keys and values associated with the current Durable Object in ascending lexicographic sorted order.

Be aware of how much data may be stored in your Durable Object before calling this version of list without options, because it will all be loaded into the Durable Object’s memory, potentially hitting its limit. If that is a concern, use the alternate list_with_options() method.

Returns keys associated with the current Durable Object according to the parameters in the provided options object.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.