Struct deno_core::AsyncRefCell
source · pub struct AsyncRefCell<T> { /* private fields */ }
Implementations§
source§impl<T> AsyncRefCell<T>
impl<T> AsyncRefCell<T>
sourcepub fn borrow_sync<M: BorrowModeTrait, R: RcLike<AsyncRefCell<T>>>(
cell: R
) -> Option<AsyncBorrowImpl<T, M>>
pub fn borrow_sync<M: BorrowModeTrait, R: RcLike<AsyncRefCell<T>>>(
cell: R
) -> Option<AsyncBorrowImpl<T, M>>
Borrow the cell’s contents synchronouslym without creating an
intermediate future. If the cell has already been borrowed and either
the existing or the requested borrow is exclusive, this function returns
None
.
source§impl<T: 'static> AsyncRefCell<T>
impl<T: 'static> AsyncRefCell<T>
sourcepub fn new(value: T) -> Self
pub fn new(value: T) -> Self
Create a new AsyncRefCell
that encapsulates the specified value.
Note that in order to borrow the inner value, the AsyncRefCell
needs to be wrapped in an Rc
or an RcRef
. These can be created
either manually, or by using the convenience method
AsyncRefCell::new_rc()
.