pub trait Call<'data>: CallPriv {
// Required methods
unsafe fn call0<'target, T>(
self,
target: T
) -> ValueResult<'target, 'data, T>
where T: Target<'target>;
unsafe fn call_unchecked<'target, 'value, V, Tgt, const N: usize>(
self,
target: Tgt,
args: V
) -> ValueData<'target, 'data, Tgt>
where V: Values<'value, 'data, N>,
Tgt: Target<'target>;
unsafe fn call1<'target, T>(
self,
target: T,
arg0: Value<'_, 'data>
) -> ValueResult<'target, 'data, T>
where T: Target<'target>;
unsafe fn call2<'target, T>(
self,
target: T,
arg0: Value<'_, 'data>,
arg1: Value<'_, 'data>
) -> ValueResult<'target, 'data, T>
where T: Target<'target>;
unsafe fn call3<'target, T>(
self,
target: T,
arg0: Value<'_, 'data>,
arg1: Value<'_, 'data>,
arg2: Value<'_, 'data>
) -> ValueResult<'target, 'data, T>
where T: Target<'target>;
unsafe fn call<'target, 'value, V, T, const N: usize>(
self,
target: T,
args: V
) -> ValueResult<'target, 'data, T>
where V: Values<'value, 'data, N>,
T: Target<'target>;
// Provided method
unsafe fn call_tracked<'target, 'value, V, T>(
self,
target: T,
args: V
) -> JlrsResult<ValueResult<'target, 'data, T>>
where V: AsRef<[Value<'value, 'data>]>,
T: Target<'target> { ... }
}
Expand description
Call the implementor as a Julia function.
There are currently four types that implement this trait: Value
, Function
,
WithKeywords
, and OpaqueClosure
if the internal-types
feature is enabled. Because
Value
implements this trait it’s not necessary to cast it before calling it.
Constructors can be called with the methods defined by this trait, both the inner and outer
constructors of a DataType
can be called by converting the DataType
to a Value
and
calling it.
All of these methods are unsafe, arbitrary Julia functions can’t be checked for correctness.
More information can be found in the safety
module.
Required Methods§
sourceunsafe fn call0<'target, T>(self, target: T) -> ValueResult<'target, 'data, T>where
T: Target<'target>,
unsafe fn call0<'target, T>(self, target: T) -> ValueResult<'target, 'data, T>where
T: Target<'target>,
Call a function with no arguments.
Safety: this method lets you call arbitrary Julia functions which can’t be checked for
correctness. More information can be found in the safety
module.
unsafe fn call_unchecked<'target, 'value, V, Tgt, const N: usize>( self, target: Tgt, args: V ) -> ValueData<'target, 'data, Tgt>
sourceunsafe fn call1<'target, T>(
self,
target: T,
arg0: Value<'_, 'data>
) -> ValueResult<'target, 'data, T>where
T: Target<'target>,
unsafe fn call1<'target, T>(
self,
target: T,
arg0: Value<'_, 'data>
) -> ValueResult<'target, 'data, T>where
T: Target<'target>,
Call a function with one argument.
Safety: this method lets you call arbitrary Julia functions which can’t be checked for
correctness. More information can be found in the safety
module. This method doesn’t
check if the argument is currently borrowed from Rust.
sourceunsafe fn call2<'target, T>(
self,
target: T,
arg0: Value<'_, 'data>,
arg1: Value<'_, 'data>
) -> ValueResult<'target, 'data, T>where
T: Target<'target>,
unsafe fn call2<'target, T>(
self,
target: T,
arg0: Value<'_, 'data>,
arg1: Value<'_, 'data>
) -> ValueResult<'target, 'data, T>where
T: Target<'target>,
Call a function with two arguments.
Safety: this method lets you call arbitrary Julia functions which can’t be checked for
correctness. More information can be found in the safety
module. This method doesn’t
check if any of the arguments is currently borrowed from Rust.
sourceunsafe fn call3<'target, T>(
self,
target: T,
arg0: Value<'_, 'data>,
arg1: Value<'_, 'data>,
arg2: Value<'_, 'data>
) -> ValueResult<'target, 'data, T>where
T: Target<'target>,
unsafe fn call3<'target, T>(
self,
target: T,
arg0: Value<'_, 'data>,
arg1: Value<'_, 'data>,
arg2: Value<'_, 'data>
) -> ValueResult<'target, 'data, T>where
T: Target<'target>,
Call a function with three arguments.
Safety: this method lets you call arbitrary Julia functions which can’t be checked for
correctness. More information can be found in the safety
module. This method doesn’t
check if any of the arguments is currently borrowed from Rust.
sourceunsafe fn call<'target, 'value, V, T, const N: usize>(
self,
target: T,
args: V
) -> ValueResult<'target, 'data, T>
unsafe fn call<'target, 'value, V, T, const N: usize>( self, target: T, args: V ) -> ValueResult<'target, 'data, T>
Call a function with an arbitrary number arguments.
Safety: this method lets you call arbitrary Julia functions which can’t be checked for
correctness. More information can be found in the safety
module. This method doesn’t
check if any of the arguments is currently borrowed from Rust.
Provided Methods§
sourceunsafe fn call_tracked<'target, 'value, V, T>(
self,
target: T,
args: V
) -> JlrsResult<ValueResult<'target, 'data, T>>
unsafe fn call_tracked<'target, 'value, V, T>( self, target: T, args: V ) -> JlrsResult<ValueResult<'target, 'data, T>>
Call a function with an arbitrary number arguments.
Unlike the other methods of this trait, this method checks if any of the arguments is
currently borrowed from Rust, and returns an AccessError::BorrowError
if any of the
arguments is.
Safety: this method lets you call arbitrary Julia functions which can’t be checked for
correctness. More information can be found in the safety
module.