pub struct LicenseGenerator { /* private fields */ }Expand description
License key generator that creates time-based license keys
Implementations§
Source§impl LicenseGenerator
impl LicenseGenerator
Sourcepub fn generate_key(&self, hours: u64) -> Result<String>
pub fn generate_key(&self, hours: u64) -> Result<String>
Generate a license key valid for the specified number of hours
§Arguments
hours- Number of hours the license should be valid
§Returns
A license key string starting with “alvan-”
§Example
use alvan_lic::LicenseGenerator;
let generator = LicenseGenerator::new("secret");
let license = generator.generate_key(24).unwrap(); // Valid for 24 hoursAuto Trait Implementations§
impl Freeze for LicenseGenerator
impl RefUnwindSafe for LicenseGenerator
impl Send for LicenseGenerator
impl Sync for LicenseGenerator
impl Unpin for LicenseGenerator
impl UnsafeUnpin for LicenseGenerator
impl UnwindSafe for LicenseGenerator
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