pub struct LicenseDataBuilder { /* private fields */ }Expand description
Builder for creating license data
Implementations§
Source§impl LicenseDataBuilder
impl LicenseDataBuilder
Sourcepub fn serial(self, serial: impl Into<String>) -> Self
pub fn serial(self, serial: impl Into<String>) -> Self
Set the serial number for tracking (required).
Sourcepub fn customer_id(self, customer_id: impl Into<String>) -> Self
pub fn customer_id(self, customer_id: impl Into<String>) -> Self
Set the customer or organization identifier (required).
Sourcepub fn product_id(self, product_id: impl Into<String>) -> Self
pub fn product_id(self, product_id: impl Into<String>) -> Self
Set the product identifier (required).
Sourcepub fn valid_from(self, valid_from: DateTime<Utc>) -> Self
pub fn valid_from(self, valid_from: DateTime<Utc>) -> Self
Set the start of the validity window.
Sourcepub fn valid_until(self, valid_until: DateTime<Utc>) -> Self
pub fn valid_until(self, valid_until: DateTime<Utc>) -> Self
Set the end of the validity window.
Sourcepub fn valid_days(self, days: i64) -> Self
pub fn valid_days(self, days: i64) -> Self
Set validity to days from now (sets both valid_from and valid_until).
Sourcepub fn feature(self, feature: impl Into<String>) -> Self
pub fn feature(self, feature: impl Into<String>) -> Self
Add a single feature flag to the license.
Sourcepub fn features(
self,
features: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn features( self, features: impl IntoIterator<Item = impl Into<String>>, ) -> Self
Add multiple feature flags at once.
Sourcepub fn hardware_binding(self, binding: HardwareBinding) -> Self
pub fn hardware_binding(self, binding: HardwareBinding) -> Self
Attach hardware binding restrictions (MAC address, hostname, disk ID, custom).
Sourcepub fn max_seats(self, max_seats: u32) -> Self
pub fn max_seats(self, max_seats: u32) -> Self
Set the maximum number of concurrent seats (0 = unlimited).
Sourcepub fn metadata(self, key: impl Into<String>, value: impl Into<String>) -> Self
pub fn metadata(self, key: impl Into<String>, value: impl Into<String>) -> Self
Add a key-value metadata entry.
Sourcepub fn build(self) -> Result<LicenseData>
pub fn build(self) -> Result<LicenseData>
Build the license data, returning an error if required fields are missing.
Trait Implementations§
Source§impl Default for LicenseDataBuilder
impl Default for LicenseDataBuilder
Source§fn default() -> LicenseDataBuilder
fn default() -> LicenseDataBuilder
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for LicenseDataBuilder
impl RefUnwindSafe for LicenseDataBuilder
impl Send for LicenseDataBuilder
impl Sync for LicenseDataBuilder
impl Unpin for LicenseDataBuilder
impl UnsafeUnpin for LicenseDataBuilder
impl UnwindSafe for LicenseDataBuilder
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