pub struct ValidationContext {
pub current_time: Option<DateTime<Utc>>,
pub current_hostname: Option<String>,
pub current_machine_id: Option<String>,
pub current_software_version: Option<Version>,
pub current_connection_count: Option<u32>,
pub requested_features: Vec<String>,
pub custom_values: HashMap<String, Value>,
}Expand description
Context information provided during license validation.
This structure contains all the runtime information needed to validate a license against the current execution environment.
Fields§
§current_time: Option<DateTime<Utc>>The current date and time to check against temporal constraints.
If None, uses the system’s current time.
current_hostname: Option<String>The current hostname to check against hostname constraints.
current_machine_id: Option<String>The current machine identifier to check against machine ID constraints.
current_software_version: Option<Version>The current software version to check against version constraints.
current_connection_count: Option<u32>The current number of connections to check against connection limits.
requested_features: Vec<String>Features being requested for this validation. Each feature will be checked against the license constraints.
custom_values: HashMap<String, Value>Custom values to check against custom constraints.
Implementations§
Source§impl ValidationContext
impl ValidationContext
Sourcepub fn with_hostname(self, hostname: impl Into<String>) -> Self
pub fn with_hostname(self, hostname: impl Into<String>) -> Self
Sets the current hostname for validation.
Sourcepub fn with_machine_id(self, machine_id: impl Into<String>) -> Self
pub fn with_machine_id(self, machine_id: impl Into<String>) -> Self
Sets the current machine identifier for validation.
Sourcepub fn with_software_version(self, version: Version) -> Self
pub fn with_software_version(self, version: Version) -> Self
Sets the current software version for validation.
Sourcepub fn with_connection_count(self, count: u32) -> Self
pub fn with_connection_count(self, count: u32) -> Self
Sets the current connection count for validation.
Sourcepub fn with_feature(self, feature: impl Into<String>) -> Self
pub fn with_feature(self, feature: impl Into<String>) -> Self
Adds a requested feature to check against the license.
Sourcepub fn with_features(
self,
features: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn with_features( self, features: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Adds multiple requested features to check against the license.
Sourcepub fn with_custom_value(self, key: impl Into<String>, value: Value) -> Self
pub fn with_custom_value(self, key: impl Into<String>, value: Value) -> Self
Adds a custom value for constraint checking.
Trait Implementations§
Source§impl Clone for ValidationContext
impl Clone for ValidationContext
Source§fn clone(&self) -> ValidationContext
fn clone(&self) -> ValidationContext
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more