pub trait LicenseValidator:
Send
+ Sync
+ Debug {
// Required methods
fn validate_domain(&self, domain: Domain) -> LicenseResult<()>;
fn validate_feature(&self, feature: &str) -> LicenseResult<()>;
fn gpu_native_enabled(&self) -> bool;
fn licensed_domains(&self) -> &[Domain];
fn expires_at(&self) -> Option<DateTime<Utc>>;
fn tier(&self) -> LicenseTier;
fn max_kernels(&self) -> Option<usize>;
// Provided method
fn is_valid(&self) -> bool { ... }
}Expand description
License validator trait.
Implement this trait to provide custom license validation logic.
Required Methods§
Sourcefn validate_domain(&self, domain: Domain) -> LicenseResult<()>
fn validate_domain(&self, domain: Domain) -> LicenseResult<()>
Validate access to a domain.
Sourcefn validate_feature(&self, feature: &str) -> LicenseResult<()>
fn validate_feature(&self, feature: &str) -> LicenseResult<()>
Validate access to a specific feature.
Sourcefn gpu_native_enabled(&self) -> bool
fn gpu_native_enabled(&self) -> bool
Check if GPU-native kernels are licensed.
Sourcefn licensed_domains(&self) -> &[Domain]
fn licensed_domains(&self) -> &[Domain]
Get all licensed domains.
Sourcefn expires_at(&self) -> Option<DateTime<Utc>>
fn expires_at(&self) -> Option<DateTime<Utc>>
Get license expiry information.
Sourcefn tier(&self) -> LicenseTier
fn tier(&self) -> LicenseTier
Get the license tier.
Sourcefn max_kernels(&self) -> Option<usize>
fn max_kernels(&self) -> Option<usize>
Get the maximum number of concurrent kernels allowed.