pub struct ShardKey {
pub fields: Vec<(String, ShardKeyType)>,
pub unique: bool,
}Expand description
A shard key definition.
Fields§
§fields: Vec<(String, ShardKeyType)>Fields in the shard key.
unique: boolWhether the collection is unique on the shard key.
Implementations§
Source§impl ShardKey
impl ShardKey
Sourcepub fn builder() -> ShardKeyBuilder
pub fn builder() -> ShardKeyBuilder
Create a new shard key builder.
Sourcepub fn shard_collection_command(
&self,
database: &str,
collection: &str,
) -> Value
pub fn shard_collection_command( &self, database: &str, collection: &str, ) -> Value
Get the shardCollection command.
Sourcepub fn index_spec(&self) -> Value
pub fn index_spec(&self) -> Value
Get the index specification for the shard key.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ShardKey
impl<'de> Deserialize<'de> for ShardKey
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
impl Eq for ShardKey
impl StructuralPartialEq for ShardKey
Auto Trait Implementations§
impl Freeze for ShardKey
impl RefUnwindSafe for ShardKey
impl Send for ShardKey
impl Sync for ShardKey
impl Unpin for ShardKey
impl UnwindSafe for ShardKey
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