LicenseValidator

Trait LicenseValidator 

Source
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§

Source

fn validate_domain(&self, domain: Domain) -> LicenseResult<()>

Validate access to a domain.

Source

fn validate_feature(&self, feature: &str) -> LicenseResult<()>

Validate access to a specific feature.

Source

fn gpu_native_enabled(&self) -> bool

Check if GPU-native kernels are licensed.

Source

fn licensed_domains(&self) -> &[Domain]

Get all licensed domains.

Source

fn expires_at(&self) -> Option<DateTime<Utc>>

Get license expiry information.

Source

fn tier(&self) -> LicenseTier

Get the license tier.

Source

fn max_kernels(&self) -> Option<usize>

Get the maximum number of concurrent kernels allowed.

Provided Methods§

Source

fn is_valid(&self) -> bool

Check if the license is currently valid.

Implementors§