[−][src]Struct rustler::types::atom::Atom
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
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,