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§
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_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
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more