Struct protobuf_codec::field::MapFieldDecoder
[−]
[src]
pub struct MapFieldDecoder<F, K, V, M> where
M: IntoIterator<Item = (K::Item, V::Item)>,
K: MapKeyDecode,
V: ValueDecode, { /* fields omitted */ }
Decoder for map fields which have scalar values.
Methods
impl<F, K, V, M> MapFieldDecoder<F, K, V, M> where
K: MapKeyDecode,
V: ValueDecode,
M: IntoIterator<Item = (K::Item, V::Item)> + Default,
[src]
K: MapKeyDecode,
V: ValueDecode,
M: IntoIterator<Item = (K::Item, V::Item)> + Default,
pub fn new(field_num: F, key_decoder: K, value_decoder: V) -> Self
[src]
Makes a new MapFieldDecoder
instance.
Trait Implementations
impl<F: Default, K: Default, V: Default, M: Default> Default for MapFieldDecoder<F, K, V, M> where
M: IntoIterator<Item = (K::Item, V::Item)>,
K: MapKeyDecode,
V: ValueDecode,
[src]
M: IntoIterator<Item = (K::Item, V::Item)>,
K: MapKeyDecode,
V: ValueDecode,
fn default() -> MapFieldDecoder<F, K, V, M>
[src]
Returns the "default value" for a type. Read more
impl<F, K, V, M> Decode for MapFieldDecoder<F, K, V, M> where
F: Copy + Into<FieldNum>,
K: MapKeyDecode,
V: ValueDecode,
M: Default + Extend<(K::Item, V::Item)> + IntoIterator<Item = (K::Item, V::Item)>,
[src]
F: Copy + Into<FieldNum>,
K: MapKeyDecode,
V: ValueDecode,
M: Default + Extend<(K::Item, V::Item)> + IntoIterator<Item = (K::Item, V::Item)>,
type Item = M
The type of items to be decoded.
fn decode(&mut self, buf: &[u8], eos: Eos) -> Result<usize>
[src]
Consumes the given buffer (a part of a byte sequence), and proceeds the decoding process. Read more
fn finish_decoding(&mut self) -> Result<Self::Item>
[src]
Finishes the current decoding process and returns the decoded item. Read more
fn is_idle(&self) -> bool
[src]
Returns true
if there are no items to be decoded by the decoder at the next invocation of decode
method, otherwise false
. Read more
fn requiring_bytes(&self) -> ByteCount
[src]
Returns the lower bound of the number of bytes needed to decode the next item. Read more
impl<F, K, V, M> FieldDecode for MapFieldDecoder<F, K, V, M> where
F: Copy + Into<FieldNum>,
K: MapKeyDecode,
V: ValueDecode,
M: Default + Extend<(K::Item, V::Item)> + IntoIterator<Item = (K::Item, V::Item)>,
[src]
F: Copy + Into<FieldNum>,
K: MapKeyDecode,
V: ValueDecode,
M: Default + Extend<(K::Item, V::Item)> + IntoIterator<Item = (K::Item, V::Item)>,
fn start_decoding(&mut self, tag: Tag) -> Result<bool>
[src]
Tries to start decoding a field. Read more
impl<F, K, V, M> Debug for MapFieldDecoder<F, K, V, M> where
K: MapKeyDecode,
V: ValueDecode,
M: IntoIterator<Item = (K::Item, V::Item)>,
[src]
K: MapKeyDecode,
V: ValueDecode,
M: IntoIterator<Item = (K::Item, V::Item)>,
Auto Trait Implementations
impl<F, K, V, M> Send for MapFieldDecoder<F, K, V, M> where
F: Send,
K: Send,
M: Send,
V: Send,
<M as IntoIterator>::IntoIter: Send,
F: Send,
K: Send,
M: Send,
V: Send,
<M as IntoIterator>::IntoIter: Send,
impl<F, K, V, M> Sync for MapFieldDecoder<F, K, V, M> where
F: Sync,
K: Sync,
M: Sync,
V: Sync,
<M as IntoIterator>::IntoIter: Sync,
F: Sync,
K: Sync,
M: Sync,
V: Sync,
<M as IntoIterator>::IntoIter: Sync,