pub struct AwsUserAgent { /* private fields */ }Expand description
AWS User Agent
Ths struct should be inserted into the ConfigBag
during operation construction. The UserAgentInterceptor reads AwsUserAgent
from the config bag and sets the User-Agent and x-amz-user-agent headers.
Implementations§
Source§impl AwsUserAgent
impl AwsUserAgent
Sourcepub fn new_from_environment(env: Env, api_metadata: ApiMetadata) -> Self
pub fn new_from_environment(env: Env, api_metadata: ApiMetadata) -> Self
Load a User Agent configuration from the environment
This utilizes BUILD_METADATA from aws_types
to capture the Rust version & target platform. ApiMetadata provides
the version & name of the specific service.
Sourcepub fn for_tests() -> Self
pub fn for_tests() -> Self
For test purposes, construct an environment-independent User Agent
Without this, running CI on a different platform would produce different user agent strings
Sourcepub fn with_additional_metadata(self, metadata: AdditionalMetadata) -> Self
pub fn with_additional_metadata(self, metadata: AdditionalMetadata) -> Self
Adds additional metadata to the user agent.
Sourcepub fn add_additional_metadata(
&mut self,
metadata: AdditionalMetadata,
) -> &mut Self
pub fn add_additional_metadata( &mut self, metadata: AdditionalMetadata, ) -> &mut Self
Adds additional metadata to the user agent.
Sourcepub fn with_app_name(self, app_name: AppName) -> Self
pub fn with_app_name(self, app_name: AppName) -> Self
Sets the app name for the user agent.
Sourcepub fn set_app_name(&mut self, app_name: AppName) -> &mut Self
pub fn set_app_name(&mut self, app_name: AppName) -> &mut Self
Sets the app name for the user agent.
Sourcepub fn aws_ua_header(&self) -> String
pub fn aws_ua_header(&self) -> String
Generate a new-style user agent style header
This header should be set at x-amz-user-agent
Trait Implementations§
Source§impl Clone for AwsUserAgent
impl Clone for AwsUserAgent
Source§fn clone(&self) -> AwsUserAgent
fn clone(&self) -> AwsUserAgent
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for AwsUserAgent
impl Debug for AwsUserAgent
Source§impl Storable for AwsUserAgent
impl Storable for AwsUserAgent
Source§type Storer = StoreReplace<AwsUserAgent>
type Storer = StoreReplace<AwsUserAgent>
StoreReplace and StoreAppendAuto Trait Implementations§
impl Freeze for AwsUserAgent
impl RefUnwindSafe for AwsUserAgent
impl Send for AwsUserAgent
impl Sync for AwsUserAgent
impl Unpin for AwsUserAgent
impl UnwindSafe for AwsUserAgent
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§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