pub struct License { /* fields omitted */ }
License
is the primary struct through which to interact
with licensed
.
static PUBLIC_KEY: &'static [u8] = include_bytes!("../examples/public.pks");
let license_file: Vec<u8> = include_bytes!("../examples/license").to_vec();
let license = licensed::License::new(&license_file)
.with_public_key(&PUBLIC_KEY)
.build().unwrap();
if ! license.valid() {
println!("The provided license is invalid");
process::exit(1);
}
Creates a new builder for the license, helping to construct and
validate the license.
let license = licensed::License::new(&license_file)
.with_public_key(&PUBLIC_KEY)
.build()?;
Is this license valid and non-expired?
assert!(license.valid());
Does this license have the specified feature?
assert!(license.has_feature("hello"));
Performs copy-assignment from source
. Read more
Formats the value using the given formatter. Read more
Returns the "default value" for a type. Read more