Struct aws_http::user_agent::AwsUserAgent
source · [−]pub struct AwsUserAgent { /* private fields */ }
Expand description
AWS User Agent
Ths struct should be inserted into the PropertyBag
during operation construction. UserAgentStage
reads AwsUserAgent
from the property bag and sets the User-Agent
and x-amz-user-agent
headers.
Implementations
sourceimpl 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_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
sourceimpl Clone for AwsUserAgent
impl Clone for AwsUserAgent
sourcefn clone(&self) -> AwsUserAgent
fn clone(&self) -> AwsUserAgent
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
Auto Trait Implementations
impl RefUnwindSafe for AwsUserAgent
impl Send for AwsUserAgent
impl Sync for AwsUserAgent
impl Unpin for AwsUserAgent
impl UnwindSafe for AwsUserAgent
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcepub fn borrow_mut(&mut self) -> &mut T
pub fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcepub fn to_owned(&self) -> T
pub fn to_owned(&self) -> T
Creates owned data from borrowed data, usually by cloning. Read more
sourcepub fn clone_into(&self, target: &mut T)
pub fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more