pub struct EndpointAuthScheme { /* private fields */ }Expand description
An authentication scheme configuration for an endpoint.
This is a lightweight alternative to storing auth schemes as
Document::Object(HashMap<String, Document>) in endpoint properties.
Properties are stored in a flat Vec and looked up via linear scan,
which is faster than HashMap for the typical 3-4 entries.
Implementations§
Source§impl EndpointAuthScheme
impl EndpointAuthScheme
Sourcepub fn with_capacity(
name: impl Into<Cow<'static, str>>,
capacity: usize,
) -> Self
pub fn with_capacity( name: impl Into<Cow<'static, str>>, capacity: usize, ) -> Self
Creates a new EndpointAuthScheme with pre-allocated capacity for properties.
Sourcepub fn put(
self,
key: impl Into<Cow<'static, str>>,
value: impl Into<Document>,
) -> Self
pub fn put( self, key: impl Into<Cow<'static, str>>, value: impl Into<Document>, ) -> Self
Adds a property to this auth scheme. Chainable.
Sourcepub fn as_document(&self) -> Document
pub fn as_document(&self) -> Document
Converts this auth scheme into a Document for backward compatibility.
Trait Implementations§
Source§impl Clone for EndpointAuthScheme
impl Clone for EndpointAuthScheme
Source§fn clone(&self) -> EndpointAuthScheme
fn clone(&self) -> EndpointAuthScheme
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 EndpointAuthScheme
impl Debug for EndpointAuthScheme
Source§impl PartialEq for EndpointAuthScheme
impl PartialEq for EndpointAuthScheme
impl StructuralPartialEq for EndpointAuthScheme
Auto Trait Implementations§
impl Freeze for EndpointAuthScheme
impl RefUnwindSafe for EndpointAuthScheme
impl Send for EndpointAuthScheme
impl Sync for EndpointAuthScheme
impl Unpin for EndpointAuthScheme
impl UnwindSafe for EndpointAuthScheme
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,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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