pub trait AsAtom {
// Required method
fn as_atom(&self) -> Atom;
// Provided method
fn as_atom_ptr(&self) -> (atom_t, Option<Atom>) { ... }
}
Expand description
Trait for types which can be turned into an Atom
from a borrow.
Required Methods§
Provided Methods§
sourcefn as_atom_ptr(&self) -> (atom_t, Option<Atom>)
fn as_atom_ptr(&self) -> (atom_t, Option<Atom>)
Turn the borrowed object into an atom_t
, and returns an
allocation which will keep this atom_t
valid as long as it
is not dropped.
This allows code that takes an AsAtom
to be a little bit
smart about not cloning the underlying data, if the underlying
data is already an atom.