pub struct SuccessfulAuthentication {
pub client_key: PublicKey,
pub mechanism: Mechanism,
}server only.Expand description
This represents successful authentication for the client with the client_key public key
via the authentication Mechanism mechanism.
You must call SuccessfulAuthentication::authorize_if to finish the protocol.
Result of a successful authentication handshake.
This struct represents a client that has successfully authenticated itself to the relay
server. The authorization must still be confirmed by calling Self::authorize_if to
complete the protocol and notify the client of success or failure.
Fields§
§client_key: PublicKeyThe authenticated client’s public key.
mechanism: MechanismThe authentication mechanism that was used.
Implementations§
Source§impl SuccessfulAuthentication
impl SuccessfulAuthentication
Completes the authorization protocol by notifying the client of success or failure.
After a client has been successfully authenticated via serverside, the server must
decide whether to authorize the client (allow access) or deny it. This method sends
the authorization decision to the client and completes the handshake protocol.
§Arguments
is_authorized- Whether to grant access to the authenticated clientio- The WebSocket stream to send the authorization response on
§Returns
Ok(PublicKey)- The client’s public key if authorization was grantedErr(Error)- If authorization was denied or communication failed
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SuccessfulAuthentication
impl RefUnwindSafe for SuccessfulAuthentication
impl Send for SuccessfulAuthentication
impl Sync for SuccessfulAuthentication
impl Unpin for SuccessfulAuthentication
impl UnwindSafe for SuccessfulAuthentication
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
§impl<T> CompatExt for T
impl<T> CompatExt for T
§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>
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>
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