pub struct LicenseVerifier { /* private fields */ }Expand description
Main license verifier
Implementations§
Source§impl LicenseVerifier
impl LicenseVerifier
Sourcepub fn new_offline() -> Self
pub fn new_offline() -> Self
Create verifier in offline mode (uses only cached licenses)
Sourcepub fn load_cache<P: AsRef<Path>>(
&mut self,
path: P,
) -> Result<(), Box<dyn Error>>
pub fn load_cache<P: AsRef<Path>>( &mut self, path: P, ) -> Result<(), Box<dyn Error>>
Load license cache from file
Sourcepub fn save_cache<P: AsRef<Path>>(&self, path: P) -> Result<(), Box<dyn Error>>
pub fn save_cache<P: AsRef<Path>>(&self, path: P) -> Result<(), Box<dyn Error>>
Save license cache to file
Sourcepub async fn verify_license(
&mut self,
key: &str,
) -> Result<LicenseStatus, LicenseError>
pub async fn verify_license( &mut self, key: &str, ) -> Result<LicenseStatus, LicenseError>
Verify a license key
Sourcepub fn add_license(&mut self, license: LicenseKey)
pub fn add_license(&mut self, license: LicenseKey)
Add a license to the cache (for testing or manual activation)
Sourcepub async fn check_feature_license(
&mut self,
key: &str,
feature: &str,
) -> Result<(), LicenseError>
pub async fn check_feature_license( &mut self, key: &str, feature: &str, ) -> Result<(), LicenseError>
Check if feature is licensed for given key
Auto Trait Implementations§
impl Freeze for LicenseVerifier
impl RefUnwindSafe for LicenseVerifier
impl Send for LicenseVerifier
impl Sync for LicenseVerifier
impl Unpin for LicenseVerifier
impl UnwindSafe for LicenseVerifier
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more