#[repr(transparent)]pub struct Function<'scope, 'data> { /* private fields */ }
Expand description
A Julia function.
Implementations
Trait Implementations
sourceimpl<'data> Call<'data> for Function<'_, 'data>
impl<'data> Call<'data> for Function<'_, 'data>
sourceunsafe fn call0<'target, S>(
self,
scope: S
) -> JlrsResult<JuliaResult<'target, 'data>> where
S: PartialScope<'target>,
unsafe fn call0<'target, S>(
self,
scope: S
) -> JlrsResult<JuliaResult<'target, 'data>> where
S: PartialScope<'target>,
Call a function with no arguments and root the result in scope
. Read more
sourceunsafe fn call1<'target, S>(
self,
scope: S,
arg0: Value<'_, 'data>
) -> JlrsResult<JuliaResult<'target, 'data>> where
S: PartialScope<'target>,
unsafe fn call1<'target, S>(
self,
scope: S,
arg0: Value<'_, 'data>
) -> JlrsResult<JuliaResult<'target, 'data>> where
S: PartialScope<'target>,
Call a function with one argument and root the result in scope
. Read more
sourceunsafe fn call2<'target, S>(
self,
scope: S,
arg0: Value<'_, 'data>,
arg1: Value<'_, 'data>
) -> JlrsResult<JuliaResult<'target, 'data>> where
S: PartialScope<'target>,
unsafe fn call2<'target, S>(
self,
scope: S,
arg0: Value<'_, 'data>,
arg1: Value<'_, 'data>
) -> JlrsResult<JuliaResult<'target, 'data>> where
S: PartialScope<'target>,
Call a function with two arguments and root the result in scope
. Read more
sourceunsafe fn call3<'target, S>(
self,
scope: S,
arg0: Value<'_, 'data>,
arg1: Value<'_, 'data>,
arg2: Value<'_, 'data>
) -> JlrsResult<JuliaResult<'target, 'data>> where
S: PartialScope<'target>,
unsafe fn call3<'target, S>(
self,
scope: S,
arg0: Value<'_, 'data>,
arg1: Value<'_, 'data>,
arg2: Value<'_, 'data>
) -> JlrsResult<JuliaResult<'target, 'data>> where
S: PartialScope<'target>,
Call a function with three arguments and root the result in scope
. Read more
sourceunsafe fn call<'target, 'value, V, S>(
self,
scope: S,
args: V
) -> JlrsResult<JuliaResult<'target, 'data>> where
V: AsRef<[Value<'value, 'data>]>,
S: PartialScope<'target>,
unsafe fn call<'target, 'value, V, S>(
self,
scope: S,
args: V
) -> JlrsResult<JuliaResult<'target, 'data>> where
V: AsRef<[Value<'value, 'data>]>,
S: PartialScope<'target>,
Call a function with an arbitrary number arguments and root the result in scope
. Read more
sourceunsafe fn call0_unrooted<'target>(
self,
global: Global<'target>
) -> JuliaResultRef<'target, 'data>
unsafe fn call0_unrooted<'target>(
self,
global: Global<'target>
) -> JuliaResultRef<'target, 'data>
Call a function with no arguments without rooting the result. Read more
sourceunsafe fn call1_unrooted<'target>(
self,
global: Global<'target>,
arg0: Value<'_, 'data>
) -> JuliaResultRef<'target, 'data>
unsafe fn call1_unrooted<'target>(
self,
global: Global<'target>,
arg0: Value<'_, 'data>
) -> JuliaResultRef<'target, 'data>
Call a function with one argument without rooting the result. Read more
sourceunsafe fn call2_unrooted<'target>(
self,
global: Global<'target>,
arg0: Value<'_, 'data>,
arg1: Value<'_, 'data>
) -> JuliaResultRef<'target, 'data>
unsafe fn call2_unrooted<'target>(
self,
global: Global<'target>,
arg0: Value<'_, 'data>,
arg1: Value<'_, 'data>
) -> JuliaResultRef<'target, 'data>
Call a function with two arguments without rooting the result. Read more
sourceunsafe fn call3_unrooted<'target>(
self,
global: Global<'target>,
arg0: Value<'_, 'data>,
arg1: Value<'_, 'data>,
arg2: Value<'_, 'data>
) -> JuliaResultRef<'target, 'data>
unsafe fn call3_unrooted<'target>(
self,
global: Global<'target>,
arg0: Value<'_, 'data>,
arg1: Value<'_, 'data>,
arg2: Value<'_, 'data>
) -> JuliaResultRef<'target, 'data>
Call a function with three arguments without rooting the result. Read more
sourceunsafe fn call_unrooted<'target, 'value, V>(
self,
global: Global<'target>,
args: V
) -> JuliaResultRef<'target, 'data> where
V: AsRef<[Value<'value, 'data>]>,
unsafe fn call_unrooted<'target, 'value, V>(
self,
global: Global<'target>,
args: V
) -> JuliaResultRef<'target, 'data> where
V: AsRef<[Value<'value, 'data>]>,
Call a function with an abitrary number of arguments without rooting the result. Read more
sourceimpl<'impl0, 'data> CallAsync<'data> for Function<'impl0, 'data>
impl<'impl0, 'data> CallAsync<'data> for Function<'impl0, 'data>
sourceunsafe fn call_async<'frame, 'value, 'life0, 'async_trait, V>(
self,
frame: &'life0 mut AsyncGcFrame<'frame>,
args: V
) -> Pin<Box<dyn Future<Output = JlrsResult<JuliaResult<'frame, 'data>>> + 'async_trait>> where
V: AsRef<[Value<'value, 'data>]>,
'frame: 'async_trait,
'value: 'async_trait,
V: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
unsafe fn call_async<'frame, 'value, 'life0, 'async_trait, V>(
self,
frame: &'life0 mut AsyncGcFrame<'frame>,
args: V
) -> Pin<Box<dyn Future<Output = JlrsResult<JuliaResult<'frame, 'data>>> + 'async_trait>> where
V: AsRef<[Value<'value, 'data>]>,
'frame: 'async_trait,
'value: 'async_trait,
V: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
Call a function on another thread with the given arguments. This method uses
Base.Threads.@spawn
to call the given function on another thread but return immediately.
While await
ing the result the async runtime can work on other tasks, the current task
resumes after the function call on the other thread completes. Read more
sourceunsafe fn schedule_async<'frame, 'value, V>(
self,
frame: &mut AsyncGcFrame<'frame>,
args: V
) -> JlrsResult<JuliaResult<'frame, 'data, Task<'frame>>> where
V: AsRef<[Value<'value, 'data>]>,
unsafe fn schedule_async<'frame, 'value, V>(
self,
frame: &mut AsyncGcFrame<'frame>,
args: V
) -> JlrsResult<JuliaResult<'frame, 'data, Task<'frame>>> where
V: AsRef<[Value<'value, 'data>]>,
Does the same thing as CallAsync::call_async
, but the task is returned rather than an
awaitable Future
. This method should only be called in PersistentTask::init
,
otherwise it’s not guaranteed this task can make progress. Read more
sourceunsafe fn call_async_local<'frame, 'value, 'life0, 'async_trait, V>(
self,
frame: &'life0 mut AsyncGcFrame<'frame>,
args: V
) -> Pin<Box<dyn Future<Output = JlrsResult<JuliaResult<'frame, 'data>>> + 'async_trait>> where
V: AsRef<[Value<'value, 'data>]>,
'frame: 'async_trait,
'value: 'async_trait,
V: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
unsafe fn call_async_local<'frame, 'value, 'life0, 'async_trait, V>(
self,
frame: &'life0 mut AsyncGcFrame<'frame>,
args: V
) -> Pin<Box<dyn Future<Output = JlrsResult<JuliaResult<'frame, 'data>>> + 'async_trait>> where
V: AsRef<[Value<'value, 'data>]>,
'frame: 'async_trait,
'value: 'async_trait,
V: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
Call a function with the given arguments in an @async
block. Like call_async
, the
function is not called on the main thread, but on a separate thread that handles all
tasks created by this method. This method should only be used with functions that do very
little computational work but mostly spend their time waiting on IO. Read more
sourceunsafe fn schedule_async_local<'frame, 'value, V>(
self,
frame: &mut AsyncGcFrame<'frame>,
args: V
) -> JlrsResult<JuliaResult<'frame, 'data, Task<'frame>>> where
V: AsRef<[Value<'value, 'data>]>,
unsafe fn schedule_async_local<'frame, 'value, V>(
self,
frame: &mut AsyncGcFrame<'frame>,
args: V
) -> JlrsResult<JuliaResult<'frame, 'data, Task<'frame>>> where
V: AsRef<[Value<'value, 'data>]>,
Does the same thing as CallAsync::call_async_local
, but the task is returned rather
than an awaitable Future
. This method should only be called in PersistentTask::init
,
otherwise it’s not guaranteed this task can make progress. Read more
sourceunsafe fn call_async_main<'frame, 'value, 'life0, 'async_trait, V>(
self,
frame: &'life0 mut AsyncGcFrame<'frame>,
args: V
) -> Pin<Box<dyn Future<Output = JlrsResult<JuliaResult<'frame, 'data>>> + 'async_trait>> where
V: AsRef<[Value<'value, 'data>]>,
'frame: 'async_trait,
'value: 'async_trait,
V: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
unsafe fn call_async_main<'frame, 'value, 'life0, 'async_trait, V>(
self,
frame: &'life0 mut AsyncGcFrame<'frame>,
args: V
) -> Pin<Box<dyn Future<Output = JlrsResult<JuliaResult<'frame, 'data>>> + 'async_trait>> where
V: AsRef<[Value<'value, 'data>]>,
'frame: 'async_trait,
'value: 'async_trait,
V: 'async_trait,
'life0: 'async_trait,
Self: 'async_trait,
Call a function with the given arguments in an @async
block. The task is scheduled on
the main thread. This method should only be used with functions that must run on the main
thread. The runtime is blocked while this task is active. Read more
sourceunsafe fn schedule_async_main<'frame, 'value, V>(
self,
frame: &mut AsyncGcFrame<'frame>,
args: V
) -> JlrsResult<JuliaResult<'frame, 'data, Task<'frame>>> where
V: AsRef<[Value<'value, 'data>]>,
unsafe fn schedule_async_main<'frame, 'value, V>(
self,
frame: &mut AsyncGcFrame<'frame>,
args: V
) -> JlrsResult<JuliaResult<'frame, 'data, Task<'frame>>> where
V: AsRef<[Value<'value, 'data>]>,
Does the same thing as CallAsync::call_async_main
, but the task is returned rather
than an awaitable Future
. This method should only be called in PersistentTask::init
,
otherwise it’s not guaranteed this task can make progress. Read more
sourceimpl<'value, 'data> ProvideKeywords<'value, 'data> for Function<'value, 'data>
impl<'value, 'data> ProvideKeywords<'value, 'data> for Function<'value, 'data>
sourcefn provide_keywords(
self,
kws: Value<'value, 'data>
) -> JlrsResult<WithKeywords<'value, 'data>>
fn provide_keywords(
self,
kws: Value<'value, 'data>
) -> JlrsResult<WithKeywords<'value, 'data>>
Provide keyword arguments to the function. The keyword arguments must be a NamedTuple
. Read more
impl<'scope, 'data> Copy for Function<'scope, 'data>
impl Typecheck for Function<'_, '_>
Auto Trait Implementations
impl<'scope, 'data> RefUnwindSafe for Function<'scope, 'data>
impl<'scope, 'data> !Send for Function<'scope, 'data>
impl<'scope, 'data> !Sync for Function<'scope, 'data>
impl<'scope, 'data> Unpin for Function<'scope, 'data>
impl<'scope, 'data> UnwindSafe for Function<'scope, 'data>
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<'scope, 'data, W> Wrapper<'scope, 'data> for W where
W: WrapperPriv<'scope, 'data>,
impl<'scope, 'data, W> Wrapper<'scope, 'data> for W where
W: WrapperPriv<'scope, 'data>,
sourcefn display_string(self) -> JlrsResult<String>
fn display_string(self) -> JlrsResult<String>
Convert the wrapper to its display string, i.e. the string that is shown when calling
Base.show
. Read more
sourcefn error_string(self) -> JlrsResult<String>
fn error_string(self) -> JlrsResult<String>
Convert the wrapper to its error string, i.e. the string that is shown when calling
Base.showerror
. This string can contain ANSI color codes if this is enabled by calling
Julia::error_color
, AsyncJulia::error_color
, or AsyncJulia::try_error_color
, . Read more