Skip to main content

Obj

Struct Obj 

Source
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>

Source

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.

Source

pub fn built(&self) -> bool

Whether object mode built the class, not an UnknownObject.

Source

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.

Source

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).

Source

pub fn int32(&self, name: &'static str) -> Result<Option<i64>, MeshError>

The attribute name, a 32-bit signed integer (a bool as its int).

Source

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]).

Source

pub fn bytes(&self, name: &'static str) -> Result<Option<&'a [u8]>, MeshError>

The attribute name, bytes (TypelessData).

Source

pub fn string( &self, name: &'static str, ) -> Result<Option<&'a RawStr>, MeshError>

The attribute name, a str.

Source

pub fn class( &self, name: &'static str, class: &'static Class, ) -> Result<Option<Obj<'a>>, MeshError>

The attribute name, an object of class.

Source

pub fn list( &self, name: &'static str, class: &'static Class, ) -> Result<Option<List<'a>>, MeshError>

The attribute name, a list of objects of class.

Source

pub fn ints(&self, name: &'static str) -> Result<Option<Ints<'a>>, MeshError>

The attribute name, a list of integers.

Trait Implementations§

Source§

impl<'a> Clone for Obj<'a>

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<'a> Copy for Obj<'a>

Source§

impl<'a> Debug for Obj<'a>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for Obj<'a>

§

impl<'a> !UnwindSafe for Obj<'a>

§

impl<'a> Forget for Obj<'a>

§

impl<'a> Freeze for Obj<'a>

§

impl<'a> Move for Obj<'a>

§

impl<'a> Send for Obj<'a>

§

impl<'a> Sync for Obj<'a>

§

impl<'a> Unpin for Obj<'a>

§

impl<'a> UnsafeUnpin for Obj<'a>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.