Skip to main content

Node

Struct Node 

Source
pub struct Node {
    pub index: u32,
    pub layout: Rc<NodeLayout>,
    pub values: Vec<Value>,
}
Expand description

A node: its type, index and field values in its layout’s order.

Fields§

§index: u32§layout: Rc<NodeLayout>§values: Vec<Value>

Implementations§

Source§

impl Node

Source

pub fn node_type(&self) -> u16

Source

pub fn type_name(&self) -> &str

Source

pub fn field(&self, name: &str) -> Option<&Value>

A field by name; None when this file’s layout has no such field.

Source

pub fn int(&self, name: &str) -> Option<i64>

An integer or pointer field; unset and absent read as None.

Source

pub fn ptr(&self, name: &str) -> u32

A pointer field’s index; null, unset and absent read as 0.

Source

pub fn real(&self, name: &str) -> Option<f64>

Source

pub fn vector(&self, name: &str) -> Option<[f64; 3]>

Source

pub fn interval(&self, name: &str) -> Option<[Option<f64>; 2]>

Source

pub fn char(&self, name: &str) -> Option<u8>

Source

pub fn logical(&self, name: &str) -> Option<bool>

A logical field; T is true.

Source

pub fn text(&self, name: &str) -> Option<&str>

Source

pub fn array(&self, name: &str) -> &[Value]

Source

pub fn reals(&self, name: &str) -> Vec<f64>

An array of reals (unset entries as NaN).

Source

pub fn ints(&self, name: &str) -> Vec<i64>

An array of integers or pointers (unset entries as 0).

Source

pub fn vectors(&self, name: &str) -> Vec<Option<[f64; 3]>>

An array of vectors (unset entries as None).

Trait Implementations§

Source§

impl Debug for Node

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl !Send for Node

§

impl !Sync for Node

§

impl Forget for Node

§

impl Freeze for Node

§

impl Move for Node

§

impl RefUnwindSafe for Node

§

impl Unpin for Node

§

impl UnsafeUnpin for Node

§

impl UnwindSafe for Node

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> 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, 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.
Source§

impl<S, T> Upcast<T> for S
where T: UpcastFrom<S> + ?Sized, S: ?Sized,

Source§

fn upcast(&self) -> &T
where Self: ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider ref type within the Wasm bindgen generics type system. Read more
Source§

fn upcast_into(self) -> T
where Self: Sized + ErasableGeneric, T: Sized + ErasableGeneric<Repr = Self::Repr>,

Perform a zero-cost type-safe upcast to a wider type within the Wasm bindgen generics type system. Read more