Struct edgedb_protocol::value::SparseObject
source · pub struct SparseObject { /* private fields */ }
Implementations§
source§impl SparseObject
impl SparseObject
sourcepub fn from_pairs<N: ToString, V: Into<Option<Value>>>(
iter: impl IntoIterator<Item = (N, V)>
) -> SparseObject
pub fn from_pairs<N: ToString, V: Into<Option<Value>>>( iter: impl IntoIterator<Item = (N, V)> ) -> SparseObject
Create a new sparse object from key-value pairs
Note: this method has two limitations:
- Shape created uses
AtMostOne
cardinality for all the elements. - There are no extra shape elements Both of these are irrelevant when serializing the object.
sourcepub fn empty() -> SparseObject
pub fn empty() -> SparseObject
Create an empty sparse object
pub fn pairs(&self) -> impl Iterator<Item = (&str, Option<&Value>)>
Trait Implementations§
source§impl Clone for SparseObject
impl Clone for SparseObject
source§fn clone(&self) -> SparseObject
fn clone(&self) -> SparseObject
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for SparseObject
impl Debug for SparseObject
source§impl PartialEq<SparseObject> for SparseObject
impl PartialEq<SparseObject> for SparseObject
source§fn eq(&self, other: &SparseObject) -> bool
fn eq(&self, other: &SparseObject) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.Auto Trait Implementations§
impl RefUnwindSafe for SparseObject
impl Send for SparseObject
impl Sync for SparseObject
impl Unpin for SparseObject
impl UnwindSafe for SparseObject
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