[−][src]Trait log::key_values::source::Source
A source for key value pairs that can be serialized.
Required methods
fn visit<'kvs>(&'kvs self, visitor: &mut dyn Visitor<'kvs>) -> Result<(), Error>
Serialize the key value pairs.
Provided methods
fn erase(&self) -> ErasedSource where
Self: Sized,
Self: Sized,
Erase this Source
so it can be used without
requiring generic type parameters.
fn get<'kvs, Q>(&'kvs self, key: Q) -> Option<Value<'kvs>> where
Q: ToKey,
Q: ToKey,
Find the value for a given key.
If the key is present multiple times, whether or not this method will return the first or last value for a given key is not defined.
The default implementation will scan all key-value pairs.
Implementors are encouraged provide a more efficient version
if they can. Standard collections like BTreeMap
and HashMap
will do an indexed lookup instead of a scan.
fn by_ref(&self) -> &Self
An adapter to borrow self.
fn chain<KVS>(self, other: KVS) -> Chained<Self, KVS> where
Self: Sized,
Self: Sized,
Chain two Source
s together.
fn try_for_each<F, E>(self, f: F) -> Result<(), Error> where
Self: Sized,
F: FnMut(Key, Value) -> Result<(), E>,
E: Into<Error>,
Self: Sized,
F: FnMut(Key, Value) -> Result<(), E>,
E: Into<Error>,
Apply a function to each key-value pair.
fn as_map(self) -> AsMap<Self> where
Self: Sized,
Self: Sized,
Serialize the key-value pairs as a map.
fn as_seq(self) -> AsSeq<Self> where
Self: Sized,
Self: Sized,
Serialize the key-value pairs as a sequence.
Implementations on Foreign Types
impl<'a, T: ?Sized> Source for &'a T where
T: Source,
[src]
T: Source,
fn visit<'kvs>(&'kvs self, visitor: &mut dyn Visitor<'kvs>) -> Result<(), Error>
[src]
fn get<'kvs, Q>(&'kvs self, key: Q) -> Option<Value<'kvs>> where
Q: ToKey,
[src]
Q: ToKey,
fn erase(&self) -> ErasedSource where
Self: Sized,
[src]
Self: Sized,
fn by_ref(&self) -> &Self
[src]
fn chain<KVS>(self, other: KVS) -> Chained<Self, KVS> where
Self: Sized,
[src]
Self: Sized,
fn try_for_each<F, E>(self, f: F) -> Result<(), Error> where
Self: Sized,
F: FnMut(Key, Value) -> Result<(), E>,
E: Into<Error>,
[src]
Self: Sized,
F: FnMut(Key, Value) -> Result<(), E>,
E: Into<Error>,
fn as_map(self) -> AsMap<Self> where
Self: Sized,
[src]
Self: Sized,
fn as_seq(self) -> AsSeq<Self> where
Self: Sized,
[src]
Self: Sized,
impl<K, V> Source for (K, V) where
K: ToKey,
V: ToValue,
[src]
K: ToKey,
V: ToValue,
fn visit<'kvs>(&'kvs self, visitor: &mut dyn Visitor<'kvs>) -> Result<(), Error>
[src]
fn erase(&self) -> ErasedSource where
Self: Sized,
[src]
Self: Sized,
fn get<'kvs, Q>(&'kvs self, key: Q) -> Option<Value<'kvs>> where
Q: ToKey,
[src]
Q: ToKey,
fn by_ref(&self) -> &Self
[src]
fn chain<KVS>(self, other: KVS) -> Chained<Self, KVS> where
Self: Sized,
[src]
Self: Sized,
fn try_for_each<F, E>(self, f: F) -> Result<(), Error> where
Self: Sized,
F: FnMut(Key, Value) -> Result<(), E>,
E: Into<Error>,
[src]
Self: Sized,
F: FnMut(Key, Value) -> Result<(), E>,
E: Into<Error>,
fn as_map(self) -> AsMap<Self> where
Self: Sized,
[src]
Self: Sized,
fn as_seq(self) -> AsSeq<Self> where
Self: Sized,
[src]
Self: Sized,
impl<KVS> Source for [KVS] where
KVS: Source,
[src]
KVS: Source,
fn visit<'kvs>(&'kvs self, visitor: &mut dyn Visitor<'kvs>) -> Result<(), Error>
[src]
fn erase(&self) -> ErasedSource where
Self: Sized,
[src]
Self: Sized,
fn get<'kvs, Q>(&'kvs self, key: Q) -> Option<Value<'kvs>> where
Q: ToKey,
[src]
Q: ToKey,
fn by_ref(&self) -> &Self
[src]
fn chain<KVS>(self, other: KVS) -> Chained<Self, KVS> where
Self: Sized,
[src]
Self: Sized,
fn try_for_each<F, E>(self, f: F) -> Result<(), Error> where
Self: Sized,
F: FnMut(Key, Value) -> Result<(), E>,
E: Into<Error>,
[src]
Self: Sized,
F: FnMut(Key, Value) -> Result<(), E>,
E: Into<Error>,
fn as_map(self) -> AsMap<Self> where
Self: Sized,
[src]
Self: Sized,
fn as_seq(self) -> AsSeq<Self> where
Self: Sized,
[src]
Self: Sized,
impl<KVS: ?Sized> Source for Box<KVS> where
KVS: Source,
[src]
KVS: Source,
fn visit<'kvs>(&'kvs self, visitor: &mut dyn Visitor<'kvs>) -> Result<(), Error>
[src]
fn erase(&self) -> ErasedSource where
Self: Sized,
[src]
Self: Sized,
fn get<'kvs, Q>(&'kvs self, key: Q) -> Option<Value<'kvs>> where
Q: ToKey,
[src]
Q: ToKey,
fn by_ref(&self) -> &Self
[src]
fn chain<KVS>(self, other: KVS) -> Chained<Self, KVS> where
Self: Sized,
[src]
Self: Sized,
fn try_for_each<F, E>(self, f: F) -> Result<(), Error> where
Self: Sized,
F: FnMut(Key, Value) -> Result<(), E>,
E: Into<Error>,
[src]
Self: Sized,
F: FnMut(Key, Value) -> Result<(), E>,
E: Into<Error>,
fn as_map(self) -> AsMap<Self> where
Self: Sized,
[src]
Self: Sized,
fn as_seq(self) -> AsSeq<Self> where
Self: Sized,
[src]
Self: Sized,
impl<KVS: ?Sized> Source for Arc<KVS> where
KVS: Source,
[src]
KVS: Source,
fn visit<'kvs>(&'kvs self, visitor: &mut dyn Visitor<'kvs>) -> Result<(), Error>
[src]
fn erase(&self) -> ErasedSource where
Self: Sized,
[src]
Self: Sized,
fn get<'kvs, Q>(&'kvs self, key: Q) -> Option<Value<'kvs>> where
Q: ToKey,
[src]
Q: ToKey,
fn by_ref(&self) -> &Self
[src]
fn chain<KVS>(self, other: KVS) -> Chained<Self, KVS> where
Self: Sized,
[src]
Self: Sized,
fn try_for_each<F, E>(self, f: F) -> Result<(), Error> where
Self: Sized,
F: FnMut(Key, Value) -> Result<(), E>,
E: Into<Error>,
[src]
Self: Sized,
F: FnMut(Key, Value) -> Result<(), E>,
E: Into<Error>,
fn as_map(self) -> AsMap<Self> where
Self: Sized,
[src]
Self: Sized,
fn as_seq(self) -> AsSeq<Self> where
Self: Sized,
[src]
Self: Sized,
impl<KVS: ?Sized> Source for Rc<KVS> where
KVS: Source,
[src]
KVS: Source,
fn visit<'kvs>(&'kvs self, visitor: &mut dyn Visitor<'kvs>) -> Result<(), Error>
[src]
fn erase(&self) -> ErasedSource where
Self: Sized,
[src]
Self: Sized,
fn get<'kvs, Q>(&'kvs self, key: Q) -> Option<Value<'kvs>> where
Q: ToKey,
[src]
Q: ToKey,
fn by_ref(&self) -> &Self
[src]
fn chain<KVS>(self, other: KVS) -> Chained<Self, KVS> where
Self: Sized,
[src]
Self: Sized,
fn try_for_each<F, E>(self, f: F) -> Result<(), Error> where
Self: Sized,
F: FnMut(Key, Value) -> Result<(), E>,
E: Into<Error>,
[src]
Self: Sized,
F: FnMut(Key, Value) -> Result<(), E>,
E: Into<Error>,
fn as_map(self) -> AsMap<Self> where
Self: Sized,
[src]
Self: Sized,
fn as_seq(self) -> AsSeq<Self> where
Self: Sized,
[src]
Self: Sized,
impl<KVS> Source for Vec<KVS> where
KVS: Source,
[src]
KVS: Source,
fn visit<'kvs>(&'kvs self, visitor: &mut dyn Visitor<'kvs>) -> Result<(), Error>
[src]
fn erase(&self) -> ErasedSource where
Self: Sized,
[src]
Self: Sized,
fn get<'kvs, Q>(&'kvs self, key: Q) -> Option<Value<'kvs>> where
Q: ToKey,
[src]
Q: ToKey,
fn by_ref(&self) -> &Self
[src]
fn chain<KVS>(self, other: KVS) -> Chained<Self, KVS> where
Self: Sized,
[src]
Self: Sized,
fn try_for_each<F, E>(self, f: F) -> Result<(), Error> where
Self: Sized,
F: FnMut(Key, Value) -> Result<(), E>,
E: Into<Error>,
[src]
Self: Sized,
F: FnMut(Key, Value) -> Result<(), E>,
E: Into<Error>,
fn as_map(self) -> AsMap<Self> where
Self: Sized,
[src]
Self: Sized,
fn as_seq(self) -> AsSeq<Self> where
Self: Sized,
[src]
Self: Sized,
impl<K, V> Source for BTreeMap<K, V> where
K: Borrow<str> + Ord,
V: ToValue,
[src]
K: Borrow<str> + Ord,
V: ToValue,
fn visit<'kvs>(&'kvs self, visitor: &mut dyn Visitor<'kvs>) -> Result<(), Error>
[src]
fn get<'kvs, Q>(&'kvs self, key: Q) -> Option<Value<'kvs>> where
Q: ToKey,
[src]
Q: ToKey,
fn erase(&self) -> ErasedSource where
Self: Sized,
[src]
Self: Sized,
fn by_ref(&self) -> &Self
[src]
fn chain<KVS>(self, other: KVS) -> Chained<Self, KVS> where
Self: Sized,
[src]
Self: Sized,
fn try_for_each<F, E>(self, f: F) -> Result<(), Error> where
Self: Sized,
F: FnMut(Key, Value) -> Result<(), E>,
E: Into<Error>,
[src]
Self: Sized,
F: FnMut(Key, Value) -> Result<(), E>,
E: Into<Error>,
fn as_map(self) -> AsMap<Self> where
Self: Sized,
[src]
Self: Sized,
fn as_seq(self) -> AsSeq<Self> where
Self: Sized,
[src]
Self: Sized,
impl<K, V> Source for HashMap<K, V> where
K: Borrow<str> + Eq + Hash,
V: ToValue,
[src]
K: Borrow<str> + Eq + Hash,
V: ToValue,
fn visit<'kvs>(&'kvs self, visitor: &mut dyn Visitor<'kvs>) -> Result<(), Error>
[src]
fn get<'kvs, Q>(&'kvs self, key: Q) -> Option<Value<'kvs>> where
Q: ToKey,
[src]
Q: ToKey,
fn erase(&self) -> ErasedSource where
Self: Sized,
[src]
Self: Sized,
fn by_ref(&self) -> &Self
[src]
fn chain<KVS>(self, other: KVS) -> Chained<Self, KVS> where
Self: Sized,
[src]
Self: Sized,
fn try_for_each<F, E>(self, f: F) -> Result<(), Error> where
Self: Sized,
F: FnMut(Key, Value) -> Result<(), E>,
E: Into<Error>,
[src]
Self: Sized,
F: FnMut(Key, Value) -> Result<(), E>,
E: Into<Error>,
fn as_map(self) -> AsMap<Self> where
Self: Sized,
[src]
Self: Sized,
fn as_seq(self) -> AsSeq<Self> where
Self: Sized,
[src]
Self: Sized,
Implementors
impl<'a> Source for ErasedSource<'a>
[src]
fn visit<'kvs>(&'kvs self, visitor: &mut dyn Visitor<'kvs>) -> Result<(), Error>
[src]
fn get<'kvs, Q>(&'kvs self, key: Q) -> Option<Value<'kvs>> where
Q: ToKey,
[src]
Q: ToKey,
fn erase(&self) -> ErasedSource where
Self: Sized,
[src]
Self: Sized,
fn by_ref(&self) -> &Self
[src]
fn chain<KVS>(self, other: KVS) -> Chained<Self, KVS> where
Self: Sized,
[src]
Self: Sized,
fn try_for_each<F, E>(self, f: F) -> Result<(), Error> where
Self: Sized,
F: FnMut(Key, Value) -> Result<(), E>,
E: Into<Error>,
[src]
Self: Sized,
F: FnMut(Key, Value) -> Result<(), E>,
E: Into<Error>,
fn as_map(self) -> AsMap<Self> where
Self: Sized,
[src]
Self: Sized,
fn as_seq(self) -> AsSeq<Self> where
Self: Sized,
[src]
Self: Sized,
impl<A, B> Source for Chained<A, B> where
A: Source,
B: Source,
[src]
A: Source,
B: Source,
fn visit<'kvs>(&'kvs self, visitor: &mut dyn Visitor<'kvs>) -> Result<(), Error>
[src]
fn erase(&self) -> ErasedSource where
Self: Sized,
[src]
Self: Sized,
fn get<'kvs, Q>(&'kvs self, key: Q) -> Option<Value<'kvs>> where
Q: ToKey,
[src]
Q: ToKey,
fn by_ref(&self) -> &Self
[src]
fn chain<KVS>(self, other: KVS) -> Chained<Self, KVS> where
Self: Sized,
[src]
Self: Sized,
fn try_for_each<F, E>(self, f: F) -> Result<(), Error> where
Self: Sized,
F: FnMut(Key, Value) -> Result<(), E>,
E: Into<Error>,
[src]
Self: Sized,
F: FnMut(Key, Value) -> Result<(), E>,
E: Into<Error>,
fn as_map(self) -> AsMap<Self> where
Self: Sized,
[src]
Self: Sized,
fn as_seq(self) -> AsSeq<Self> where
Self: Sized,
[src]
Self: Sized,