pub struct AsyncGcFrame<'frame> { /* private fields */ }
Expand description
A frame that can be used to root Julia data and call async methods.
Frames created with a capacity can store at least that number of roots. A frame’s capacity is at least 16.
Implementations
sourceimpl<'frame> AsyncGcFrame<'frame>
impl<'frame> AsyncGcFrame<'frame>
sourcepub async fn async_scope<'nested, T, F, G>(
&'nested mut self,
func: F
) -> JlrsResult<T> where
T: 'frame,
G: Future<Output = JlrsResult<T>>,
F: FnOnce(AsyncGcFrame<'nested>) -> G,
pub async fn async_scope<'nested, T, F, G>(
&'nested mut self,
func: F
) -> JlrsResult<T> where
T: 'frame,
G: Future<Output = JlrsResult<T>>,
F: FnOnce(AsyncGcFrame<'nested>) -> G,
An async version of Frame::scope
.
The closure func
must return an async block. Note that the returned value is
required to live at least as long the current frame.
sourcepub async fn async_scope_with_capacity<'nested, T, F, G>(
&'nested mut self,
capacity: usize,
func: F
) -> JlrsResult<T> where
T: 'frame,
G: Future<Output = JlrsResult<T>>,
F: FnOnce(AsyncGcFrame<'nested>) -> G,
pub async fn async_scope_with_capacity<'nested, T, F, G>(
&'nested mut self,
capacity: usize,
func: F
) -> JlrsResult<T> where
T: 'frame,
G: Future<Output = JlrsResult<T>>,
F: FnOnce(AsyncGcFrame<'nested>) -> G,
An async version of Frame::scope_with_capacity
.
The closure func
must return an async block. Note that the returned value is
required to live at least as long the current frame.
sourcepub async unsafe fn relaxed_async_scope<'nested, T, F, G>(
&'nested mut self,
func: F
) -> JlrsResult<T> where
T: 'nested,
G: Future<Output = JlrsResult<T>>,
F: FnOnce(AsyncGcFrame<'nested>) -> G,
pub async unsafe fn relaxed_async_scope<'nested, T, F, G>(
&'nested mut self,
func: F
) -> JlrsResult<T> where
T: 'nested,
G: Future<Output = JlrsResult<T>>,
F: FnOnce(AsyncGcFrame<'nested>) -> G,
AsyncFrame::async_scope
with less strict lifeitme bounds on the return value.
Safety: because this method only requires that the returned data lives at least as
long as the borow of self
, it’s possible to return data rooted in that scope.
sourcepub async unsafe fn relaxed_async_scope_with_capacity<'nested, T, F, G>(
&'nested mut self,
capacity: usize,
func: F
) -> JlrsResult<T> where
T: 'nested,
G: Future<Output = JlrsResult<T>>,
F: for<'n> FnOnce(AsyncGcFrame<'n>) -> G,
pub async unsafe fn relaxed_async_scope_with_capacity<'nested, T, F, G>(
&'nested mut self,
capacity: usize,
func: F
) -> JlrsResult<T> where
T: 'nested,
G: Future<Output = JlrsResult<T>>,
F: for<'n> FnOnce(AsyncGcFrame<'n>) -> G,
AsyncFrame::async_scope_wit_capacity
with less strict lifeitme bounds on the
return value.
Safety: because this method only requires that the returned data lives at least as
long as the borow of self
, it’s possible to return data rooted in that scope.
Trait Implementations
sourceimpl<'frame> Frame<'frame> for AsyncGcFrame<'frame>
impl<'frame> Frame<'frame> for AsyncGcFrame<'frame>
sourcefn reusable_slot(&mut self) -> JlrsResult<ReusableSlot<'frame>>
fn reusable_slot(&mut self) -> JlrsResult<ReusableSlot<'frame>>
Reserve a new reusable slot in the current frame. Read more
sourcefn capacity(&self) -> usize
fn capacity(&self) -> usize
Returns the maximum number of values that can be rooted in this frame.
sourcefn output(&mut self) -> JlrsResult<Output<'frame>>
fn output(&mut self) -> JlrsResult<Output<'frame>>
Reserve a new output in the current frame. Read more
sourcefn scope<T, F>(&mut self, func: F) -> JlrsResult<T> where
for<'inner> F: FnOnce(GcFrame<'inner, Self::Mode>) -> JlrsResult<T>,
fn scope<T, F>(&mut self, func: F) -> JlrsResult<T> where
for<'inner> F: FnOnce(GcFrame<'inner, Self::Mode>) -> JlrsResult<T>,
Create a new scope and call func with that scope’s frame. Read more
sourcefn scope_with_capacity<T, F>(&mut self, capacity: usize, func: F) -> JlrsResult<T> where
for<'inner> F: FnOnce(GcFrame<'inner, Self::Mode>) -> JlrsResult<T>,
fn scope_with_capacity<T, F>(&mut self, capacity: usize, func: F) -> JlrsResult<T> where
for<'inner> F: FnOnce(GcFrame<'inner, Self::Mode>) -> JlrsResult<T>,
Create a new scope and call func with that scope’s frame. Read more
Auto Trait Implementations
impl<'frame> !RefUnwindSafe for AsyncGcFrame<'frame>
impl<'frame> !Send for AsyncGcFrame<'frame>
impl<'frame> !Sync for AsyncGcFrame<'frame>
impl<'frame> Unpin for AsyncGcFrame<'frame>
impl<'frame> !UnwindSafe for AsyncGcFrame<'frame>
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<'frame, T> Gc for T where
T: Frame<'frame>,
impl<'frame, T> Gc for T where
T: Frame<'frame>,
sourcefn enable_gc_logging(&mut self, on: bool)
fn enable_gc_logging(&mut self, on: bool)
Enable or disable GC logging. Read more
sourcefn gc_is_enabled(&mut self) -> bool
fn gc_is_enabled(&mut self) -> bool
Returns true
if the GC is enabled.
sourcefn gc_collect(&mut self, mode: GcCollection)
fn gc_collect(&mut self, mode: GcCollection)
Force a collection.
sourcefn gc_safepoint(&mut self)
fn gc_safepoint(&mut self)
Insert a safepoint, a point where the garbage collector may run.