SerdeMap

Struct SerdeMap 

Source
pub struct SerdeMap<K, V, KS: SerdeMapStrategy<K> = Linear>(pub Vec<(KS::Des, V)>, _);

Tuple Fields§

§0: Vec<(KS::Des, V)>

Implementations§

Source§

impl<K, V, KS: SerdeMapStrategy<K>> SerdeMap<K, V, KS>

Source

pub fn new() -> Self

Source

pub fn with_capacity(capacity: usize) -> Self

Source

pub fn insert_unchecked(&mut self, k: KS::Des, v: V)

Source

pub fn len(&self) -> usize

Source

pub fn is_empty(&self) -> bool

Source§

impl<K, V, KS: SerdeMapStrategy<K>> SerdeMap<K, Vec<V>, KS>

Source

pub fn push_to_same_last(&mut self, k: KS::Des, v: V)
where KS::Des: PartialEq,

Trait Implementations§

Source§

impl<K: Clone, V: Clone, KS: Clone + SerdeMapStrategy<K>> Clone for SerdeMap<K, V, KS>
where KS::Des: Clone,

Source§

fn clone(&self) -> SerdeMap<K, V, KS>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<K: Debug, V: Debug, KS: Debug + SerdeMapStrategy<K>> Debug for SerdeMap<K, V, KS>
where KS::Des: Debug,

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<K, V, KS: SerdeMapStrategy<K>> Default for SerdeMap<K, V, KS>

Source§

fn default() -> Self

Returns the “default value” for a type. Read more
Source§

impl<'de, K, V, KS> Deserialize<'de> for SerdeMap<K, V, KS>
where K: Deserialize<'de>, V: Deserialize<'de>, KS: SerdeMapStrategy<K>,

Source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<K, V, KS: SerdeMapStrategy<K>, S> From<HashMap<<KS as SerdeMapStrategy<K>>::Des, V, S>> for SerdeMap<K, V, KS>

Source§

fn from(hash: HashMap<KS::Des, V, S>) -> Self

Converts to this type from the input type.
Source§

impl<K, V, KS: SerdeMapStrategy<K>, S> From<SerdeMap<K, V, KS>> for HashMap<KS::Des, V, S>
where <KS as SerdeMapStrategy<K>>::Des: Eq + Hash, S: Default + BuildHasher,

Source§

fn from(v: SerdeMap<K, V, KS>) -> Self

Converts to this type from the input type.
Source§

impl<K, V, KS: SerdeMapStrategy<K>> From<Vec<(<KS as SerdeMapStrategy<K>>::Des, V)>> for SerdeMap<K, V, KS>

Source§

fn from(data: Vec<(KS::Des, V)>) -> Self

Converts to this type from the input type.
Source§

impl<K, V, KS: SerdeMapStrategy<K>> FromIterator<(<KS as SerdeMapStrategy<K>>::Des, V)> for SerdeMap<K, V, KS>

Source§

fn from_iter<T: IntoIterator<Item = (KS::Des, V)>>(iter: T) -> Self

Creates a value from an iterator. Read more
Source§

impl<'a, K, V, KS: SerdeMapStrategy<K>> IntoIterator for &'a SerdeMap<K, V, KS>

Source§

type Item = &'a (<KS as SerdeMapStrategy<K>>::Des, V)

The type of the elements being iterated over.
Source§

type IntoIter = Iter<'a, (<KS as SerdeMapStrategy<K>>::Des, V)>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<'a, K, V, KS: SerdeMapStrategy<K>> IntoIterator for &'a mut SerdeMap<K, V, KS>

Source§

type Item = &'a mut (<KS as SerdeMapStrategy<K>>::Des, V)

The type of the elements being iterated over.
Source§

type IntoIter = IterMut<'a, (<KS as SerdeMapStrategy<K>>::Des, V)>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<K, V, KS: SerdeMapStrategy<K>> IntoIterator for SerdeMap<K, V, KS>

Source§

type Item = (<KS as SerdeMapStrategy<K>>::Des, V)

The type of the elements being iterated over.
Source§

type IntoIter = IntoIter<<SerdeMap<K, V, KS> as IntoIterator>::Item>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl<K: Serialize, V: Serialize, KS: SerdeMapStrategy<K>> Serialize for SerdeMap<K, V, KS>

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl<K, V, KS> Freeze for SerdeMap<K, V, KS>

§

impl<K, V, KS> RefUnwindSafe for SerdeMap<K, V, KS>

§

impl<K, V, KS> Send for SerdeMap<K, V, KS>
where KS: Send, <KS as SerdeMapStrategy<K>>::Des: Send, V: Send,

§

impl<K, V, KS> Sync for SerdeMap<K, V, KS>
where KS: Sync, <KS as SerdeMapStrategy<K>>::Des: Sync, V: Sync,

§

impl<K, V, KS> Unpin for SerdeMap<K, V, KS>
where KS: Unpin, <KS as SerdeMapStrategy<K>>::Des: Unpin, V: Unpin,

§

impl<K, V, KS> UnwindSafe for SerdeMap<K, V, KS>
where KS: UnwindSafe, <KS as SerdeMapStrategy<K>>::Des: UnwindSafe, V: UnwindSafe,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,