Struct bonsaidb::core::document::CollectionHeader
pub struct CollectionHeader<PrimaryKey> {
pub id: PrimaryKey,
pub revision: Revision,
}
Expand description
A header for a CollectionDocument
.
Fields§
§id: PrimaryKey
The unique id of the document.
revision: Revision
The revision of the document.
Trait Implementations§
§impl<PrimaryKey> Clone for CollectionHeader<PrimaryKey>where
PrimaryKey: Clone,
impl<PrimaryKey> Clone for CollectionHeader<PrimaryKey>where PrimaryKey: Clone,
§fn clone(&self) -> CollectionHeader<PrimaryKey>
fn clone(&self) -> CollectionHeader<PrimaryKey>
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 more§impl<PrimaryKey> Debug for CollectionHeader<PrimaryKey>where
PrimaryKey: Debug,
impl<PrimaryKey> Debug for CollectionHeader<PrimaryKey>where PrimaryKey: Debug,
§impl<'de, PrimaryKey> Deserialize<'de> for CollectionHeader<PrimaryKey>where
PrimaryKey: Deserialize<'de>,
impl<'de, PrimaryKey> Deserialize<'de> for CollectionHeader<PrimaryKey>where PrimaryKey: Deserialize<'de>,
§fn deserialize<__D>(
__deserializer: __D
) -> Result<CollectionHeader<PrimaryKey>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<CollectionHeader<PrimaryKey>, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl<PrimaryKey> Emit for CollectionHeader<PrimaryKey>where
PrimaryKey: for<'k> Key<'k>,
impl<PrimaryKey> Emit for CollectionHeader<PrimaryKey>where PrimaryKey: for<'k> Key<'k>,
§fn emit_key_and_value<K, Value>(
&self,
key: K,
value: Value
) -> Result<Mappings<K, Value>, Error>
fn emit_key_and_value<K, Value>( &self, key: K, value: Value ) -> Result<Mappings<K, Value>, Error>
Creates a
Map
result with a key
and value
.§fn emit_if(&self, condition: bool) -> Result<Mappings<(), ()>, Error>
fn emit_if(&self, condition: bool) -> Result<Mappings<(), ()>, Error>
Creates a
Map
result with an empty key and value if condition
is
true.§impl<PrimaryKey> HasHeader for CollectionHeader<PrimaryKey>where
PrimaryKey: for<'k> Key<'k>,
impl<PrimaryKey> HasHeader for CollectionHeader<PrimaryKey>where PrimaryKey: for<'k> Key<'k>,
§impl<PrimaryKey> Hash for CollectionHeader<PrimaryKey>where
PrimaryKey: Hash,
impl<PrimaryKey> Hash for CollectionHeader<PrimaryKey>where PrimaryKey: Hash,
§impl<PrimaryKey> PartialEq<CollectionHeader<PrimaryKey>> for CollectionHeader<PrimaryKey>where
PrimaryKey: PartialEq<PrimaryKey>,
impl<PrimaryKey> PartialEq<CollectionHeader<PrimaryKey>> for CollectionHeader<PrimaryKey>where PrimaryKey: PartialEq<PrimaryKey>,
§fn eq(&self, other: &CollectionHeader<PrimaryKey>) -> bool
fn eq(&self, other: &CollectionHeader<PrimaryKey>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.§impl<PrimaryKey> Serialize for CollectionHeader<PrimaryKey>where
PrimaryKey: Serialize,
impl<PrimaryKey> Serialize for CollectionHeader<PrimaryKey>where PrimaryKey: Serialize,
§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where __S: Serializer,
Serialize this value into the given Serde serializer. Read more
§impl<'a, PrimaryKey> TryFrom<&'a CollectionHeader<PrimaryKey>> for Headerwhere
PrimaryKey: for<'k> Key<'k>,
impl<'a, PrimaryKey> TryFrom<&'a CollectionHeader<PrimaryKey>> for Headerwhere PrimaryKey: for<'k> Key<'k>,
§impl<'a, PrimaryKey> TryFrom<&'a Header> for CollectionHeader<PrimaryKey>where
PrimaryKey: for<'k> Key<'k>,
impl<'a, PrimaryKey> TryFrom<&'a Header> for CollectionHeader<PrimaryKey>where PrimaryKey: for<'k> Key<'k>,
§impl<PrimaryKey> TryFrom<CollectionHeader<PrimaryKey>> for Headerwhere
PrimaryKey: for<'k> Key<'k>,
impl<PrimaryKey> TryFrom<CollectionHeader<PrimaryKey>> for Headerwhere PrimaryKey: for<'k> Key<'k>,
§impl<PrimaryKey> TryFrom<Header> for CollectionHeader<PrimaryKey>where
PrimaryKey: for<'k> Key<'k>,
impl<PrimaryKey> TryFrom<Header> for CollectionHeader<PrimaryKey>where PrimaryKey: for<'k> Key<'k>,
impl<PrimaryKey> Copy for CollectionHeader<PrimaryKey>where PrimaryKey: Copy,
impl<PrimaryKey> Eq for CollectionHeader<PrimaryKey>where PrimaryKey: Eq,
impl<PrimaryKey> StructuralEq for CollectionHeader<PrimaryKey>
impl<PrimaryKey> StructuralPartialEq for CollectionHeader<PrimaryKey>
Auto Trait Implementations§
impl<PrimaryKey> RefUnwindSafe for CollectionHeader<PrimaryKey>where PrimaryKey: RefUnwindSafe,
impl<PrimaryKey> Send for CollectionHeader<PrimaryKey>where PrimaryKey: Send,
impl<PrimaryKey> Sync for CollectionHeader<PrimaryKey>where PrimaryKey: Sync,
impl<PrimaryKey> Unpin for CollectionHeader<PrimaryKey>where PrimaryKey: Unpin,
impl<PrimaryKey> UnwindSafe for CollectionHeader<PrimaryKey>where PrimaryKey: UnwindSafe,
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere T: 'a,
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
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.