Struct meilisearch_sdk::key::KeyBuilder
source · pub struct KeyBuilder {
pub actions: Vec<Action>,
pub description: Option<String>,
pub name: Option<String>,
pub uid: Option<String>,
pub expires_at: Option<OffsetDateTime>,
pub indexes: Vec<String>,
}
Expand description
The KeyBuilder
is an analog to the Key type but without all the fields managed by Meilisearch.
It’s used to create Key.
§Example
let description = "My little lovely test key".to_string();
let key = KeyBuilder::new()
.with_description(&description)
.execute(&client).await.unwrap();
assert_eq!(key.description, Some(description));
Fields§
§actions: Vec<Action>
§description: Option<String>
§name: Option<String>
§uid: Option<String>
§expires_at: Option<OffsetDateTime>
§indexes: Vec<String>
Implementations§
source§impl KeyBuilder
impl KeyBuilder
sourcepub fn new() -> KeyBuilder
pub fn new() -> KeyBuilder
sourcepub fn with_actions(
&mut self,
actions: impl IntoIterator<Item = Action>
) -> &mut KeyBuilder
pub fn with_actions( &mut self, actions: impl IntoIterator<Item = Action> ) -> &mut KeyBuilder
sourcepub fn with_action(&mut self, action: Action) -> &mut KeyBuilder
pub fn with_action(&mut self, action: Action) -> &mut KeyBuilder
sourcepub fn with_expires_at(&mut self, expires_at: OffsetDateTime) -> &mut KeyBuilder
pub fn with_expires_at(&mut self, expires_at: OffsetDateTime) -> &mut KeyBuilder
sourcepub fn with_indexes(
&mut self,
indexes: impl IntoIterator<Item = impl AsRef<str>>
) -> &mut KeyBuilder
pub fn with_indexes( &mut self, indexes: impl IntoIterator<Item = impl AsRef<str>> ) -> &mut KeyBuilder
sourcepub fn with_index(&mut self, index: impl AsRef<str>) -> &mut KeyBuilder
pub fn with_index(&mut self, index: impl AsRef<str>) -> &mut KeyBuilder
sourcepub fn with_description(&mut self, desc: impl AsRef<str>) -> &mut KeyBuilder
pub fn with_description(&mut self, desc: impl AsRef<str>) -> &mut KeyBuilder
sourcepub fn with_name(&mut self, desc: impl AsRef<str>) -> &mut KeyBuilder
pub fn with_name(&mut self, desc: impl AsRef<str>) -> &mut KeyBuilder
sourcepub fn with_uid(&mut self, desc: impl AsRef<str>) -> &mut KeyBuilder
pub fn with_uid(&mut self, desc: impl AsRef<str>) -> &mut KeyBuilder
Trait Implementations§
source§impl AsRef<KeyBuilder> for KeyBuilder
impl AsRef<KeyBuilder> for KeyBuilder
source§fn as_ref(&self) -> &KeyBuilder
fn as_ref(&self) -> &KeyBuilder
Converts this type into a shared reference of the (usually inferred) input type.
source§impl Clone for KeyBuilder
impl Clone for KeyBuilder
source§fn clone(&self) -> KeyBuilder
fn clone(&self) -> KeyBuilder
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 moresource§impl Debug for KeyBuilder
impl Debug for KeyBuilder
source§impl Default for KeyBuilder
impl Default for KeyBuilder
source§fn default() -> KeyBuilder
fn default() -> KeyBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl RefUnwindSafe for KeyBuilder
impl Send for KeyBuilder
impl Sync for KeyBuilder
impl Unpin for KeyBuilder
impl UnwindSafe for KeyBuilder
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