pub struct Atom { /* private fields */ }
Expand description
A wrapper for a prolog atom.
When created, the underlying atom will have its reference count increased. When dropped, the reference count will decrease.
Implementations§
source§impl Atom
impl Atom
sourcepub unsafe fn wrap(atom: atom_t) -> Atom
pub unsafe fn wrap(atom: atom_t) -> Atom
Wrap an atom_t
, which is how the SWI-Prolog fli represents atoms.
Safety
This is unsafe because no check is done to ensure that the atom_t indeed points at a valid atom. The caller will have to ensure that this is the case.
sourcepub fn new(name: &str) -> Atom
pub fn new(name: &str) -> Atom
Create a new atom from the given string.
This will panic if no prolog engine is active on this thread.
If the atom already exists, this will raise the reference count on that atom and then return the existing atom.
Trait Implementations§
source§impl<'de> Deserialize<'de> for Atom
impl<'de> Deserialize<'de> for Atom
source§fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl PartialEq for Atom
impl PartialEq for Atom
source§impl<'a> TermGetable for Atom
impl<'a> TermGetable for Atom
source§impl<'a> TermPutable for Atom
impl<'a> TermPutable for Atom
impl Eq for Atom
impl StructuralEq for Atom
impl StructuralPartialEq for Atom
Auto Trait Implementations§
impl RefUnwindSafe for Atom
impl Send for Atom
impl Sync for Atom
impl Unpin for Atom
impl UnwindSafe for Atom
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more