ClientMap

Struct ClientMap 

Source
pub struct ClientMap { /* private fields */ }
Expand description

A very simple, in-memory hash map of client ids to Client entries.

Implementations§

Source§

impl ClientMap

Source

pub fn new() -> ClientMap

Create an empty map without any clients in it.

Source

pub fn register_client(&mut self, client: Client)

Insert or update the client record.

Source

pub fn set_password_policy<P: PasswordPolicy + 'static>( &mut self, new_policy: P, )

Change how passwords are encoded while stored.

Trait Implementations§

Source§

impl Default for ClientMap

Source§

fn default() -> ClientMap

Returns the “default value” for a type. Read more
Source§

impl Extend<Client> for ClientMap

Source§

fn extend<I>(&mut self, iter: I)
where I: IntoIterator<Item = Client>,

Extends a collection with the contents of an iterator. Read more
Source§

fn extend_one(&mut self, item: A)

🔬This is a nightly-only experimental API. (extend_one)
Extends a collection with exactly one element.
Source§

fn extend_reserve(&mut self, additional: usize)

🔬This is a nightly-only experimental API. (extend_one)
Reserves capacity in a collection for the given number of additional elements. Read more
Source§

impl FromIterator<Client> for ClientMap

Source§

fn from_iter<I>(iter: I) -> Self
where I: IntoIterator<Item = Client>,

Creates a value from an iterator. Read more
Source§

impl Registrar for ClientMap

Source§

fn negotiate( &self, bound: BoundClient<'_>, _scope: Option<Scope>, ) -> Result<PreGrant, RegistrarError>

Always overrides the scope with a default scope.

Source§

fn bound_redirect<'a>( &self, bound: ClientUrl<'a>, ) -> Result<BoundClient<'a>, RegistrarError>

Determine the allowed scope and redirection url for the client. The registrar may override the scope entirely or simply substitute a default scope in case none is given. Redirection urls should be matched verbatim, not partially.
Source§

fn check( &self, client_id: &str, passphrase: Option<&[u8]>, ) -> Result<(), RegistrarError>

Try to login as client with some authentication.

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> OptRegistrar for T
where T: Registrar,

Source§

fn opt_ref(&self) -> Option<&dyn Registrar>

Reference this as a Registrar or Option::None.
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V