pub struct Obj<'a> { /* private fields */ }Expand description
One object, as object mode builds it from a class node (module docs), with the meter its reads count their work on.
Implementations§
Source§impl<'a> Obj<'a>
impl<'a> Obj<'a>
Sourcepub fn root(
parsed: &'a Parsed,
class: &'static Class,
meter: &'a Meter,
) -> Result<Self, MeshError>
pub fn root( parsed: &'a Parsed, class: &'static Class, meter: &'a Meter, ) -> Result<Self, MeshError>
The root object of parsed, a node of class, its reads counted on
meter.
Sourcepub fn get(
&self,
name: &'static str,
) -> Result<Option<(NodeId, &'a Value)>, MeshError>
pub fn get( &self, name: &'static str, ) -> Result<Option<(NodeId, &'a Value)>, MeshError>
The attribute name (module docs): its value; None, the field’s
default, on a class that was built; AttributeError on an
UnknownObject. Its scans, of the children and of the dict, are
counted first, a unit a name.
Sourcepub fn uint(
&self,
name: &'static str,
max: u64,
) -> Result<Option<u64>, MeshError>
pub fn uint( &self, name: &'static str, max: u64, ) -> Result<Option<u64>, MeshError>
The attribute name, an integer from 0 to max (a Python bool
reads as its int, as Python’s arithmetic takes it).
Sourcepub fn int32(&self, name: &'static str) -> Result<Option<i64>, MeshError>
pub fn int32(&self, name: &'static str) -> Result<Option<i64>, MeshError>
The attribute name, a 32-bit signed integer (a bool as its
int).
Sourcepub fn float(&self, name: &'static str) -> Result<Option<f64>, MeshError>
pub fn float(&self, name: &'static str) -> Result<Option<f64>, MeshError>
The attribute name, a float (a float or double leaf, read as
Python reads it: a float’s bits widened as struct’s f widens
them, [widen]).
Sourcepub fn bytes(&self, name: &'static str) -> Result<Option<&'a [u8]>, MeshError>
pub fn bytes(&self, name: &'static str) -> Result<Option<&'a [u8]>, MeshError>
The attribute name, bytes (TypelessData).
Sourcepub fn string(
&self,
name: &'static str,
) -> Result<Option<&'a RawStr>, MeshError>
pub fn string( &self, name: &'static str, ) -> Result<Option<&'a RawStr>, MeshError>
The attribute name, a str.
Sourcepub fn class(
&self,
name: &'static str,
class: &'static Class,
) -> Result<Option<Obj<'a>>, MeshError>
pub fn class( &self, name: &'static str, class: &'static Class, ) -> Result<Option<Obj<'a>>, MeshError>
The attribute name, an object of class.