pub struct Table { /* private fields */ }
Expand description
Implementations§
Source§impl Table
impl Table
Sourcepub fn with_map(map: HashMap<String, Value>) -> Table
pub fn with_map(map: HashMap<String, Value>) -> Table
Constructs a new table from the given initial map.
Sourcepub fn get<'a, T>(&'a self, name: &str) -> Option<T>where
T: FromValue<'a>,
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.
Sourcepub fn get_mut<'a, T>(&'a mut self, name: &str) -> Option<T>where
T: FromValueMut<'a>,
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.
Sourcepub fn set<T>(&mut self, name: &str, value: T) -> Option<Value>
pub fn set<T>(&mut self, name: &str, value: T) -> Option<Value>
Updates the value assigned to this name, returning the previous one if it existed.
Sourcepub fn remove(&mut self, name: &str) -> Option<Value>
pub fn remove(&mut self, name: &str) -> Option<Value>
Removes any assignment of a value to this name, returning it if it existed.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Table
impl<'de> Deserialize<'de> for Table
Source§fn deserialize<D>(deserializer: D) -> Result<Table, D::Error>where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<Table, D::Error>where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl<'a> FromValueMut<'a> for &'a mut Table
impl<'a> FromValueMut<'a> for &'a mut Table
Source§impl<'a> IntoIterator for &'a Table
impl<'a> IntoIterator for &'a Table
Source§impl<'a> IntoIterator for &'a mut Table
impl<'a> IntoIterator for &'a mut Table
impl StructuralPartialEq for Table
Auto Trait Implementations§
impl Freeze for Table
impl RefUnwindSafe for Table
impl Send for Table
impl Sync for Table
impl Unpin for Table
impl UnwindSafe for Table
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more