pub enum OwnedTerm {
Show 17 variants
Atom(Atom),
Integer(i64),
Float(f64),
Pid(ExternalPid),
Port(ExternalPort),
Reference(ExternalReference),
Binary(Vec<u8>),
BitBinary {
bytes: Vec<u8>,
bits: u8,
},
String(String),
List(Vec<OwnedTerm>),
ImproperList {
elements: Vec<OwnedTerm>,
tail: Box<OwnedTerm>,
},
Map(BTreeMap<OwnedTerm, OwnedTerm>),
Tuple(Vec<OwnedTerm>),
BigInt(BigInt),
ExternalFun(ExternalFun),
InternalFun(Box<InternalFun>),
Nil,
}Variants§
Atom(Atom)
Integer(i64)
Float(f64)
Pid(ExternalPid)
Port(ExternalPort)
Reference(ExternalReference)
Binary(Vec<u8>)
BitBinary
String(String)
List(Vec<OwnedTerm>)
ImproperList
Map(BTreeMap<OwnedTerm, OwnedTerm>)
Tuple(Vec<OwnedTerm>)
BigInt(BigInt)
ExternalFun(ExternalFun)
InternalFun(Box<InternalFun>)
Nil
Implementations§
Source§impl OwnedTerm
impl OwnedTerm
pub fn atom<S>(name: S) -> OwnedTerm
pub fn integer(value: i64) -> OwnedTerm
pub fn float(value: f64) -> OwnedTerm
pub fn binary(data: Vec<u8>) -> OwnedTerm
pub fn string<S>(value: S) -> OwnedTerm
pub fn list(elements: Vec<OwnedTerm>) -> OwnedTerm
pub fn improper_list(elements: Vec<OwnedTerm>, tail: OwnedTerm) -> OwnedTerm
pub fn map(entries: BTreeMap<OwnedTerm, OwnedTerm>) -> OwnedTerm
pub fn tuple(elements: Vec<OwnedTerm>) -> OwnedTerm
pub fn boolean(value: bool) -> OwnedTerm
pub fn ok() -> OwnedTerm
pub fn error() -> OwnedTerm
pub fn ok_tuple(value: OwnedTerm) -> OwnedTerm
pub fn error_tuple(reason: OwnedTerm) -> OwnedTerm
pub fn nil() -> OwnedTerm
pub fn is_atom(&self) -> bool
pub fn is_integer(&self) -> bool
pub fn is_list(&self) -> bool
pub fn is_map(&self) -> bool
pub fn is_tuple(&self) -> bool
pub fn as_atom(&self) -> Option<&Atom>
pub fn as_integer(&self) -> Option<i64>
pub fn as_float(&self) -> Option<f64>
pub fn as_binary(&self) -> Option<&[u8]>
pub fn as_string(&self) -> Option<&str>
pub fn as_list(&self) -> Option<&[OwnedTerm]>
pub fn as_map(&self) -> Option<&BTreeMap<OwnedTerm, OwnedTerm>>
pub fn as_tuple(&self) -> Option<&[OwnedTerm]>
pub fn as_list_mut(&mut self) -> Option<&mut Vec<OwnedTerm>>
pub fn as_map_mut(&mut self) -> Option<&mut BTreeMap<OwnedTerm, OwnedTerm>>
pub fn as_tuple_mut(&mut self) -> Option<&mut Vec<OwnedTerm>>
pub fn as_binary_mut(&mut self) -> Option<&mut Vec<u8>>
pub fn try_as_integer(&self) -> Result<i64, TermConversionError>
pub fn try_as_float(&self) -> Result<f64, TermConversionError>
pub fn try_as_atom(&self) -> Result<&Atom, TermConversionError>
pub fn try_as_binary(&self) -> Result<&[u8], TermConversionError>
pub fn try_as_string(&self) -> Result<&str, TermConversionError>
pub fn try_as_list(&self) -> Result<&[OwnedTerm], TermConversionError>
pub fn try_as_tuple(&self) -> Result<&[OwnedTerm], TermConversionError>
pub fn try_as_map( &self, ) -> Result<&BTreeMap<OwnedTerm, OwnedTerm>, TermConversionError>
pub fn into_map_iter( self, ) -> Result<impl Iterator<Item = (OwnedTerm, OwnedTerm)>, TermConversionError>
pub fn type_name(&self) -> &'static str
pub fn atom_name(&self) -> Option<&str>
pub fn is_atom_with_name(&self, name: &str) -> bool
pub fn is_true(&self) -> bool
pub fn is_false(&self) -> bool
pub fn is_undefined(&self) -> bool
pub fn is_nil_atom(&self) -> bool
pub fn as_bool(&self) -> Option<bool>
pub fn into_ok_value(self) -> Option<OwnedTerm>
pub fn into_rex_response(self) -> Result<OwnedTerm, TermConversionError>
pub fn into_error_reason(self) -> Option<OwnedTerm>
pub fn map_get(&self, key: &OwnedTerm) -> Option<&OwnedTerm>
pub fn get<I>(&self, index: I) -> Option<&OwnedTerm>where
I: TermIndex,
pub fn iter(&self) -> OwnedTermIter<'_>
pub fn proplist_get_atom_key(&self, key: &str) -> Option<&OwnedTerm>
pub fn is_proplist(&self) -> bool
pub fn is_proplist_element(element: &OwnedTerm) -> bool
pub fn normalize_proplist(&self) -> Result<OwnedTerm, TermConversionError>
pub fn proplist_to_map(&self) -> Result<OwnedTerm, TermConversionError>
pub fn map_to_proplist(&self) -> Result<OwnedTerm, TermConversionError>
pub fn to_map_recursive(&self) -> Result<OwnedTerm, TermConversionError>
pub fn atomize_keys(&self) -> Result<OwnedTerm, TermConversionError>
pub fn as_list_wrapped(&self) -> OwnedTerm
pub fn proplist_iter(&self) -> Option<ProplistIter<'_>>
pub fn map_get_atom_key(&self, key: &str) -> Option<&OwnedTerm>
pub fn map_get_i64(&self, key: &str) -> Option<i64>
pub fn map_get_i64_or(&self, key: &str, default: i64) -> i64
pub fn map_get_bool(&self, key: &str) -> Option<bool>
pub fn map_get_bool_or(&self, key: &str, default: bool) -> bool
pub fn map_get_atom(&self, key: &str) -> Option<&Atom>
pub fn map_get_string(&self, key: &str) -> Option<String>
pub fn map_get_string_or(&self, key: &str, default: &str) -> String
pub fn map_get_pid(&self, key: &str) -> Option<&ExternalPid>
pub fn map_get_atom_string(&self, key: &str) -> Option<String>
pub fn map_get_atom_string_or(&self, key: &str, default: &str) -> String
pub fn map_get_pid_string(&self, key: &str) -> Option<String>
pub fn map_get_pid_string_or(&self, key: &str, default: &str) -> String
pub fn map_get_mfa_string(&self, key: &str) -> Option<String>
pub fn map_get_mfa_string_or(&self, key: &str, default: &str) -> String
pub fn as_erlang_string(&self) -> Option<String>
pub fn as_erlang_string_or(&self, default: &str) -> String
pub fn tuple_get(&self, index: usize) -> Option<&OwnedTerm>
pub fn tuple_get_string(&self, index: usize) -> Option<String>
pub fn tuple_get_string_or(&self, index: usize, default: &str) -> String
pub fn tuple_get_atom_string(&self, index: usize) -> Option<String>
pub fn tuple_get_atom_string_or(&self, index: usize, default: &str) -> String
pub fn charlist<S>(s: S) -> OwnedTerm
pub fn is_charlist(&self) -> bool
pub fn as_charlist_string(&self) -> Option<String>
pub fn as_list_or_empty(&self) -> &[OwnedTerm]
pub fn try_as_mfa(&self) -> Option<Mfa>
pub fn format_as_mfa(&self) -> Option<String>
pub fn as_pid(&self) -> Option<&ExternalPid>
pub fn try_as_pid(&self) -> Result<&ExternalPid, TermConversionError>
pub fn is_pid(&self) -> bool
pub fn format_as_pid(&self) -> Option<String>
pub fn proplist_get_i64(&self, key: &str) -> Option<i64>
pub fn proplist_get_i64_or(&self, key: &str, default: i64) -> i64
pub fn proplist_get_bool(&self, key: &str) -> Option<bool>
pub fn proplist_get_bool_or(&self, key: &str, default: bool) -> bool
pub fn proplist_get_atom(&self, key: &str) -> Option<&Atom>
pub fn proplist_get_string(&self, key: &str) -> Option<String>
pub fn proplist_get_string_or(&self, key: &str, default: &str) -> String
pub fn proplist_get_pid(&self, key: &str) -> Option<&ExternalPid>
pub fn proplist_get_atom_string(&self, key: &str) -> Option<String>
pub fn proplist_get_atom_string_or(&self, key: &str, default: &str) -> String
pub fn proplist_get_pid_string(&self, key: &str) -> Option<String>
pub fn proplist_get_pid_string_or(&self, key: &str, default: &str) -> String
pub fn proplist_get_mfa_string(&self, key: &str) -> Option<String>
pub fn proplist_get_mfa_string_or(&self, key: &str, default: &str) -> String
pub fn atom_list(names: &[&str]) -> OwnedTerm
pub fn map_iter(&self) -> Option<impl Iterator<Item = (&OwnedTerm, &OwnedTerm)>>
pub fn try_into_list(self) -> Result<Vec<OwnedTerm>, TermConversionError>
pub fn try_into_tuple(self) -> Result<Vec<OwnedTerm>, TermConversionError>
pub fn try_into_map( self, ) -> Result<BTreeMap<OwnedTerm, OwnedTerm>, TermConversionError>
pub fn try_into_binary(self) -> Result<Vec<u8>, TermConversionError>
pub fn try_into_string(self) -> Result<String, TermConversionError>
pub fn try_into_atom(self) -> Result<Arc<str>, TermConversionError>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn estimated_encoded_size(&self) -> usize
Source§impl OwnedTerm
impl OwnedTerm
pub fn map_builder() -> MapBuilder
pub fn list_builder() -> ListBuilder
Trait Implementations§
Source§impl<K, V> FromIterator<(K, V)> for OwnedTerm
impl<K, V> FromIterator<(K, V)> for OwnedTerm
Source§impl<T> FromIterator<T> for OwnedTerm
impl<T> FromIterator<T> for OwnedTerm
Source§impl IntoIterator for OwnedTerm
impl IntoIterator for OwnedTerm
Source§impl KeyValueAccess for OwnedTerm
impl KeyValueAccess for OwnedTerm
Source§fn kv_get(&self, key: &str) -> Option<&OwnedTerm>
fn kv_get(&self, key: &str) -> Option<&OwnedTerm>
Retrieve the value associated with an atom key, returning the raw term
Source§fn kv_get_i64_or(&self, key: &str, default: i64) -> i64
fn kv_get_i64_or(&self, key: &str, default: i64) -> i64
Retrieve an i64 value by key or return the default if the key is missing
Source§fn kv_get_bool_or(&self, key: &str, default: bool) -> bool
fn kv_get_bool_or(&self, key: &str, default: bool) -> bool
Retrieve a boolean value by key, or return the default if the key is missing
Source§fn kv_get_atom_string(&self, key: &str) -> Option<String>
fn kv_get_atom_string(&self, key: &str) -> Option<String>
Retrieve an atom value as a string by key
Source§fn kv_get_atom_string_or(&self, key: &str, default: &str) -> String
fn kv_get_atom_string_or(&self, key: &str, default: &str) -> String
Retrieve an atom value as a string by key or return the default if the key is missing
Source§fn kv_get_string_or(&self, key: &str, default: &str) -> String
fn kv_get_string_or(&self, key: &str, default: &str) -> String
Retrieve a string value by key or return the default if the key is missing
Source§fn kv_get_pid(&self, key: &str) -> Option<&ExternalPid>
fn kv_get_pid(&self, key: &str) -> Option<&ExternalPid>
Retrieve a PID value by key
Source§fn kv_get_pid_string(&self, key: &str) -> Option<String>
fn kv_get_pid_string(&self, key: &str) -> Option<String>
Retrieve a PID value as a formatted string by key
Source§fn kv_get_pid_string_or(&self, key: &str, default: &str) -> String
fn kv_get_pid_string_or(&self, key: &str, default: &str) -> String
Retrieve a PID value as a formatted string by key or return the default if the key is missing
Source§impl Ord for OwnedTerm
impl Ord for OwnedTerm
Source§impl OwnedTermExt for OwnedTerm
impl OwnedTermExt for OwnedTerm
fn try_deserialize<T>(&self) -> Result<T, Error>where
T: DeserializeOwned,
fn try_deserialize_proplist<T>(&self) -> Result<T, Error>where
T: DeserializeOwned,
Source§impl PartialOrd for OwnedTerm
impl PartialOrd for OwnedTerm
impl Eq for OwnedTerm
impl StructuralPartialEq for OwnedTerm
Auto Trait Implementations§
impl !Freeze for OwnedTerm
impl RefUnwindSafe for OwnedTerm
impl Send for OwnedTerm
impl Sync for OwnedTerm
impl Unpin for OwnedTerm
impl UnwindSafe for OwnedTerm
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