[][src]Struct rustler::types::atom::Atom

pub struct Atom { /* fields omitted */ }

Methods

impl Atom[src]

pub fn as_c_arg(&self) -> NIF_TERM[src]

pub fn to_term<'a>(self, env: Env<'a>) -> Term<'a>[src]

pub fn from_term(term: Term) -> NifResult<Self>[src]

pub fn from_bytes<'a>(env: Env<'a>, bytes: &[u8]) -> NifResult<Atom>[src]

Return the atom whose text representation is bytes, like erlang:binary_to_atom/2.

Errors

Error::BadArg if bytes.len() > 255.

pub fn try_from_bytes<'a>(env: Env<'a>, bytes: &[u8]) -> NifResult<Option<Atom>>[src]

Return the atom whose text representation is bytes, like erlang:binary_to_existing_atom/2, if atom with given text representation exists.

Errors

Error::BadArg if bytes.len() > 255.

pub fn from_str<'a>(env: Env<'a>, string: &str) -> NifResult<Atom>[src]

Return the atom whose text representation is the given string, like erlang:list_to_atom/2.

Errors

Error::BadArg if string contains characters that aren't in Latin-1, or if it's too long. The maximum length is 255 characters.

Trait Implementations

impl Encoder for Atom[src]

impl<'a> Decoder<'a> for Atom[src]

impl Copy for Atom[src]

impl PartialEq<Atom> for Atom[src]

impl<'a> PartialEq<Term<'a>> for Atom[src]

#[must_use]
fn ne(&self, other: &Rhs) -> bool
1.0.0
[src]

This method tests for !=.

impl Sync for Atom[src]

impl Clone for Atom[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Send for Atom[src]

impl Eq for Atom[src]

impl Debug for Atom[src]

Blanket Implementations

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> From for T[src]

impl<T, U> TryFrom for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.