Expand description
A simple key-value storage
Keeps pairs of (&'static str, Rc<dyn Display>)
and is used to pass key-value pairs to
Observers
in each iteration of an optimization algorithm.
Typically constructed using the make_kv!
macro.
Example
use argmin::make_kv;
let kv = make_kv!(
"key1" => "value1";
"key2" => "value2";
"key3" => 1234;
);
Fields
kv: Vec<(&'static str, Rc<dyn Display>)>
The actual key value storage
Implementations
Trait Implementations
sourceimpl Extend<(&'static str, Rc<dyn Display + 'static>)> for KV
impl Extend<(&'static str, Rc<dyn Display + 'static>)> for KV
sourcefn extend<I: IntoIterator<Item = (&'static str, Rc<dyn Display>)>>(
&mut self,
iter: I
)
fn extend<I: IntoIterator<Item = (&'static str, Rc<dyn Display>)>>(
&mut self,
iter: I
)
Extends a collection with the contents of an iterator. Read more
sourcefn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
extend_one
)Extends a collection with exactly one element.
sourcefn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
Auto Trait Implementations
impl !RefUnwindSafe for KV
impl !Send for KV
impl !Sync for KV
impl Unpin for KV
impl !UnwindSafe for KV
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
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SP where
SS: SubsetOf<SP>,
fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct self
from the equivalent element of its
superset. Read more
fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if self
is actually part of its subset T
(and can be converted to it).
fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as self.to_subset
but without any property checks. Always succeeds.
fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts self
to the equivalent element of its superset.
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)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more