pub struct DeviceFingerprint {Show 14 fields
pub user_agent: String,
pub platform: DevicePlatform,
pub browser: BrowserType,
pub screen_resolution: Option<String>,
pub timezone_offset: Option<i32>,
pub language: Option<String>,
pub hardware_concurrency: Option<u32>,
pub webgl_vendor: Option<String>,
pub webgl_renderer: Option<String>,
pub canvas_hash: Option<String>,
pub fonts_hash: Option<String>,
pub plugins: Vec<String>,
pub touch_support: bool,
pub color_depth: Option<u8>,
}Expand description
Device fingerprint for identification
Fields§
§user_agent: StringUser agent string
platform: DevicePlatformDevice platform/OS
browser: BrowserTypeBrowser type
screen_resolution: Option<String>Screen resolution (e.g., “1920x1080”)
timezone_offset: Option<i32>Timezone offset in minutes
language: Option<String>Browser language
hardware_concurrency: Option<u32>Hardware concurrency (CPU cores)
webgl_vendor: Option<String>WebGL vendor
webgl_renderer: Option<String>WebGL renderer
canvas_hash: Option<String>Canvas fingerprint hash
fonts_hash: Option<String>Installed fonts hash
plugins: Vec<String>Browser plugins
touch_support: boolTouch support
color_depth: Option<u8>Color depth
Implementations§
Source§impl DeviceFingerprint
impl DeviceFingerprint
Sourcepub fn generate_device_id(&self) -> String
pub fn generate_device_id(&self) -> String
Generate a unique device ID from fingerprint
Sourcepub fn similarity(&self, other: &DeviceFingerprint) -> f64
pub fn similarity(&self, other: &DeviceFingerprint) -> f64
Calculate similarity score with another fingerprint (0.0 to 1.0)
Trait Implementations§
Source§impl Clone for DeviceFingerprint
impl Clone for DeviceFingerprint
Source§fn clone(&self) -> DeviceFingerprint
fn clone(&self) -> DeviceFingerprint
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 DeviceFingerprint
impl Debug for DeviceFingerprint
Source§impl<'de> Deserialize<'de> for DeviceFingerprint
impl<'de> Deserialize<'de> for DeviceFingerprint
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 DeviceFingerprint
impl PartialEq for DeviceFingerprint
Source§fn eq(&self, other: &DeviceFingerprint) -> bool
fn eq(&self, other: &DeviceFingerprint) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for DeviceFingerprint
impl Serialize for DeviceFingerprint
impl StructuralPartialEq for DeviceFingerprint
Auto Trait Implementations§
impl Freeze for DeviceFingerprint
impl RefUnwindSafe for DeviceFingerprint
impl Send for DeviceFingerprint
impl Sync for DeviceFingerprint
impl Unpin for DeviceFingerprint
impl UnsafeUnpin for DeviceFingerprint
impl UnwindSafe for DeviceFingerprint
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