Struct ruarango::coll::output::CreateKeyOptions
source · pub struct CreateKeyOptions { /* private fields */ }
Expand description
Key options that are part of the Create
output
Implementations§
source§impl CreateKeyOptions
impl CreateKeyOptions
sourcepub fn allow_user_keys(&self) -> &bool
pub fn allow_user_keys(&self) -> &bool
If set to true, then it is allowed to supply own key values in the _key attribute of a document. If set to false, then the key generator will solely be responsible for generating keys and supplying own key values in the _key attribute of documents is considered an error.
sourcepub fn last_value(&self) -> &usize
pub fn last_value(&self) -> &usize
The last key value used
sourcepub fn kind(&self) -> &String
pub fn kind(&self) -> &String
Specifies the type of the key generator. The currently available generators are traditional, autoincrement, uuid and padded.
The traditional key generator generates numerical keys in ascending order. The autoincrement key generator generates numerical keys in ascending order, the initial offset and the spacing can be configured (note: autoincrement is currently only supported for non-sharded collections). The padded key generator generates keys of a fixed length (16 bytes) in ascending lexicographical sort order. This is ideal for usage with the RocksDB engine, which will slightly benefit keys that are inserted in lexicographically ascending order. The key generator can be used in a single-server or cluster. The uuid key generator generates universally unique 128 bit keys, which are stored in hexadecimal human-readable format. This key generator can be used in a single-server or cluster to generate “seemingly random” keys. The keys produced by this key generator are not lexicographically sorted.
Trait Implementations§
source§impl Clone for CreateKeyOptions
impl Clone for CreateKeyOptions
source§fn clone(&self) -> CreateKeyOptions
fn clone(&self) -> CreateKeyOptions
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more