pub struct HardwareInfo {
pub mac_addresses: Vec<String>,
pub disk_ids: Vec<String>,
pub hostname: String,
}Expand description
Current hardware information
Contains the actual hardware identifiers detected on the current system. Used for comparing against license hardware binding requirements.
§Example
use licverify::HardwareInfo;
let hw_info = HardwareInfo::get()?;
println!("MAC Addresses: {:?}", hw_info.mac_addresses);
println!("Disk IDs: {:?}", hw_info.disk_ids);
println!("Hostname: {}", hw_info.hostname);Fields§
§mac_addresses: Vec<String>§disk_ids: Vec<String>§hostname: StringImplementations§
Source§impl HardwareInfo
impl HardwareInfo
Sourcepub fn get() -> LicenseResult<Self>
pub fn get() -> LicenseResult<Self>
Get hardware information for the current system
Automatically detects MAC addresses, disk IDs, and hostname for the current platform. Uses platform-specific methods for accurate hardware detection.
§Returns
Returns HardwareInfo with detected hardware identifiers
§Example
use licverify::HardwareInfo;
let hw_info = HardwareInfo::get()?;Sourcepub fn matches_binding(&self, binding: &HardwareBinding) -> LicenseResult<()>
pub fn matches_binding(&self, binding: &HardwareBinding) -> LicenseResult<()>
Check if this hardware matches the given binding requirements
Verifies that the current hardware satisfies the license’s hardware binding. At least one identifier must match for each non-empty binding category.
§Arguments
binding- The hardware binding requirements from the license
§Returns
Returns Ok(()) if hardware matches, LicenseError::HardwareBinding if not
§Example
use licverify::{HardwareInfo, HardwareBinding};
let hw_info = HardwareInfo::get()?;
let binding = HardwareBinding::default(); // No binding requirements
hw_info.matches_binding(&binding)?; // Should always passTrait Implementations§
Source§impl Clone for HardwareInfo
impl Clone for HardwareInfo
Source§fn clone(&self) -> HardwareInfo
fn clone(&self) -> HardwareInfo
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 moreAuto Trait Implementations§
impl Freeze for HardwareInfo
impl RefUnwindSafe for HardwareInfo
impl Send for HardwareInfo
impl Sync for HardwareInfo
impl Unpin for HardwareInfo
impl UnwindSafe for HardwareInfo
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