pub struct Vacant;
Expand description

Marker struct if some primitive is not provided.

Used in place of other primitives when those are not provided. The exact semantics depend on the primitive.

Registrar, Authorizer, Issuer

Statically ensures to the Generic endpoint that no such primitive has been provided. Using the endpoint for flows that need such primitives will fail during the preparation phase. This returns Option::None in the implementations for OptRef<T>, OptRegistrar, OptAuthorizer, OptIssuer.

OwnerSolicitor

A solicitor denying all requests. This is the ‘safe’ default solicitor, remember to configure your own solicitor when you actually need to use it.

In contrast to the other primitives, this can not be solved as something such as OptSolicitor<W> since there is no current stable way to deny other crates from implementing OptSolicitor<WR> for some WR from that other crate. Thus, the compiler must assume that None may in fact implement some solicitor and this makes it impossible to implement as an optional reference trait for all solicitors in one way but in a different way for the None solicitor.

Scopes

Returns an empty list of scopes, effictively denying all requests since at least one scope needs to be fulfilled by token to gain access.

See OwnerSolicitor for discussion on why this differs from the other primitives.

Trait Implementations§

source§

impl OptAuthorizer for Vacant

source§

fn opt_mut(&mut self) -> Option<&mut dyn Authorizer>

Reference this mutably as an Authorizer or Option::None.
source§

impl OptIssuer for Vacant

source§

fn opt_mut(&mut self) -> Option<&mut dyn Issuer>

Reference this mutably as an Issuer or Option::None.
source§

impl OptRegistrar for Vacant

source§

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

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

impl<W: WebRequest> OwnerSolicitor<W> for Vacant

Ensure that a user (resource owner) is currently authenticated (for example via a session cookie) and determine if he has agreed to the presented grants.
source§

impl<W: WebRequest> ResponseCreator<W> for Vacantwhere W::Response: Default,

source§

fn create(&mut self, _: &mut W, _: Template<'_>) -> W::Response

Will only be called at most once per flow execution.
source§

impl<W: WebRequest> Scopes<W> for Vacant

source§

fn scopes(&mut self, _: &mut W) -> &[Scope]

A list of alternative scopes. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

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

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere 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 Twhere 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> Same<T> for T

§

type Output = T

Should always be Self
source§

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

§

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 Twhere U: TryFrom<T>,

§

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.
§

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

§

fn vzip(self) -> V