Enum erlang_term::raw_term::RawTerm
source · pub enum RawTerm {
Show 25 variants
SmallInt(u8),
Int(i32),
SmallTuple(Vec<RawTerm>),
LargeTuple(Vec<RawTerm>),
Map(Vec<(RawTerm, RawTerm)>),
Nil,
String(Vec<u8>),
List(Vec<RawTerm>),
Improper(Box<RawTerm>),
Binary(Vec<u8>),
BitBinary {
binary: Vec<u8>,
bit: u8,
bits: u8,
},
SmallBigInt(BigInt),
LargeBigInt(BigInt),
Pid {
node: Box<RawTerm>,
id: u32,
serial: u32,
creation: u8,
},
NewPid {
node: Box<RawTerm>,
id: u32,
serial: u32,
creation: u32,
},
Port {
node: Box<RawTerm>,
id: u32,
creation: u8,
},
NewPort {
node: Box<RawTerm>,
id: u32,
creation: u32,
},
Ref {
node: Box<RawTerm>,
id: Vec<u32>,
creation: u8,
},
NewerRef {
node: Box<RawTerm>,
id: Vec<u32>,
creation: u32,
},
Function {
size: u32,
arity: u8,
uniq: [u8; 16],
index: u32,
module: Box<RawTerm>,
old_index: Box<RawTerm>,
old_uniq: Box<RawTerm>,
pid: Box<RawTerm>,
free_var: Vec<RawTerm>,
},
Float(OrderedFloat<f64>),
Atom(String),
SmallAtom(String),
AtomDeprecated(String),
SmallAtomDeprecated(String),
}
Expand description
Erlang Term Format types
Variants§
SmallInt(u8)
Int(i32)
SmallTuple(Vec<RawTerm>)
LargeTuple(Vec<RawTerm>)
Map(Vec<(RawTerm, RawTerm)>)
Nil
String(Vec<u8>)
List(Vec<RawTerm>)
Improper(Box<RawTerm>)
Binary(Vec<u8>)
BitBinary
SmallBigInt(BigInt)
LargeBigInt(BigInt)
Pid
NewPid
Port
NewPort
Ref
NewerRef
Function
Fields
Float(OrderedFloat<f64>)
Atom(String)
SmallAtom(String)
AtomDeprecated(String)
SmallAtomDeprecated(String)
Implementations§
source§impl RawTerm
impl RawTerm
pub fn from_bytes(input: &[u8]) -> Result<RawTerm, NomErr<Error<&[u8]>>>
pub fn to_bytes(self) -> Vec<u8> ⓘ
pub fn as_type(&self) -> RawTermType
pub fn as_general_type(&self) -> RawTermGeneralType
pub fn is_atom(&self) -> bool
pub fn is_string(&self) -> bool
sourcepub fn is_string_like(&self) -> bool
pub fn is_string_like(&self) -> bool
if term is a string/binary or atom
pub fn is_integer(&self) -> bool
pub fn is_atom_pair(&self) -> bool
pub fn is_string_map(&self) -> bool
pub fn is_list(&self) -> bool
pub fn as_atom(self) -> Option<String>
pub fn as_string(self) -> Option<String>
pub fn as_string_like(self) -> Option<String>
pub fn as_atom_pair(self) -> Option<(String, RawTerm)>
Trait Implementations§
source§impl<'_enum> From<&'_enum RawTerm> for RawTermType
impl<'_enum> From<&'_enum RawTerm> for RawTermType
source§fn from(val: &'_enum RawTerm) -> RawTermType
fn from(val: &'_enum RawTerm) -> RawTermType
Converts to this type from the input type.
source§impl From<RawTerm> for RawTermType
impl From<RawTerm> for RawTermType
source§fn from(val: RawTerm) -> RawTermType
fn from(val: RawTerm) -> RawTermType
Converts to this type from the input type.
source§impl Ord for RawTerm
impl Ord for RawTerm
source§impl PartialEq<RawTerm> for RawTerm
impl PartialEq<RawTerm> for RawTerm
source§impl PartialOrd<RawTerm> for RawTerm
impl PartialOrd<RawTerm> for RawTerm
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more