Skip to main content

TermType

Enum TermType 

Source
#[repr(i32)]
pub enum TermType { Atom = 1, Bitstring = 2, Float = 3, Fun = 4, Integer = 5, List = 6, Map = 7, Pid = 8, Port = 9, Reference = 10, Tuple = 11, }
Expand description

The canonical term types returned by term_type.

The C header reserves a -1 sentinel and may add new types, so an unrecognized code must never be transmuted into this enum.

ErlNifTermType — NIF 2.15 — OTP 22

Variants§

§

Atom = 1

Matches an atom.

ERL_NIF_TERM_TYPE_ATOM — NIF 2.15 — OTP 22

§

Bitstring = 2

Matches a bitstring (binaries included).

ERL_NIF_TERM_TYPE_BITSTRING — NIF 2.15 — OTP 22

§

Float = 3

Matches a float.

ERL_NIF_TERM_TYPE_FLOAT — NIF 2.15 — OTP 22

§

Fun = 4

Matches a fun.

ERL_NIF_TERM_TYPE_FUN — NIF 2.15 — OTP 22

§

Integer = 5

Matches an integer.

ERL_NIF_TERM_TYPE_INTEGER — NIF 2.15 — OTP 22

§

List = 6

Matches a list (the empty list included).

ERL_NIF_TERM_TYPE_LIST — NIF 2.15 — OTP 22

§

Map = 7

Matches a map.

ERL_NIF_TERM_TYPE_MAP — NIF 2.15 — OTP 22

§

Pid = 8

Matches a pid.

ERL_NIF_TERM_TYPE_PID — NIF 2.15 — OTP 22

§

Port = 9

Matches a port.

ERL_NIF_TERM_TYPE_PORT — NIF 2.15 — OTP 22

§

Reference = 10

Matches a reference.

ERL_NIF_TERM_TYPE_REFERENCE — NIF 2.15 — OTP 22

§

Tuple = 11

Matches a tuple.

ERL_NIF_TERM_TYPE_TUPLE — NIF 2.15 — OTP 22

Implementations§

Source§

impl TermType

Source

pub fn from_raw(code: c_int) -> Option<Self>

Map a raw term_type return code to a known variant, or None for any code outside the canonical 1..=11 (an unknown/future term type).

Trait Implementations§

Source§

impl Clone for TermType

Source§

fn clone(&self) -> TermType

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Copy for TermType

Source§

impl Debug for TermType

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for TermType

Source§

impl PartialEq for TermType

Source§

fn eq(&self, other: &TermType) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for TermType

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.