pub struct Map<'a> { /* private fields */ }
Expand description
A map used for holding query string paramenters or headers
Implementations§
Source§impl<'a> Map<'a>
impl<'a> Map<'a>
Sourcepub fn get(&self, key: &str) -> Option<&str>
pub fn get(&self, key: &str) -> Option<&str>
Get the value of an element of this Map
, or None
if it doesn’t contain key
Sourcepub fn insert<K, V>(&mut self, key: K, value: V)
pub fn insert<K, V>(&mut self, key: K, value: V)
Insert a new element in this Map
If the key
is already present, the value
overwrites the existing value:
let mut map = rusty_s3::Map::new();
map.insert("k", "a");
assert_eq!(map.get("k"), Some("a"));
map.insert("k", "b");
assert_eq!(map.get("k"), Some("b"));
§Panics
In case of out of bound inner index access
Sourcepub fn append<K, V>(&mut self, key: K, value: V)
pub fn append<K, V>(&mut self, key: K, value: V)
Insert a new element in this Map
If the key
is already present, the value
is appended to the existing value:
let mut map = rusty_s3::Map::new();
map.append("k", "a");
assert_eq!(map.get("k"), Some("a"));
map.append("k", "b");
assert_eq!(map.get("k"), Some("a, b"));
§Panics
In case of out of bound inner index access
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for Map<'a>
impl<'a> RefUnwindSafe for Map<'a>
impl<'a> Send for Map<'a>
impl<'a> Sync for Map<'a>
impl<'a> Unpin for Map<'a>
impl<'a> UnwindSafe for Map<'a>
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