Struct jlrs::memory::frame::AsyncGcFrame[][src]

pub struct AsyncGcFrame<'frame> { /* fields omitted */ }

A frame that can be used to root values and dispatch Julia function calls to another thread with Value::call_async. An AsyncGcFrame is available by implementing the JuliaTask trait, this struct provides create a nested async scope.

Roots are stored in slots, each slot can contain one root. Frames created with slots will preallocate that number of slots. Frames created without slots will dynamically create new slots as needed. A frame is able to create at least 16 slots. If there is sufficient capacity available, a new frame will use this remaining capacity. If the capacity is insufficient, more stack space is allocated.

Implementations

impl<'frame> AsyncGcFrame<'frame>[src]

pub async fn async_value_scope<'nested, 'data, F, G>(
    &'nested mut self,
    func: F
) -> JlrsResult<Value<'frame, 'data>> where
    G: Future<Output = JlrsResult<UnrootedValue<'frame, 'data, 'nested>>>,
    F: FnOnce(Output<'frame>, &'nested mut AsyncGcFrame<'nested>) -> G, 
[src]

An async version of value_scope. Rather than a closure, it takes an async closure that provides a new AsyncGcFrame.

pub async fn async_value_scope_with_slots<'nested, 'data, F, G>(
    &'nested mut self,
    capacity: usize,
    func: F
) -> JlrsResult<Value<'frame, 'data>> where
    G: Future<Output = JlrsResult<UnrootedValue<'frame, 'data, 'nested>>>,
    F: FnOnce(Output<'frame>, &'nested mut AsyncGcFrame<'nested>) -> G, 
[src]

An async version of value_scope_with_slots. Rather than a closure, it takes an async closure that provides a new AsyncGcFrame.

pub async fn async_result_scope<'nested, 'data, F, G>(
    &'nested mut self,
    func: F
) -> JlrsResult<JuliaResult<'frame, 'data>> where
    G: Future<Output = JlrsResult<UnrootedResult<'frame, 'data, 'nested>>>,
    F: FnOnce(Output<'frame>, &'nested mut AsyncGcFrame<'nested>) -> G, 
[src]

An async version of result_scope. Rather than a closure, it takes an async closure that provides a new AsyncGcFrame.

pub async fn async_result_scope_with_slots<'nested, 'data, F, G>(
    &'nested mut self,
    capacity: usize,
    func: F
) -> JlrsResult<JuliaResult<'frame, 'data>> where
    G: Future<Output = JlrsResult<UnrootedResult<'frame, 'data, 'nested>>>,
    F: FnOnce(Output<'frame>, &'nested mut AsyncGcFrame<'nested>) -> G, 
[src]

An async version of result_scope_with_slots. Rather than a closure, it takes an async closure that provides a new AsyncGcFrame.

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(&'nested mut AsyncGcFrame<'nested>) -> G, 
[src]

An async version of frame. Rather than a closure, it takes an async closure that provides a new AsyncGcFrame.

pub async fn async_scope_with_slots<'nested, T, F, G>(
    &'nested mut self,
    capacity: usize,
    func: F
) -> JlrsResult<T> where
    T: 'frame,
    G: Future<Output = JlrsResult<T>>,
    F: FnOnce(&'nested mut AsyncGcFrame<'nested>) -> G, 
[src]

An async version of scope_with_slots. Rather than a closure, it takes an async closure that provides a new AsyncGcFrame.

pub fn n_roots(&self) -> usize[src]

Returns the number of values currently rooted in this frame.

pub fn n_slots(&self) -> usize[src]

Returns the number of slots that are currently allocated to this frame.

pub fn capacity(&self) -> usize[src]

Returns the maximum number of slots this frame can use.

pub fn alloc_slots(&mut self, additional: usize) -> bool[src]

Try to allocate additional slots in the current frame. Returns true on success, or false if self.n_slots() + additional > self.capacity().

Trait Implementations

impl<'frame> Drop for AsyncGcFrame<'frame>[src]

impl<'frame> Frame<'frame> for AsyncGcFrame<'frame>[src]

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

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<'frame, T> Gc for T where
    T: Frame<'frame>, 
[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.