pub struct CredentialSession<S, T>where
S: AtpSessionStore + Send + Sync,
T: XrpcClient + Send + Sync,
S::Error: Error + Send + Sync + 'static,{ /* private fields */ }
Available on crate feature
agent
only.Implementations§
Source§impl<S, T> CredentialSession<S, T>where
S: AtpSessionStore + Send + Sync,
T: XrpcClient + Send + Sync,
S::Error: Error + Send + Sync + 'static,
impl<S, T> CredentialSession<S, T>where
S: AtpSessionStore + Send + Sync,
T: XrpcClient + Send + Sync,
S::Error: Error + Send + Sync + 'static,
pub fn new(xrpc: T, store: S) -> Self
Sourcepub async fn login(
&self,
identifier: impl AsRef<str>,
password: impl AsRef<str>,
) -> Result<AtpSession, Error<Error>>
pub async fn login( &self, identifier: impl AsRef<str>, password: impl AsRef<str>, ) -> Result<AtpSession, Error<Error>>
Start a new session with this agent.
Sourcepub async fn resume_session(
&self,
session: AtpSession,
) -> Result<(), Error<Error>>
pub async fn resume_session( &self, session: AtpSession, ) -> Result<(), Error<Error>>
Resume a pre-existing session with this agent.
Sourcepub async fn get_session(&self) -> Option<AtpSession>
pub async fn get_session(&self) -> Option<AtpSession>
Get the current session.
Sourcepub async fn get_endpoint(&self) -> String
pub async fn get_endpoint(&self) -> String
Get the current endpoint.
Sourcepub async fn get_labelers_header(&self) -> Option<Vec<String>>
pub async fn get_labelers_header(&self) -> Option<Vec<String>>
Get the current labelers header.
Sourcepub async fn get_proxy_header(&self) -> Option<String>
pub async fn get_proxy_header(&self) -> Option<String>
Get the current proxy header.
Trait Implementations§
Source§impl<S, T> CloneWithProxy for CredentialSession<S, T>where
S: AtpSessionStore + Send + Sync,
S::Error: Error + Send + Sync + 'static,
T: XrpcClient + Send + Sync,
impl<S, T> CloneWithProxy for CredentialSession<S, T>where
S: AtpSessionStore + Send + Sync,
S::Error: Error + Send + Sync + 'static,
T: XrpcClient + Send + Sync,
Source§impl<S, T> Configure for CredentialSession<S, T>where
S: AtpSessionStore + Send + Sync,
T: XrpcClient + Send + Sync,
S::Error: Error + Send + Sync + 'static,
impl<S, T> Configure for CredentialSession<S, T>where
S: AtpSessionStore + Send + Sync,
T: XrpcClient + Send + Sync,
S::Error: Error + Send + Sync + 'static,
Source§impl<S, T> HttpClient for CredentialSession<S, T>where
S: AtpSessionStore + Send + Sync,
T: XrpcClient + Send + Sync,
S::Error: Error + Send + Sync + 'static,
impl<S, T> HttpClient for CredentialSession<S, T>where
S: AtpSessionStore + Send + Sync,
T: XrpcClient + Send + Sync,
S::Error: Error + Send + Sync + 'static,
Source§impl<S, T> SessionManager for CredentialSession<S, T>where
S: AtpSessionStore + Send + Sync,
T: XrpcClient + Send + Sync,
S::Error: Error + Send + Sync + 'static,
impl<S, T> SessionManager for CredentialSession<S, T>where
S: AtpSessionStore + Send + Sync,
T: XrpcClient + Send + Sync,
S::Error: Error + Send + Sync + 'static,
Source§impl<S, T> XrpcClient for CredentialSession<S, T>where
S: AtpSessionStore + Send + Sync,
T: XrpcClient + Send + Sync,
S::Error: Error + Send + Sync + 'static,
impl<S, T> XrpcClient for CredentialSession<S, T>where
S: AtpSessionStore + Send + Sync,
T: XrpcClient + Send + Sync,
S::Error: Error + Send + Sync + 'static,
Source§async fn send_xrpc<P, I, O, E>(
&self,
request: &XrpcRequest<P, I>,
) -> Result<OutputDataOrBytes<O>, Error<E>>
async fn send_xrpc<P, I, O, E>( &self, request: &XrpcRequest<P, I>, ) -> Result<OutputDataOrBytes<O>, Error<E>>
Send an XRPC request and return the response.
Get the authorization token to use
Authorization
header.Auto Trait Implementations§
impl<S, T> Freeze for CredentialSession<S, T>
impl<S, T> !RefUnwindSafe for CredentialSession<S, T>
impl<S, T> Send for CredentialSession<S, T>
impl<S, T> Sync for CredentialSession<S, T>
impl<S, T> Unpin for CredentialSession<S, T>
impl<S, T> !UnwindSafe for CredentialSession<S, T>
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