pub struct IndexMapToArray<K, V, U = RandomState>(PhantomData<(K, V, U)>);Expand description
A converter between an IndexMap and a sequence of named key-value pairs.
Tuple Fields§
§0: PhantomData<(K, V, U)>Implementations§
Source§impl<K, V, U> IndexMapToArray<K, V, U>
impl<K, V, U> IndexMapToArray<K, V, U>
Sourcepub fn serialize<'a, S>(
map: &'a IndexMap<K, V, U>,
serializer: S,
) -> Result<S::Ok, S::Error>
pub fn serialize<'a, S>( map: &'a IndexMap<K, V, U>, serializer: S, ) -> Result<S::Ok, S::Error>
Serializes the given map to an array of named key-values.
pub fn serialize_state<'a, S, State: ?Sized>(
map: &'a IndexMap<K, V, U>,
state: &State,
serializer: S,
) -> Result<S::Ok, S::Error>where
K: SerializeState<State>,
V: SerializeState<State>,
S: Serializer,
Sourcepub fn deserialize<'de, D>(
deserializer: D,
) -> Result<IndexMap<K, V, U>, D::Error>where
K: Deserialize<'de> + Eq + Hash,
V: Deserialize<'de>,
U: BuildHasher + Default,
D: Deserializer<'de>,
pub fn deserialize<'de, D>(
deserializer: D,
) -> Result<IndexMap<K, V, U>, D::Error>where
K: Deserialize<'de> + Eq + Hash,
V: Deserialize<'de>,
U: BuildHasher + Default,
D: Deserializer<'de>,
Deserializes from an array of named key-values.
Sourcepub fn deserialize_state<'de, D, State>(
state: &State,
deserializer: D,
) -> Result<IndexMap<K, V, U>, D::Error>where
K: DeserializeState<'de, State> + Eq + Hash,
V: DeserializeState<'de, State>,
U: BuildHasher + Default,
D: Deserializer<'de>,
pub fn deserialize_state<'de, D, State>(
state: &State,
deserializer: D,
) -> Result<IndexMap<K, V, U>, D::Error>where
K: DeserializeState<'de, State> + Eq + Hash,
V: DeserializeState<'de, State>,
U: BuildHasher + Default,
D: Deserializer<'de>,
Deserializes from an array of named key-values.
Auto Trait Implementations§
impl<K, V, U> Freeze for IndexMapToArray<K, V, U>
impl<K, V, U> RefUnwindSafe for IndexMapToArray<K, V, U>
impl<K, V, U> Send for IndexMapToArray<K, V, U>
impl<K, V, U> Sync for IndexMapToArray<K, V, U>
impl<K, V, U> Unpin for IndexMapToArray<K, V, U>
impl<K, V, U> UnwindSafe for IndexMapToArray<K, V, U>
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
§impl<I, T> ExtractContext<I, ()> for T
impl<I, T> ExtractContext<I, ()> for T
§fn extract_context(self, _original_input: I)
fn extract_context(self, _original_input: I)
Given the context attached to a nom error, and given the original
input to the nom parser, extract more the useful context information. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more§impl<I> RecreateContext<I> for I
impl<I> RecreateContext<I> for I
§fn recreate_context(_original_input: I, tail: I) -> I
fn recreate_context(_original_input: I, tail: I) -> I
Given the original input, as well as the context reported by nom,
recreate a context in the original string where the error occurred. Read more