pub enum BrowserKind {
Chrome,
Edge,
Safari,
Firefox,
}Expand description
Browser kind for user-agent string generation.
Used internally by Fingerprint::from_device_profile to construct
realistic user-agent strings consistent with the selected device.
§Example
use stygian_browser::fingerprint::{BrowserKind, DeviceProfile};
let kind = BrowserKind::for_device(DeviceProfile::MobileIOS, 42);
assert_eq!(kind, BrowserKind::Safari);Variants§
Chrome
Google Chrome — most common desktop browser.
Edge
Microsoft Edge — Chromium-based, Windows-primary.
Safari
Apple Safari — macOS/iOS only.
Firefox
Mozilla Firefox.
Implementations§
Source§impl BrowserKind
impl BrowserKind
Sourcepub const fn for_device(device: DeviceProfile, seed: u64) -> Self
pub const fn for_device(device: DeviceProfile, seed: u64) -> Self
Select a browser weighted by market share for the given device profile.
- iOS always returns
BrowserKind::Safari(WebKitrequired). - macOS: Chrome 56%, Safari 36%, Firefox 8%.
- Android: Chrome 90%, Firefox 10%.
- Windows/Linux: Chrome 65%, Edge 16%, Firefox 19%.
§Example
use stygian_browser::fingerprint::{BrowserKind, DeviceProfile};
let kind = BrowserKind::for_device(DeviceProfile::MobileIOS, 0);
assert_eq!(kind, BrowserKind::Safari);Trait Implementations§
Source§impl Clone for BrowserKind
impl Clone for BrowserKind
Source§fn clone(&self) -> BrowserKind
fn clone(&self) -> BrowserKind
Returns a duplicate 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 moreSource§impl Debug for BrowserKind
impl Debug for BrowserKind
Source§impl Default for BrowserKind
impl Default for BrowserKind
Source§fn default() -> BrowserKind
fn default() -> BrowserKind
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for BrowserKind
impl<'de> Deserialize<'de> for BrowserKind
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for BrowserKind
impl PartialEq for BrowserKind
Source§impl Serialize for BrowserKind
impl Serialize for BrowserKind
impl Copy for BrowserKind
impl Eq for BrowserKind
impl StructuralPartialEq for BrowserKind
Auto Trait Implementations§
impl Freeze for BrowserKind
impl RefUnwindSafe for BrowserKind
impl Send for BrowserKind
impl Sync for BrowserKind
impl Unpin for BrowserKind
impl UnwindSafe for BrowserKind
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.