pub struct Unique {
    pub value: String,
}

Fields§

§value: String

Implementations§

source§

impl Unique

source

pub fn new(value: impl Display) -> Self

Trait Implementations§

source§

impl Clone for Unique

source§

fn clone(&self) -> Unique

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Collection for Unique

§

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

The unique name of this collection. Each collection must be uniquely named within the Schema it is registered within.
source§

fn define_views(schema: &mut Schematic) -> Result<(), Error>

Defines all Views in this collection in schema.
source§

fn encryption_key() -> Option<KeyId>

If a KeyId is returned, this collection will be stored encrypted at-rest using the key specified.
source§

impl Debug for Unique

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Unique

source§

fn default() -> Unique

Returns the “default value” for a type. Read more
source§

impl DefaultSerialization for Unique

source§

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

source§

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

§

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,

Gets a CollectionDocument with id from connection.
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,

Gets a CollectionDocument with id from connection.
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,

Gets a CollectionDocument with id from connection.
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,

Gets a CollectionDocument with id from connection.
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,

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,

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,

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,

Deletes a document by its name. Returns true if a document was deleted.
source§

impl PartialEq<Unique> for Unique

source§

fn eq(&self, other: &Unique) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl Serialize for Unique

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Eq for Unique

source§

impl StructuralEq for Unique

source§

impl StructuralPartialEq for Unique

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T> Instrument for T

source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> Schema for Twhere T: Collection + 'static,

source§

fn schema_name() -> SchemaName

Returns the unique SchemaName for this schema.
source§

fn define_collections(schema: &mut Schematic) -> Result<(), Error>

Defines the Collections into schema.
source§

fn schematic() -> Result<Schematic, Error>

Retrieves the Schematic for this schema.
source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

source§

impl<T> WithSubscriber for T

source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
source§

impl<T> DeserializeOwned for Twhere T: for<'de> Deserialize<'de>,