pub struct ObjectId<'a> { /* private fields */ }
Expand description
An ObjectId is used to identify, locate, and access a Durable Object via interaction with its Stub.
Implementations§
Source§impl ObjectId<'_>
impl ObjectId<'_>
Sourcepub fn get_stub(&self) -> Result<Stub>
pub fn get_stub(&self) -> Result<Stub>
Get a Stub for the Durable Object instance identified by this ObjectId.
pub fn get_stub_with_location_hint(&self, location_hint: &str) -> Result<Stub>
Sourcepub fn name(&self) -> Option<String>
pub fn name(&self) -> Option<String>
The name that was used to create the ObjectId
via id_from_name
.
None
is returned if the ObjectId
was constructed using unique_id
.
None
is also returned within the Durable Object constructor, as the name
property is not accessible there (see https://github.com/cloudflare/workerd/issues/2240).
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for ObjectId<'a>
impl<'a> RefUnwindSafe for ObjectId<'a>
impl<'a> !Send for ObjectId<'a>
impl<'a> !Sync for ObjectId<'a>
impl<'a> Unpin for ObjectId<'a>
impl<'a> UnwindSafe for ObjectId<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more