Skip to main content

EnterResp

Enum EnterResp 

Source
pub enum EnterResp {
    AccountDoesNotExist,
    AttributeBanned(Attr),
    Banned,
    AttributeAlreadyTaken {
        attr: Attr,
        bans_other_user: bool,
    },
    NoBannableAttribute,
    RetryWithNewIdentifyingAttr,
    RetryWithNewAuthToken,
    RetryWithNewAddAttr {
        index: usize,
    },
    Entered {
        new_account: bool,
        auth_token_package: Result<AuthTokenPackage, AuthTokenDeniedReason>,
        attr_status: Vec<(Attr, AttrAddStatus)>,
    },
}
Expand description

Returned by EnterEP.

Variants§

§

AccountDoesNotExist

Happens only in EnterMode::Login

§

AttributeBanned(Attr)

This attribute is banned and therefore cannot be used.

§

Banned

Cannot login, because this account is banned.

§

AttributeAlreadyTaken

The given identifying attribute (in EnterReq::add_attrs or EnterReq::identifying_attr) is already tied to another account.

If EnterReq::register_only_with_unique_attrs is set, this variant will also be returned if a registration is attempted, but one of the supplied attributes already bans another user.

May occasionally happen under the EnterMode::LoginOrRegister mode if the account was created by some parallel invocation of EnterEP at about the same time.

Fields

§attr: Attr
§bans_other_user: bool

Set if this attribute was taken in the sense that it already bans another user.

§

NoBannableAttribute

Cannot register an account with these attributes: no bannable attribute provided.

§

RetryWithNewIdentifyingAttr

Signature on identifying attribute is invalid or expired; please reobtain the identifying attribute and retry. If this fails even with a fresh attribute something is wrong with the server.

§

RetryWithNewAuthToken

An authtoken was passed via the Authorization header that is expired or otherwise invalid.
Obtain a new one and retry.

§

RetryWithNewAddAttr

Signature on EnterReq::add_attrs attribute is invalid or expired; please reobtain the attribute and retry. If this fails even with a fresh attribute something is wrong with the server.

Fields

§index: usize

add_attrs[index] is the offending attribute

§

Entered

The given identifying attribute (now) grants access to a pubhubs account.

Fields

§new_account: bool

Whether we created a new account

§auth_token_package: Result<AuthTokenPackage, AuthTokenDeniedReason>

An access token identifying the user towards pubhubs central.

May not be provided, for example, when the user is banned, or if no bannable attribute is currently associated to the user’s account.

§attr_status: Vec<(Attr, AttrAddStatus)>

Trait Implementations§

Source§

impl Clone for EnterResp

Source§

fn clone(&self) -> EnterResp

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for EnterResp

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for EnterResp

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for EnterResp

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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

impl<T> PayloadTrait for T

Source§

type JsonType = T

Source§

fn to_payload(&self) -> Payload<&T>

Used when creating requests
Source§

fn into_payload(self) -> Payload<T>

Used when forming responses
Source§

fn from_payload(payload: Payload<T>) -> Result<T, Error>

Source§

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

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.
§

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

§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,