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 duplicate 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 Freeze for KeyBuilder
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more