Trait jlrs::wrappers::ptr::call::Call [−][src]
pub trait Call<'data>: Call { unsafe fn call0<'target, 'current, S, F>(
self,
scope: S
) -> JlrsResult<S::JuliaResult>
where
S: Scope<'target, 'current, 'data, F>,
F: Frame<'current>; unsafe fn call1<'target, 'current, S, F>(
self,
scope: S,
arg0: Value<'_, 'data>
) -> JlrsResult<S::JuliaResult>
where
S: Scope<'target, 'current, 'data, F>,
F: Frame<'current>; unsafe fn call2<'target, 'current, S, F>(
self,
scope: S,
arg0: Value<'_, 'data>,
arg1: Value<'_, 'data>
) -> JlrsResult<S::JuliaResult>
where
S: Scope<'target, 'current, 'data, F>,
F: Frame<'current>; unsafe fn call3<'target, 'current, S, F>(
self,
scope: S,
arg0: Value<'_, 'data>,
arg1: Value<'_, 'data>,
arg2: Value<'_, 'data>
) -> JlrsResult<S::JuliaResult>
where
S: Scope<'target, 'current, 'data, F>,
F: Frame<'current>; unsafe fn call<'target, 'current, 'value, V, S, F>(
self,
scope: S,
args: V
) -> JlrsResult<S::JuliaResult>
where
V: AsMut<[Value<'value, 'data>]>,
S: Scope<'target, 'current, 'data, F>,
F: Frame<'current>; unsafe fn call0_unrooted<'target>(
self,
_: Global<'target>
) -> JuliaResultRef<'target, 'data>; unsafe fn call1_unrooted<'target>(
self,
_: Global<'target>,
arg0: Value<'_, 'data>
) -> JuliaResultRef<'target, 'data>; unsafe fn call2_unrooted<'target>(
self,
_: Global<'target>,
arg0: Value<'_, 'data>,
arg1: Value<'_, 'data>
) -> JuliaResultRef<'target, 'data>; unsafe fn call3_unrooted<'target>(
self,
_: Global<'target>,
arg0: Value<'_, 'data>,
arg1: Value<'_, 'data>,
arg2: Value<'_, 'data>
) -> JuliaResultRef<'target, 'data>; unsafe fn call_unrooted<'target, 'value, V>(
self,
_: Global<'target>,
args: V
) -> JuliaResultRef<'target, 'data>
where
V: AsMut<[Value<'value, 'data>]>; }
Expand description
Call the implementor as a Julia function. There are currently three types that implement this
trait: Value
, Function
and WithKeywords
. In Julia every value can potentially be
callable as a function, there’s no general way to confirm if it is because not everything that
can be called is guaranteed to be a Function
.
Note that all of these methods are unsafe. There are several reasons for this. First and
foremost these methods let you call arbitrary Julia functions which can’t be checked for
correctness. If the second lifetime of an argument is not 'static
, it must never be assigned
to a global. If the function returns a task that performs IO, it’s not automatically
rescheduled.
Required methods
unsafe fn call0<'target, 'current, S, F>(
self,
scope: S
) -> JlrsResult<S::JuliaResult> where
S: Scope<'target, 'current, 'data, F>,
F: Frame<'current>,
unsafe fn call0<'target, 'current, S, F>(
self,
scope: S
) -> JlrsResult<S::JuliaResult> where
S: Scope<'target, 'current, 'data, F>,
F: Frame<'current>,
Call a function with no arguments and root the result in scope
.
Safety: this method lets you call arbitrary Julia functions which can’t be checked for
correctness. If the function returns a task that performs IO, it’s not automatically
rescheduled. If the scope is an OutputScope
, the result must be returned from the
closure immediately.
Call a function with one argument and root the result in scope
.
Safety: this method lets you call arbitrary Julia functions which can’t be checked for
correctness. If the second lifetime of an argument is not 'static
, it must never be
assigned to a global. If the function returns a task that performs IO, it’s not
automatically rescheduled. If the scope is an OutputScope
, the result must be returned
from the closure immediately.
Call a function with two arguments and root the result in scope
.
Safety: this method lets you call arbitrary Julia functions which can’t be checked for
correctness. If the second lifetime of an argument is not 'static
, it must never be
assigned to a global. If the function returns a task that performs IO, it’s not
automatically rescheduled. If the scope is an OutputScope
, the result must be returned
from the closure immediately.
Call a function with three arguments and root the result in scope
.
Safety: this method lets you call arbitrary Julia functions which can’t be checked for
correctness. If the second lifetime of an argument is not 'static
, it must never be
assigned to a global. If the function returns a task that performs IO, it’s not
automatically rescheduled. If the scope is an OutputScope
, the result must be returned
from the closure immediately.
Call a function with an arbitrary number arguments and root the result in scope
.
Safety: this method lets you call arbitrary Julia functions which can’t be checked for
correctness. If the second lifetime of an argument is not 'static
, it must never be
assigned to a global. If the function returns a task that performs IO, it’s not
automatically rescheduled. If the scope is an OutputScope
, the result must be returned
from the closure immediately.
unsafe fn call0_unrooted<'target>(
self,
_: Global<'target>
) -> JuliaResultRef<'target, 'data>
unsafe fn call0_unrooted<'target>(
self,
_: Global<'target>
) -> JuliaResultRef<'target, 'data>
Call a function with no arguments without rooting the result.
Safety: this method lets you call arbitrary Julia functions which can’t be checked for
correctness. If the function returns a task that performs IO, it’s not automatically
rescheduled. If the scope is an OutputScope
, the result must be returned from the
closure immediately.
unsafe fn call1_unrooted<'target>(
self,
_: Global<'target>,
arg0: Value<'_, 'data>
) -> JuliaResultRef<'target, 'data>
unsafe fn call1_unrooted<'target>(
self,
_: Global<'target>,
arg0: Value<'_, 'data>
) -> JuliaResultRef<'target, 'data>
Call a function with one argument without rooting the result.
Safety: this method lets you call arbitrary Julia functions which can’t be checked for
correctness. If the second lifetime of an argument is not 'static
, it must never be
assigned to a global. If the function returns a task that performs IO, it’s not
automatically rescheduled. If the scope is an OutputScope
, the result must be returned
from the closure immediately.
unsafe fn call2_unrooted<'target>(
self,
_: Global<'target>,
arg0: Value<'_, 'data>,
arg1: Value<'_, 'data>
) -> JuliaResultRef<'target, 'data>
unsafe fn call2_unrooted<'target>(
self,
_: Global<'target>,
arg0: Value<'_, 'data>,
arg1: Value<'_, 'data>
) -> JuliaResultRef<'target, 'data>
Call a function with two arguments without rooting the result.
Safety: this method lets you call arbitrary Julia functions which can’t be checked for
correctness. If the second lifetime of an argument is not 'static
, it must never be
assigned to a global. If the function returns a task that performs IO, it’s not
automatically rescheduled. If the scope is an OutputScope
, the result must be returned
from the closure immediately.
unsafe fn call3_unrooted<'target>(
self,
_: Global<'target>,
arg0: Value<'_, 'data>,
arg1: Value<'_, 'data>,
arg2: Value<'_, 'data>
) -> JuliaResultRef<'target, 'data>
unsafe fn call3_unrooted<'target>(
self,
_: Global<'target>,
arg0: Value<'_, 'data>,
arg1: Value<'_, 'data>,
arg2: Value<'_, 'data>
) -> JuliaResultRef<'target, 'data>
Call a function with three arguments without rooting the result.
Safety: this method lets you call arbitrary Julia functions which can’t be checked for
correctness. If the second lifetime of an argument is not 'static
, it must never be
assigned to a global. If the function returns a task that performs IO, it’s not
automatically rescheduled. If the scope is an OutputScope
, the result must be returned
from the closure immediately.
unsafe fn call_unrooted<'target, 'value, V>(
self,
_: Global<'target>,
args: V
) -> JuliaResultRef<'target, 'data> where
V: AsMut<[Value<'value, 'data>]>,
unsafe fn call_unrooted<'target, 'value, V>(
self,
_: Global<'target>,
args: V
) -> JuliaResultRef<'target, 'data> where
V: AsMut<[Value<'value, 'data>]>,
Call a function with an abitrary number of arguments without rooting the result.
Safety: this method lets you call arbitrary Julia functions which can’t be checked for
correctness. If the second lifetime of an argument is not 'static
, it must never be
assigned to a global. If the function returns a task that performs IO, it’s not
automatically rescheduled. If the scope is an OutputScope
, the result must be returned
from the closure immediately.