Struct janetrs::function::JanetFunction [−][src]
#[repr(transparent)]pub struct JanetFunction<'data> { /* fields omitted */ }
Expand description
A representation of a Janet function defined at the Janet side.
Implementations
impl<'data> JanetFunction<'data>
[src]
impl<'data> JanetFunction<'data>
[src]pub const unsafe fn from_raw(raw: *mut CJanetFunction) -> Self
[src]
pub const unsafe fn from_raw(raw: *mut CJanetFunction) -> Self
[src]Create a new JanetFunction
with a raw
pointer.
Safety
This function do not check if the given raw
is NULL
or not. Use at your
own risk.
pub fn call(
&mut self,
args: impl AsRef<[Janet]>
) -> Result<Janet, CallError<'data>>
[src]
pub fn call(
&mut self,
args: impl AsRef<[Janet]>
) -> Result<Janet, CallError<'data>>
[src]Execute the JanetFunction
with the given arguments.
This function may trigger a GC collection.
If the executions was successful returns the output, otherwise return the
CallError
with information returned by the call.
pub fn call_with_fiber<'fiber>(
&mut self,
fiber: JanetFiber<'fiber>,
args: impl AsRef<[Janet]>
) -> Result<Janet, CallError<'fiber>>
[src]
pub fn call_with_fiber<'fiber>(
&mut self,
fiber: JanetFiber<'fiber>,
args: impl AsRef<[Janet]>
) -> Result<Janet, CallError<'fiber>>
[src]Execute the JanetFunction
with the given arguments wising the given fiber
.
This function may trigger the a GC collection.
If the executions was successful returns the output, otherwise return the
CallError
with information returned by the call.
pub fn call_or_panic(&mut self, args: impl AsRef<[Janet]>) -> Janet
[src]
pub fn call_or_panic(&mut self, args: impl AsRef<[Janet]>) -> Janet
[src]Execute the JanetFunction
with the given arguments.
This function can not trigger GC collection.
Janet Panics
Panics if anything goes wrong trying to call the function.
pub const fn as_raw(&self) -> *const CJanetFunction
[src]
pub const fn as_raw(&self) -> *const CJanetFunction
[src]Return a raw pointer to the function raw structure.
The caller must ensure that the function outlives the pointer this function returns, or else it will end up pointing to garbage.
pub fn as_mut_raw(&mut self) -> *mut CJanetFunction
[src]
pub fn as_mut_raw(&mut self) -> *mut CJanetFunction
[src]Return a raw mutable pointer to the function raw structure.
The caller must ensure that the function outlives the pointer this function returns, or else it will end up pointing to garbage.
Trait Implementations
impl Debug for JanetFunction<'_>
[src]
impl Debug for JanetFunction<'_>
[src]impl From<JanetFunction<'_>> for Janet
[src]
impl From<JanetFunction<'_>> for Janet
[src]fn from(val: JanetFunction<'_>) -> Self
[src]
fn from(val: JanetFunction<'_>) -> Self
[src]Performs the conversion.
impl<'data> Ord for JanetFunction<'data>
[src]
impl<'data> Ord for JanetFunction<'data>
[src]impl<'data> PartialEq<JanetFunction<'data>> for JanetFunction<'data>
[src]
impl<'data> PartialEq<JanetFunction<'data>> for JanetFunction<'data>
[src]fn eq(&self, other: &JanetFunction<'data>) -> bool
[src]
fn eq(&self, other: &JanetFunction<'data>) -> bool
[src]This method tests for self
and other
values to be equal, and is used
by ==
. Read more
fn ne(&self, other: &JanetFunction<'data>) -> bool
[src]
fn ne(&self, other: &JanetFunction<'data>) -> bool
[src]This method tests for !=
.
impl<'data> PartialOrd<JanetFunction<'data>> for JanetFunction<'data>
[src]
impl<'data> PartialOrd<JanetFunction<'data>> for JanetFunction<'data>
[src]fn partial_cmp(&self, other: &JanetFunction<'data>) -> Option<Ordering>
[src]
fn partial_cmp(&self, other: &JanetFunction<'data>) -> Option<Ordering>
[src]This method returns an ordering between self
and other
values if one exists. Read more
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn lt(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than (for self
and other
) and is used by the <
operator. Read more
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]fn le(&self, other: &Rhs) -> bool
1.0.0[src]This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
impl TryFrom<Janet> for JanetFunction<'_>
[src]
impl TryFrom<Janet> for JanetFunction<'_>
[src]