pub struct State { /* private fields */ }
Expand description
Passed from the runtime to provide access to the Durable Object’s storage as well as various metadata about the Object.
Implementations§
Source§impl State
impl State
Sourcepub fn id(&self) -> ObjectId<'_>
pub fn id(&self) -> ObjectId<'_>
The ID of this Durable Object which can be converted into a hex string using its to_string()
method.
Sourcepub fn storage(&self) -> Storage
pub fn storage(&self) -> Storage
Contains methods for accessing persistent storage via the transactional storage API. See Transactional Storage API for a detailed reference.
pub fn container(&self) -> Option<Container>
pub fn wait_until<F>(&self, future: F)
pub fn _inner(self) -> DurableObjectState
pub fn accept_web_socket(&self, ws: &WebSocket)
pub fn get_websockets(&self) -> Vec<WebSocket>
pub fn get_websockets_with_tag(&self, tag: &str) -> Vec<WebSocket>
Retrieve tags from a hibernatable websocket
pub fn set_websocket_auto_response(&self, pair: &WebSocketRequestResponsePair)
pub fn get_websocket_auto_response( &self, ) -> Option<WebSocketRequestResponsePair>
Trait Implementations§
Source§impl From<DurableObjectState> for State
impl From<DurableObjectState> for State
Source§fn from(o: DurableObjectState) -> Self
fn from(o: DurableObjectState) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl Freeze for State
impl RefUnwindSafe for State
impl !Send for State
impl !Sync for State
impl Unpin for State
impl UnwindSafe for State
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