pub struct ApiKeyBuilder { /* private fields */ }Expand description
Builder for ApiKey.
Implementations§
Source§impl ApiKeyBuilder
impl ApiKeyBuilder
Sourcepub fn new(key: impl Into<String>) -> ApiKeyBuilder
pub fn new(key: impl Into<String>) -> ApiKeyBuilder
Creates a new builder.
Sourcepub fn name(self, name: impl Into<String>) -> ApiKeyBuilder
pub fn name(self, name: impl Into<String>) -> ApiKeyBuilder
Sets the human-readable name.
Sourcepub fn owner(self, owner: impl Into<String>) -> ApiKeyBuilder
pub fn owner(self, owner: impl Into<String>) -> ApiKeyBuilder
Sets the owner.
Sourcepub fn roles(self, roles: Vec<String>) -> ApiKeyBuilder
pub fn roles(self, roles: Vec<String>) -> ApiKeyBuilder
Sets the roles.
Sourcepub fn role(self, role: impl Into<String>) -> ApiKeyBuilder
pub fn role(self, role: impl Into<String>) -> ApiKeyBuilder
Adds a role.
Sets the authorities.
Adds an authority.
Sourcepub fn enabled(self, enabled: bool) -> ApiKeyBuilder
pub fn enabled(self, enabled: bool) -> ApiKeyBuilder
Sets whether the key is enabled.
Sourcepub fn expires_at(self, expires_at: SystemTime) -> ApiKeyBuilder
pub fn expires_at(self, expires_at: SystemTime) -> ApiKeyBuilder
Sets the expiration time.
Sourcepub fn expires_in(self, duration: Duration) -> ApiKeyBuilder
pub fn expires_in(self, duration: Duration) -> ApiKeyBuilder
Sets expiration relative to now.
Trait Implementations§
Source§impl Clone for ApiKeyBuilder
impl Clone for ApiKeyBuilder
Source§fn clone(&self) -> ApiKeyBuilder
fn clone(&self) -> ApiKeyBuilder
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 moreAuto Trait Implementations§
impl Freeze for ApiKeyBuilder
impl RefUnwindSafe for ApiKeyBuilder
impl Send for ApiKeyBuilder
impl Sync for ApiKeyBuilder
impl Unpin for ApiKeyBuilder
impl UnwindSafe for ApiKeyBuilder
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