#[non_exhaustive]pub struct AuthClient<C> {
pub http_client: C,
pub auth_manager: Arc<Mutex<AuthorizationManager>>,
}Available on crate feature
auth and (crate features client or server) only.Expand description
HTTP client with OAuth 2.0 authorization
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.http_client: C§auth_manager: Arc<Mutex<AuthorizationManager>>Implementations§
Source§impl<C> AuthClient<C>
impl<C> AuthClient<C>
Sourcepub fn new(http_client: C, auth_manager: AuthorizationManager) -> Self
pub fn new(http_client: C, auth_manager: AuthorizationManager) -> Self
Create a new authorized HTTP client
Source§impl<C> AuthClient<C>
impl<C> AuthClient<C>
Trait Implementations§
Source§impl<C: Clone> Clone for AuthClient<C>
impl<C: Clone> Clone for AuthClient<C>
Source§fn clone(&self) -> AuthClient<C>
fn clone(&self) -> AuthClient<C>
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl<C: Debug> Debug for AuthClient<C>
impl<C: Debug> Debug for AuthClient<C>
Source§impl<C> StreamableHttpClient for AuthClient<C>
Available on crate feature transport-streamable-http-client only.
impl<C> StreamableHttpClient for AuthClient<C>
Available on crate feature
transport-streamable-http-client only.type Error = <C as StreamableHttpClient>::Error
async fn delete_session( &self, uri: Arc<str>, session_id: Arc<str>, auth_token: Option<String>, custom_headers: HashMap<HeaderName, HeaderValue>, ) -> Result<(), StreamableHttpError<Self::Error>>
Source§async fn get_stream(
&self,
uri: Arc<str>,
session_id: Option<Arc<str>>,
last_event_id: Option<String>,
auth_token: Option<String>,
custom_headers: HashMap<HeaderName, HeaderValue>,
) -> Result<BoxStream<'static, Result<Sse, Error>>, StreamableHttpError<Self::Error>>
async fn get_stream( &self, uri: Arc<str>, session_id: Option<Arc<str>>, last_event_id: Option<String>, auth_token: Option<String>, custom_headers: HashMap<HeaderName, HeaderValue>, ) -> Result<BoxStream<'static, Result<Sse, Error>>, StreamableHttpError<Self::Error>>
Open an SSE stream, optionally scoped to a legacy session. Read more
Source§async fn get_stream_with_max_sse_event_size(
&self,
uri: Arc<str>,
session_id: Option<Arc<str>>,
last_event_id: Option<String>,
auth_token: Option<String>,
custom_headers: HashMap<HeaderName, HeaderValue>,
max_sse_event_size: usize,
) -> Result<BoxStream<'static, Result<Sse, Error>>, StreamableHttpError<Self::Error>>
async fn get_stream_with_max_sse_event_size( &self, uri: Arc<str>, session_id: Option<Arc<str>>, last_event_id: Option<String>, auth_token: Option<String>, custom_headers: HashMap<HeaderName, HeaderValue>, max_sse_event_size: usize, ) -> Result<BoxStream<'static, Result<Sse, Error>>, StreamableHttpError<Self::Error>>
Open an SSE stream while enforcing a maximum raw event size. Read more
async fn post_message( &self, uri: Arc<str>, message: ClientJsonRpcMessage, session_id: Option<Arc<str>>, auth_token: Option<String>, custom_headers: HashMap<HeaderName, HeaderValue>, ) -> Result<StreamableHttpPostResponse, StreamableHttpError<Self::Error>>
Source§async fn post_message_with_max_sse_event_size(
&self,
uri: Arc<str>,
message: ClientJsonRpcMessage,
session_id: Option<Arc<str>>,
auth_token: Option<String>,
custom_headers: HashMap<HeaderName, HeaderValue>,
max_sse_event_size: usize,
) -> Result<StreamableHttpPostResponse, StreamableHttpError<Self::Error>>
async fn post_message_with_max_sse_event_size( &self, uri: Arc<str>, message: ClientJsonRpcMessage, session_id: Option<Arc<str>>, auth_token: Option<String>, custom_headers: HashMap<HeaderName, HeaderValue>, max_sse_event_size: usize, ) -> Result<StreamableHttpPostResponse, StreamableHttpError<Self::Error>>
Send a message while enforcing a maximum raw SSE event size. Read more
Auto Trait Implementations§
impl<C> !RefUnwindSafe for AuthClient<C>
impl<C> !UnwindSafe for AuthClient<C>
impl<C> Freeze for AuthClient<C>where
C: Freeze,
impl<C> Send for AuthClient<C>where
C: Send,
impl<C> Sync for AuthClient<C>where
C: Sync,
impl<C> Unpin for AuthClient<C>where
C: Unpin,
impl<C> UnsafeUnpin for AuthClient<C>where
C: UnsafeUnpin,
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