pub struct UserAgent(_);Expand description
User-Agent header, defined in
RFC7231
The User-Agent header field contains information about the user
agent originating the request, which is often used by servers to help
identify the scope of reported interoperability problems, to work
around or tailor responses to avoid particular user agent
limitations, and for analytics regarding browser or operating system
use. A user agent SHOULD send a User-Agent field in each request
unless specifically configured not to do so.
ABNF
User-Agent = product *( RWS ( product / comment ) )
product = token ["/" product-version]
product-version = tokenExample values
CERN-LineMode/2.15 libwww/2.17b3Bunnies
Notes
- The parser does not split the value
Example
use headers::UserAgent;
let ua = UserAgent::from_static("hyper/0.12.2");Implementations
Trait Implementations
sourceimpl Header for UserAgent
impl Header for UserAgent
sourcefn name() -> &'static HeaderName
fn name() -> &'static HeaderName
The name of this header.
sourceimpl Ord for UserAgent
impl Ord for UserAgent
sourceimpl PartialOrd<UserAgent> for UserAgent
impl PartialOrd<UserAgent> for UserAgent
sourcefn partial_cmp(&self, other: &UserAgent) -> Option<Ordering>
fn partial_cmp(&self, other: &UserAgent) -> Option<Ordering>
This method returns an ordering between self and other values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for self and other) and is used by the <=
operator. Read more
impl Eq for UserAgent
impl StructuralEq for UserAgent
impl StructuralPartialEq for UserAgent
Auto Trait Implementations
impl RefUnwindSafe for UserAgent
impl Send for UserAgent
impl Sync for UserAgent
impl Unpin for UserAgent
impl UnwindSafe for UserAgent
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
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.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into)Uses borrowed data to replace owned data, usually by cloning. Read more