pub struct BearerHttpTransport { /* private fields */ }Expand description
HTTP transport that authenticates requests with a zeroizing bearer token.
Implementations§
Source§impl BearerHttpTransport
impl BearerHttpTransport
Sourcepub fn from_secret(bearer_token: SecretString) -> Self
pub fn from_secret(bearer_token: SecretString) -> Self
Creates a bearer transport without exposing or copying its secret.
Sourcepub fn with_max_response_bytes(self, max_response_bytes: usize) -> Self
pub fn with_max_response_bytes(self, max_response_bytes: usize) -> Self
Sets the maximum accepted response body size in bytes.
Trait Implementations§
Source§impl Clone for BearerHttpTransport
impl Clone for BearerHttpTransport
Source§fn clone(&self) -> BearerHttpTransport
fn clone(&self) -> BearerHttpTransport
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 Debug for BearerHttpTransport
impl Debug for BearerHttpTransport
Source§impl HttpTransport for BearerHttpTransport
impl HttpTransport for BearerHttpTransport
Source§fn send_json(
&self,
base_url: &str,
request: HttpControlPlaneRequest,
) -> ControlPlaneResult<HttpControlPlaneResponse>
fn send_json( &self, base_url: &str, request: HttpControlPlaneRequest, ) -> ControlPlaneResult<HttpControlPlaneResponse>
Sends one JSON request to the configured base URL.
Source§fn send_json_traced(
&self,
base_url: &str,
request: HttpControlPlaneRequest,
trace: Option<&TraceContext>,
) -> ControlPlaneResult<HttpControlPlaneResponse>
fn send_json_traced( &self, base_url: &str, request: HttpControlPlaneRequest, trace: Option<&TraceContext>, ) -> ControlPlaneResult<HttpControlPlaneResponse>
Sends one JSON request and propagates optional trace headers.
Source§fn send_json_traced_cancellable(
&self,
base_url: &str,
request: HttpControlPlaneRequest,
trace: Option<&TraceContext>,
cancellation: &CancellationToken,
) -> ControlPlaneResult<HttpControlPlaneResponse>
fn send_json_traced_cancellable( &self, base_url: &str, request: HttpControlPlaneRequest, trace: Option<&TraceContext>, cancellation: &CancellationToken, ) -> ControlPlaneResult<HttpControlPlaneResponse>
Sends one traced request with cooperative cancellation.
Auto Trait Implementations§
impl Freeze for BearerHttpTransport
impl RefUnwindSafe for BearerHttpTransport
impl Send for BearerHttpTransport
impl Sync for BearerHttpTransport
impl Unpin for BearerHttpTransport
impl UnsafeUnpin for BearerHttpTransport
impl UnwindSafe for BearerHttpTransport
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