pub struct UserAgent { /* private fields */ }Expand description
The user_agent fields normally come from a browser request.
They often show up in web service logs coming from the parsed user agent string.
Implementations§
Source§impl UserAgent
impl UserAgent
Sourcepub fn get_original(&self) -> Option<&String>
pub fn get_original(&self) -> Option<&String>
Unparsed user_agent string.
Sourcepub fn set_original(&mut self, original_arg: String)
pub fn set_original(&mut self, original_arg: String)
Unparsed user_agent string.
§Example
Mozilla/5.0 (iPhone; CPU iPhone OS 12_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0 Mobile/15E148 Safari/604.1
Sourcepub fn get_version(&self) -> Option<&String>
pub fn get_version(&self) -> Option<&String>
Version of the user agent.
Sourcepub fn set_version(&mut self, version_arg: String)
pub fn set_version(&mut self, version_arg: String)
Sourcepub fn get_device_name(&self) -> Option<&String>
pub fn get_device_name(&self) -> Option<&String>
Name of the device.
Sourcepub fn set_device_name(&mut self, device_name_arg: String)
pub fn set_device_name(&mut self, device_name_arg: String)
Trait Implementations§
Auto Trait Implementations§
impl Freeze for UserAgent
impl RefUnwindSafe for UserAgent
impl Send for UserAgent
impl Sync for UserAgent
impl Unpin for UserAgent
impl UnwindSafe for UserAgent
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