Struct over::obj::Obj
[−]
[src]
pub struct Obj { /* fields omitted */ }
Obj
struct.
Methods
impl Obj
[src]
fn new() -> Obj
[src]
Returns a new empty Obj
.
fn from_file(path: &str) -> OverResult<Obj>
[src]
Returns a new Obj
loaded from a file.
fn write_to_file(&self, path: &str) -> OverResult<()>
[src]
Writes this Obj
to given file in .over
representation.
fn len(&self) -> usize
[src]
Returns the number of fields for this Obj
(children/parents not included).
fn is_empty(&self) -> bool
[src]
Returns whether this Obj
is empty.
fn ptr_eq(&self, other: &Self) -> bool
[src]
Returns whether this Arr
and other
point to the same data.
fn contains(&self, field: &str) -> bool
[src]
Returns true iff the Obj
contains field
.
fn remove(&mut self, field: &str) -> Option<Value>
[src]
Removes a field and its associated value from the Obj
.
fn clear(&mut self)
[src]
Clears all fields from the Obj
.
fn get(&self, field: &str) -> Option<Value>
[src]
Gets the Value
associated with field
.
fn get_bool(&self, field: &str) -> OverResult<bool>
[src]
Try to get the $type
associated with field
.
fn get_int(&self, field: &str) -> OverResult<BigInt>
[src]
Try to get the $type
associated with field
.
fn get_frac(&self, field: &str) -> OverResult<BigFraction>
[src]
Try to get the $type
associated with field
.
fn get_char(&self, field: &str) -> OverResult<char>
[src]
Try to get the $type
associated with field
.
fn get_str(&self, field: &str) -> OverResult<String>
[src]
Try to get the $type
associated with field
.
fn get_arr(&self, field: &str) -> OverResult<Arr>
[src]
Try to get the $type
associated with field
.
fn get_tup(&self, field: &str) -> OverResult<Tup>
[src]
Try to get the $type
associated with field
.
fn get_obj(&self, field: &str) -> OverResult<Obj>
[src]
Try to get the $type
associated with field
.
fn set(&mut self, field: &str, value: Value)
[src]
Sets the Value
for field
.
fn has_parent(&self) -> bool
[src]
Returns whether this Obj
has a parent.
fn get_parent(&self) -> OverResult<Obj>
[src]
Returns the parent for this Obj
.
fn set_parent(&mut self, parent: &Obj) -> OverResult<()>
[src]
Sets the parent for this Obj
.
Circular references in parents are not allowed.
Trait Implementations
impl Clone for Obj
[src]
fn clone(&self) -> Obj
[src]
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for Obj
[src]
impl Default for Obj
[src]
impl FromStr for Obj
[src]
type Err = OverError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<Self, Self::Err>
[src]
Parses a string s
to return a value of this type. Read more
impl PartialEq for Obj
[src]
fn eq(&self, other: &Self) -> bool
[src]
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Rhs) -> bool
1.0.0[src]
This method tests for !=
.