pub struct ObjectNamespace { /* private fields */ }
Expand description

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.

Implementations§

This method derives a unique object ID from the given name string. It will always return the same ID when given the same name as input.

This method parses an ID that was previously stringified. This is useful in particular with IDs created using unique_id(&self), as these IDs need to be stored somewhere, probably as

A stringified object ID is a 64-digit hexadecimal number. However, not all 64-digit hex numbers are valid IDs. This method will throw if it is passed an ID that was not originally created by newUniqueId() or idFromName(). It will also throw if the ID was originally created for a different namespace.

Creates a new object ID randomly. This method will never return the same ID twice, and thus it is guaranteed that the object does not yet exist and has never existed at the time the method returns.

Durable Objects can be created so that they only run and store data within a specific jurisdiction to comply with local regulations. You must specify the jurisdiction when generating the Durable Object’s id.

Jurisdiction constraints can only be used with ids created by unique_id() and are not currently compatible with ids created by id_from_name().

See supported jurisdictions and more documentation at: https://developers.cloudflare.com/workers/runtime-apis/durable-objects#restricting-objects-to-a-jurisdiction

Trait Implementations§

Converts this type into a shared reference of the (usually inferred) input type.
Converts to this type from the input type.
Performs a dynamic instanceof check to see whether the JsValue provided is an instance of this type. Read more
Performs a zero-cost unchecked conversion from a JsValue into an instance of Self Read more
Performs a zero-cost unchecked conversion from a &JsValue into an instance of &Self. Read more
Test whether this JS value has a type T. Read more
Performs a dynamic cast (checked at runtime) of this value into the target type T. Read more
Performs a dynamic cast (checked at runtime) of this value into the target type T. Read more
Performs a zero-cost unchecked cast into the specified type. Read more
Performs a zero-cost unchecked cast into a reference to the specified type. Read more
Test whether this JS value is an instance of the type T. Read more
Performs a dynamic check to see whether the JsValue provided is a value of this type. Read more

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

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

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.