Struct table::Table [−][src]
pub struct Table { /* fields omitted */ }
Methods
impl Table
[src]
impl Table
pub fn new() -> Table
[src]
pub fn new() -> Table
Constructs a new, empty table.
pub fn with_map(map: HashMap<String, Value>) -> Table
[src]
pub fn with_map(map: HashMap<String, Value>) -> Table
Constructs a new table from the given initial map.
pub fn exists(&self, name: &str) -> bool
[src]
pub fn exists(&self, name: &str) -> bool
Checks if the given key exists in the map.
pub fn get<'a, T>(&'a self, name: &str) -> Option<T> where
T: FromValue<'a>,
[src]
pub fn get<'a, T>(&'a self, name: &str) -> Option<T> where
T: FromValue<'a>,
Gets and parses the value with the given name and returns it,
or returns None
if the value doesn't exist or can't be parsed
as this type.
pub fn get_mut<'a, T>(&'a mut self, name: &str) -> Option<T> where
T: FromValueMut<'a>,
[src]
pub fn get_mut<'a, T>(&'a mut self, name: &str) -> Option<T> where
T: FromValueMut<'a>,
Gets and parses the value with the given name and returns it,
or returns None
if the value doesn't exist or can't be parsed
as this type.
pub fn set<T>(&mut self, name: &str, value: T) -> Option<Value> where
Value: From<T>,
[src]
pub fn set<T>(&mut self, name: &str, value: T) -> Option<Value> where
Value: From<T>,
Updates the value assigned to this name, returning the previous one if it existed.
pub fn remove(&mut self, name: &str) -> Option<Value>
[src]
pub fn remove(&mut self, name: &str) -> Option<Value>
Removes any assignment of a value to this name, returning it if it existed.
pub fn clear(&mut self)
[src]
pub fn clear(&mut self)
Removes all value assignments, resetting this table to a new
state.
pub fn iter<'a>(&'a self) -> Iter<'a, String, Value>
[src]
pub fn iter<'a>(&'a self) -> Iter<'a, String, Value>
Produces an iterator over the keys and values in this table.
Currently, this method only delegates to the inner HashMap::iter()
.
pub fn iter_mut<'a>(&'a mut self) -> IterMut<'a, String, Value>
[src]
pub fn iter_mut<'a>(&'a mut self) -> IterMut<'a, String, Value>
Produces a mutable iterator over the keys and values in this table.
Currently, this method only delegates to HashMap::iter_mut()
.
Trait Implementations
impl From<Table> for Value
[src]
impl From<Table> for Value
impl<'a> FromValue<'a> for &'a Table
[src]
impl<'a> FromValue<'a> for &'a Table
fn from_value(value: &'a Value) -> Option<&'a Table>
[src]
fn from_value(value: &'a Value) -> Option<&'a Table>
Attempts to perform the conversion, returning None
if the given value can not be used to produce Self
. Read more
impl<'a> FromValueMut<'a> for &'a mut Table
[src]
impl<'a> FromValueMut<'a> for &'a mut Table
fn from_value_mut(value: &'a mut Value) -> Option<&'a mut Table>
[src]
fn from_value_mut(value: &'a mut Value) -> Option<&'a mut Table>
Attempts to perform the conversion, returning None
if the given value can not be used to produce Self
. Read more
impl Serialize for Table
[src]
impl Serialize for Table
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where
S: Serializer,
[src]
fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error> where
S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl<'de> Deserialize<'de> for Table
[src]
impl<'de> Deserialize<'de> for Table
fn deserialize<D>(deserializer: D) -> Result<Table, D::Error> where
D: Deserializer<'de>,
[src]
fn deserialize<D>(deserializer: D) -> Result<Table, D::Error> where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Debug for Table
[src]
impl Debug for Table
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl Clone for Table
[src]
impl Clone for Table
fn clone(&self) -> Table
[src]
fn clone(&self) -> Table
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl PartialEq for Table
[src]
impl PartialEq for Table
fn eq(&self, other: &Table) -> bool
[src]
fn eq(&self, other: &Table) -> bool
This method tests for self
and other
values to be equal, and is used by ==
. Read more
fn ne(&self, other: &Table) -> bool
[src]
fn ne(&self, other: &Table) -> bool
This method tests for !=
.
impl Default for Table
[src]
impl Default for Table
impl From<HashMap<String, Value>> for Table
[src]
impl From<HashMap<String, Value>> for Table
impl<'a> IntoIterator for &'a Table
[src]
impl<'a> IntoIterator for &'a Table
type Item = (&'a String, &'a Value)
The type of the elements being iterated over.
type IntoIter = Iter<'a, String, Value>
Which kind of iterator are we turning this into?
fn into_iter(self) -> Self::IntoIter
[src]
fn into_iter(self) -> Self::IntoIter
Creates an iterator from a value. Read more
impl<'a> IntoIterator for &'a mut Table
[src]
impl<'a> IntoIterator for &'a mut Table