Struct serde_lite::Map
source · [−]pub struct Map { /* private fields */ }Expand description
Map from string keys to Intermediate values.
It wraps the underlying map implementation and prohibits inlining of some methods in order to make the generated code much smaller.
Implementations
sourceimpl Map
impl Map
sourcepub fn with_capacity(capacity: usize) -> Self
pub fn with_capacity(capacity: usize) -> Self
Create a new map with a given capacity.
sourcepub fn get(&self, key: &str) -> Option<&Intermediate>
pub fn get(&self, key: &str) -> Option<&Intermediate>
Get value associated with a given key.
sourcepub fn insert_with_str_key(&mut self, key: &str, value: Intermediate)
pub fn insert_with_str_key(&mut self, key: &str, value: Intermediate)
Insert a given key-value pair into the map.
The key is converted into its owned representation within this method and the method also drops any previous value. In combination with disabled inlining, it allows to create much smaller serializer methods.
Trait Implementations
sourceimpl From<HashMap<String, Intermediate, RandomState>> for Map
impl From<HashMap<String, Intermediate, RandomState>> for Map
sourcefn from(map: MapImpl<String, Intermediate>) -> Self
fn from(map: MapImpl<String, Intermediate>) -> Self
Converts to this type from the input type.
sourceimpl IntoIterator for Map
impl IntoIterator for Map
sourceimpl<'a> IntoIterator for &'a Map
impl<'a> IntoIterator for &'a Map
Auto Trait Implementations
impl RefUnwindSafe for Map
impl Send for Map
impl Sync for Map
impl Unpin for Map
impl UnwindSafe for Map
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more