pub struct FingerprintProfile {
pub name: String,
pub fingerprint: Fingerprint,
}Expand description
A named, reusable fingerprint identity.
§Example
use stygian_browser::fingerprint::FingerprintProfile;
let profile = FingerprintProfile::new("my-session".to_string());
assert_eq!(profile.name, "my-session");Fields§
§name: StringHuman-readable profile name.
fingerprint: FingerprintThe fingerprint data for this profile.
Implementations§
Source§impl FingerprintProfile
impl FingerprintProfile
Sourcepub fn new(name: String) -> Self
pub fn new(name: String) -> Self
Create a new profile with a freshly randomised fingerprint.
§Example
use stygian_browser::fingerprint::FingerprintProfile;
let p = FingerprintProfile::new("bot-1".to_string());
assert!(!p.fingerprint.user_agent.is_empty());Sourcepub fn random_weighted(name: String) -> Self
pub fn random_weighted(name: String) -> Self
Create a new profile whose fingerprint is weighted by real-world market share.
Device type (Windows/macOS/Linux) is selected via
DeviceProfile::random_weighted, then a fully consistent fingerprint
is generated for that device. The resulting fingerprint is guaranteed
to pass Fingerprint::validate_consistency.
§Example
use stygian_browser::fingerprint::FingerprintProfile;
let profile = FingerprintProfile::random_weighted("session-1".to_string());
assert!(!profile.fingerprint.fonts.is_empty());
assert!(profile.fingerprint.validate_consistency().is_empty());Trait Implementations§
Source§impl Clone for FingerprintProfile
impl Clone for FingerprintProfile
Source§fn clone(&self) -> FingerprintProfile
fn clone(&self) -> FingerprintProfile
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 FingerprintProfile
impl Debug for FingerprintProfile
Source§impl<'de> Deserialize<'de> for FingerprintProfile
impl<'de> Deserialize<'de> for FingerprintProfile
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
Auto Trait Implementations§
impl Freeze for FingerprintProfile
impl RefUnwindSafe for FingerprintProfile
impl Send for FingerprintProfile
impl Sync for FingerprintProfile
impl Unpin for FingerprintProfile
impl UnwindSafe for FingerprintProfile
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