pub struct LicenseData {
pub id: String,
pub serial: String,
pub customer_id: String,
pub product_id: String,
pub version: u32,
pub valid_from: DateTime<Utc>,
pub valid_until: DateTime<Utc>,
pub features: Vec<String>,
pub hardware_binding: HardwareBinding,
pub max_seats: u32,
pub metadata: HashMap<String, String>,
pub issued_at: DateTime<Utc>,
}Expand description
The core license data structure
Fields§
§id: StringUnique license identifier
serial: StringSerial number for tracking
customer_id: StringCustomer/organization identifier
product_id: StringProduct identifier
version: u32License version
valid_from: DateTime<Utc>When the license becomes valid
valid_until: DateTime<Utc>When the license expires
features: Vec<String>List of enabled features
hardware_binding: HardwareBindingHardware binding restrictions
max_seats: u32Maximum number of seats/users (0 = unlimited)
metadata: HashMap<String, String>Additional metadata
issued_at: DateTime<Utc>License issue timestamp
Implementations§
Source§impl LicenseData
impl LicenseData
Sourcepub fn builder() -> LicenseDataBuilder
pub fn builder() -> LicenseDataBuilder
Create a new license data builder
Sourcepub fn has_feature(&self, feature: &str) -> bool
pub fn has_feature(&self, feature: &str) -> bool
Check if a feature is enabled
Sourcepub fn days_remaining(&self) -> i64
pub fn days_remaining(&self) -> i64
Get remaining days until expiration
Sourcepub fn is_time_valid(&self) -> bool
pub fn is_time_valid(&self) -> bool
Check if the license is currently in its valid time window
Trait Implementations§
Source§impl Clone for LicenseData
impl Clone for LicenseData
Source§fn clone(&self) -> LicenseData
fn clone(&self) -> LicenseData
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 LicenseData
impl Debug for LicenseData
Source§impl<'de> Deserialize<'de> for LicenseData
impl<'de> Deserialize<'de> for LicenseData
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 LicenseData
impl RefUnwindSafe for LicenseData
impl Send for LicenseData
impl Sync for LicenseData
impl Unpin for LicenseData
impl UnsafeUnpin for LicenseData
impl UnwindSafe for LicenseData
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