Skip to main content

Builder

Struct Builder 

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

Configures and builds the plugin.

Implementations§

Source§

impl Builder

Source

pub fn new( endpoint: impl Into<String>, product_id: impl Into<String>, public_key: impl Into<String>, ) -> Self

Your store (https://<tenant>.moonbase.sh), the product id, and the product’s public key (PEM or base64 DER), all from the Moonbase dashboard.

Source

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

Pin the token issuer to your Moonbase account id.

Source

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

The version reported to Moonbase and compared with the latest release, and the version a license that covers only some versions has to cover. Defaults to the app’s own version from tauri.conf.json.

Source

pub fn enforce_release_access(self, enforce: bool) -> Self

Whether a license that doesn’t cover the app’s version is refused on this device too, when Moonbase isn’t asked (an offline license, or within the check interval). Moonbase refuses one when validating online either way. On by default.

Source

pub fn auto_activate_sub_products(self, auto_activate: bool) -> Self

Whether activating and validating also takes a seat of each add-on (a sub-product the merchant includes in this product’s license) that the customer owns, so the license reports it. On by default. Turn it off to take seats yourself with Moonbase::activate_sub_product; the add-ons screen then offers “Activate” for each one owned.

Source

pub fn license_file(self, path: impl Into<PathBuf>) -> Self

Where the license is kept. Defaults to license.mb in the app’s data directory.

Source

pub fn grace_period(self, grace: Duration) -> Self

How long an online-activated license keeps working without a successful online check. Default 7 days.

Source

pub fn check_interval(self, interval: Duration) -> Self

The least time between online checks of the license. Default 5 minutes.

Source

pub fn http_timeouts(self, connect: Duration, request: Duration) -> Self

Source

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

An extra User-Agent segment for a layer built on top of this plugin, such as "MyFramework/2.0". Appended after the plugin’s own.

Source

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

Sent as meta[<key>] with license requests.

Source

pub fn device_id_resolver( self, resolver: impl DeviceIdResolver + 'static, ) -> Self

Override how this machine is identified. Defaults to the cross-SDK MoonbaseDeviceIdResolver, so a license activated through any Moonbase SDK on this machine validates here too. Pass the resolver itself, or an Arc of one.

Source

pub fn transport(self, transport: impl HttpTransport + 'static) -> Self

Send requests through your own HttpTransport, e.g. one that shares the app’s proxy settings. Defaults to the SDK’s bundled transport. Pass the transport itself, or an Arc of one.

Source

pub fn allow_device_name_fallback(self, allow: bool) -> Self

Accept a deliberately weaker device id (a hash of the host name, stamped mbd2n_) on machines with no readable hardware identity, instead of refusing to activate. Ignored with a custom resolver.

Source

pub fn open_browser(self, open: bool) -> Self

Whether activate opens the browser itself. On by default; turn it off to open PendingActivation::browser_url yourself.

Source

pub fn ui(self, ui: UiConfig) -> Self

Brand and tune the built-in activation window, or turn it off with UiConfig::disabled to drive your own UI from the state event.

Source

pub fn build<R: Runtime>(self) -> TauriPlugin<R>

Trait Implementations§

Source§

impl Debug for Builder

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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<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