pub struct OwnedProps { /* private fields */ }Expand description
A set of owned Props.
Properties are deduplicated, but the original iteration order is retained. If the collection is created from OwnedProps::collect_shared then cloning is also cheap.
§Implementation details
Internally, OwnedProps is backed by a hashtable to make key lookup efficient. Each entry in the table also forms a linked list in iteration order.
The hash algorithm used is FNV-1a.
Implementations§
Source§impl OwnedProps
impl OwnedProps
Sourcepub fn collect_owned(props: impl Props) -> Self
pub fn collect_owned(props: impl Props) -> Self
Collect a set of Props into an owned collection.
Cloning will involve cloning the collection.
Collect a set of Props into an owned collection.
Cloning will involve cloning the Arc, which may be cheaper than cloning the collection itself.
Get a new collection, taking an owned copy of the data in this one.
If the collection already contains an Arc value then this method is a cheap referenced counted clone.
Trait Implementations§
Source§impl Clone for OwnedProps
impl Clone for OwnedProps
Source§impl Drop for OwnedProps
impl Drop for OwnedProps
Source§impl<'kv> FromProps<'kv> for OwnedProps
impl<'kv> FromProps<'kv> for OwnedProps
Source§impl Props for OwnedProps
impl Props for OwnedProps
Source§fn for_each<'kv, F: FnMut(Str<'kv>, Value<'kv>) -> ControlFlow<()>>(
&'kv self,
for_each: F,
) -> ControlFlow<()>
fn for_each<'kv, F: FnMut(Str<'kv>, Value<'kv>) -> ControlFlow<()>>( &'kv self, for_each: F, ) -> ControlFlow<()>
Source§fn get<'v, K: ToStr>(&'v self, key: K) -> Option<Value<'v>>
fn get<'v, K: ToStr>(&'v self, key: K) -> Option<Value<'v>>
Source§fn is_unique(&self) -> bool
fn is_unique(&self) -> bool
Source§fn size(&self) -> Option<usize>
fn size(&self) -> Option<usize>
Source§fn pull<'kv, V: FromValue<'kv>, K: ToStr>(&'kv self, key: K) -> Option<V>
fn pull<'kv, V: FromValue<'kv>, K: ToStr>(&'kv self, key: K) -> Option<V>
V. Read moreSource§fn and_props<U: Props>(self, other: U) -> And<Self, U>where
Self: Sized,
fn and_props<U: Props>(self, other: U) -> And<Self, U>where
Self: Sized,
other to the end of self.