pub struct Props(/* private fields */);Expand description
An ordered list of props: key and value pairs.
Build it with the props! macro, with Props::with, or
collect it from an iterator of pairs. Setting a key that is already there
replaces its value and keeps its place.
use privatus_analytics::{props, Props};
let a = props! { "plan" => "pro", "seats" => 5, "beta" => true };
let b = Props::new().with("plan", "pro").with("seats", 5).with("beta", true);
assert_eq!(a, b);Implementations§
Trait Implementations§
Source§impl<K: Into<String>, V: Into<Value>> Extend<(K, V)> for Props
impl<K: Into<String>, V: Into<Value>> Extend<(K, V)> for Props
Source§fn extend<I: IntoIterator<Item = (K, V)>>(&mut self, iter: I)
fn extend<I: IntoIterator<Item = (K, V)>>(&mut self, iter: I)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: T)
fn extend_one(&mut self, item: T)
🔬This is a nightly-only experimental API. (
extend_one)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl IntoIterator for Props
impl IntoIterator for Props
Source§impl<'a> IntoIterator for &'a Props
impl<'a> IntoIterator for &'a Props
impl StructuralPartialEq for Props
Auto Trait Implementations§
impl Freeze for Props
impl RefUnwindSafe for Props
impl Send for Props
impl Sync for Props
impl Unpin for Props
impl UnsafeUnpin for Props
impl UnwindSafe for Props
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