Struct bonsaidb_core::test_util::Unique
source · pub struct Unique {
pub value: String,
}
Fields§
§value: String
Implementations§
Trait Implementations§
source§impl Collection for Unique
impl Collection for Unique
§type PrimaryKey = u64
type PrimaryKey = u64
The unique id type. Each document stored in a collection will be
uniquely identified by this type. Read more
source§fn collection_name() -> CollectionName
fn collection_name() -> CollectionName
The unique name of this collection. Each collection must be uniquely
named within the
Schema
it is registered
within.source§impl DefaultSerialization for Unique
impl DefaultSerialization for Unique
source§fn natural_id(&self) -> Option<Self::PrimaryKey>
fn natural_id(&self) -> Option<Self::PrimaryKey>
Returns the natural identifier of
contents
. This is called when
pushing values into a collection, before attempting to automatically
assign a unique id.source§impl<'de> Deserialize<'de> for Unique
impl<'de> Deserialize<'de> for Unique
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl NamedCollection for Unique
impl NamedCollection for Unique
§type ByNameView = UniqueValue
type ByNameView = UniqueValue
The name view defined for the collection.
source§fn load<'name, N: Nameable<'name, Self::PrimaryKey> + Send + Sync, C: Connection>(
id: N,
connection: &C
) -> Result<Option<CollectionDocument<Self>>, Error>where
Self: SerializedCollection + Sized + 'static,
fn load<'name, N: Nameable<'name, Self::PrimaryKey> + Send + Sync, C: Connection>( id: N, connection: &C ) -> Result<Option<CollectionDocument<Self>>, Error>where Self: SerializedCollection + Sized + 'static,
source§fn load_async<'name, 'life0, 'async_trait, N, C>(
id: N,
connection: &'life0 C
) -> Pin<Box<dyn Future<Output = Result<Option<CollectionDocument<Self>>, Error>> + Send + 'async_trait>>where
Self: SerializedCollection + Sized + 'static + Send + 'async_trait,
N: 'async_trait + Nameable<'name, Self::PrimaryKey> + Send + Sync,
C: 'async_trait + AsyncConnection,
'name: 'async_trait,
'life0: 'async_trait,
fn load_async<'name, 'life0, 'async_trait, N, C>( id: N, connection: &'life0 C ) -> Pin<Box<dyn Future<Output = Result<Option<CollectionDocument<Self>>, Error>> + Send + 'async_trait>>where Self: SerializedCollection + Sized + 'static + Send + 'async_trait, N: 'async_trait + Nameable<'name, Self::PrimaryKey> + Send + Sync, C: 'async_trait + AsyncConnection, 'name: 'async_trait, 'life0: 'async_trait,
source§fn entry<'connection, 'name, N: Into<NamedReference<'name, Self::PrimaryKey>> + Send + Sync, C: Connection>(
id: N,
connection: &'connection C
) -> Entry<'connection, 'name, C, Self, (), ()>where
Self: SerializedCollection + Sized,
fn entry<'connection, 'name, N: Into<NamedReference<'name, Self::PrimaryKey>> + Send + Sync, C: Connection>( id: N, connection: &'connection C ) -> Entry<'connection, 'name, C, Self, (), ()>where Self: SerializedCollection + Sized,
source§fn entry_async<'connection, 'name, N: Into<NamedReference<'name, Self::PrimaryKey>> + Send + Sync, C: AsyncConnection>(
id: N,
connection: &'connection C
) -> AsyncEntry<'connection, 'name, C, Self, (), ()> ⓘwhere
Self: SerializedCollection + Sized,
fn entry_async<'connection, 'name, N: Into<NamedReference<'name, Self::PrimaryKey>> + Send + Sync, C: AsyncConnection>( id: N, connection: &'connection C ) -> AsyncEntry<'connection, 'name, C, Self, (), ()> ⓘwhere Self: SerializedCollection + Sized,
source§fn load_document<'name, N: Nameable<'name, Self::PrimaryKey> + Send + Sync, C: Connection>(
name: N,
connection: &C
) -> Result<Option<OwnedDocument>, Error>where
Self: SerializedCollection + Sized,
fn load_document<'name, N: Nameable<'name, Self::PrimaryKey> + Send + Sync, C: Connection>( name: N, connection: &C ) -> Result<Option<OwnedDocument>, Error>where Self: SerializedCollection + Sized,
Loads a document from this collection by name, if applicable. Return
Ok(None)
if unsupported.source§fn load_document_async<'name, 'life0, 'async_trait, N, C>(
name: N,
connection: &'life0 C
) -> Pin<Box<dyn Future<Output = Result<Option<OwnedDocument>, Error>> + Send + 'async_trait>>where
Self: SerializedCollection + Sized + Send + 'async_trait,
N: 'async_trait + Nameable<'name, Self::PrimaryKey> + Send + Sync,
C: 'async_trait + AsyncConnection,
'name: 'async_trait,
'life0: 'async_trait,
fn load_document_async<'name, 'life0, 'async_trait, N, C>( name: N, connection: &'life0 C ) -> Pin<Box<dyn Future<Output = Result<Option<OwnedDocument>, Error>> + Send + 'async_trait>>where Self: SerializedCollection + Sized + Send + 'async_trait, N: 'async_trait + Nameable<'name, Self::PrimaryKey> + Send + Sync, C: 'async_trait + AsyncConnection, 'name: 'async_trait, 'life0: 'async_trait,
Loads a document from this collection by name, if applicable. Return
Ok(None)
if unsupported.source§fn delete_by_name<C: Connection>(
name: &str,
connection: &C
) -> Result<bool, Error>where
Self: SerializedCollection + Sized,
fn delete_by_name<C: Connection>( name: &str, connection: &C ) -> Result<bool, Error>where Self: SerializedCollection + Sized,
Deletes a document by its name. Returns true if a document was deleted.
source§fn delete_by_name_async<'life0, 'life1, 'async_trait, C>(
name: &'life0 str,
connection: &'life1 C
) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait>>where
Self: SerializedCollection + Sized + Send + 'async_trait,
C: 'async_trait + AsyncConnection,
'life0: 'async_trait,
'life1: 'async_trait,
fn delete_by_name_async<'life0, 'life1, 'async_trait, C>( name: &'life0 str, connection: &'life1 C ) -> Pin<Box<dyn Future<Output = Result<bool, Error>> + Send + 'async_trait>>where Self: SerializedCollection + Sized + Send + 'async_trait, C: 'async_trait + AsyncConnection, 'life0: 'async_trait, 'life1: 'async_trait,
Deletes a document by its name. Returns true if a document was deleted.
source§impl PartialEq<Unique> for Unique
impl PartialEq<Unique> for Unique
impl Eq for Unique
impl StructuralEq for Unique
impl StructuralPartialEq for Unique
Auto Trait Implementations§
impl RefUnwindSafe for Unique
impl Send for Unique
impl Sync for Unique
impl Unpin for Unique
impl UnwindSafe for Unique
Blanket Implementations§
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> Schema for Twhere
T: Collection + 'static,
impl<T> Schema for Twhere T: Collection + 'static,
source§fn schema_name() -> SchemaName
fn schema_name() -> SchemaName
Returns the unique
SchemaName
for this schema.