Skip to main content

LicenseDataBuilder

Struct LicenseDataBuilder 

Source
pub struct LicenseDataBuilder { /* private fields */ }
Expand description

Builder for creating license data

Implementations§

Source§

impl LicenseDataBuilder

Source

pub fn new() -> Self

Create a new license data builder with default values.

Source

pub fn id(self, id: impl Into<String>) -> Self

Set the unique license identifier (required).

Source

pub fn serial(self, serial: impl Into<String>) -> Self

Set the serial number for tracking (required).

Source

pub fn customer_id(self, customer_id: impl Into<String>) -> Self

Set the customer or organization identifier (required).

Source

pub fn product_id(self, product_id: impl Into<String>) -> Self

Set the product identifier (required).

Source

pub fn version(self, version: u32) -> Self

Set the license schema version (default: 1).

Source

pub fn valid_from(self, valid_from: DateTime<Utc>) -> Self

Set the start of the validity window.

Source

pub fn valid_until(self, valid_until: DateTime<Utc>) -> Self

Set the end of the validity window.

Source

pub fn valid_days(self, days: i64) -> Self

Set validity to days from now (sets both valid_from and valid_until).

Source

pub fn feature(self, feature: impl Into<String>) -> Self

Add a single feature flag to the license.

Source

pub fn features( self, features: impl IntoIterator<Item = impl Into<String>>, ) -> Self

Add multiple feature flags at once.

Source

pub fn hardware_binding(self, binding: HardwareBinding) -> Self

Attach hardware binding restrictions (MAC address, hostname, disk ID, custom).

Source

pub fn max_seats(self, max_seats: u32) -> Self

Set the maximum number of concurrent seats (0 = unlimited).

Source

pub fn metadata(self, key: impl Into<String>, value: impl Into<String>) -> Self

Add a key-value metadata entry.

Source

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

Source§

fn default() -> LicenseDataBuilder

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more