pub struct Fun<'id> { /* private fields */ }Expand description
An Erlang fun (closure or function reference).
The NIF API provides no inspection of fun contents. A Fun can only be
held and passed back to Erlang, or used as an argument to apply.
Implementations§
Trait Implementations§
impl<'id> Copy for Fun<'id>
Source§impl<'id> Encoder<'id> for Fun<'id>
Encodes for free by rewrapping the term’s own machine word — an otter
term is already an Erlang term. Never fails.
impl<'id> Encoder<'id> for Fun<'id>
Encodes for free by rewrapping the term’s own machine word — an otter term is already an Erlang term. Never fails.
impl Eq for Fun<'_>
Source§impl Ord for Fun<'_>
impl Ord for Fun<'_>
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for Fun<'_>
impl PartialOrd for Fun<'_>
Source§impl<'id> Term<'id> for Fun<'id>
impl<'id> Term<'id> for Fun<'id>
Source§fn copy_to<'dst>(self, env: impl Env<'dst>) -> AnyTerm<'dst>where
Self: Sized,
fn copy_to<'dst>(self, env: impl Env<'dst>) -> AnyTerm<'dst>where
Self: Sized,
Copy this term into another environment (
enif_make_copy), producing a
term branded to the destination. The general cross-env copy — distinct
from same-brand Encoder (which wraps for free)
and from OwnedEnvArena copy_out (the arena exit).Auto Trait Implementations§
impl<'id> !Send for Fun<'id>
impl<'id> !Sync for Fun<'id>
impl<'id> Freeze for Fun<'id>
impl<'id> RefUnwindSafe for Fun<'id>
impl<'id> Unpin for Fun<'id>
impl<'id> UnsafeUnpin for Fun<'id>
impl<'id> UnwindSafe for Fun<'id>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more