[][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(self, env: Env) -> Term[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 Clone for Atom[src]

impl Copy for Atom[src]

impl Debug for Atom[src]

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

impl Encoder for Atom[src]

impl Eq for Atom[src]

impl PartialEq<Atom> for Atom[src]

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

impl Send for Atom[src]

impl StructuralEq for Atom[src]

impl StructuralPartialEq for Atom[src]

impl Sync for Atom[src]

Auto Trait Implementations

impl RefUnwindSafe for Atom

impl Unpin for Atom

impl UnwindSafe for Atom

Blanket Implementations

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

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

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

impl<T> From<T> for T[src]

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

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

type Owned = T

The resulting type after obtaining ownership.

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

The type returned in the event of a conversion error.