1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
//! # rustify-licensing
//!
//! Framework-agnostic in-app licensing for native Rust desktop apps: validate a key,
//! node-lock the machine, cache the result, and stay unlocked through a bounded
//! **offline grace** window — failing **closed** on an authoritative denial.
//!
//! A framework-agnostic core plus thin adapters, so the same logic drives a Bevy app,
//! a headless CLI, an egui/immediate-mode GUI, or tests.
//!
//! ## Shape
//! - [`core`] — pure, runtime-agnostic: [`LicenseState`] persistence + fingerprint,
//! [`LicenseStatus`], [`CheckErr`] (the load-bearing `Denied` vs `Offline` split),
//! and the [`core::engine`] that folds a check result into a status.
//! - [`provider`] — the [`LicenseProvider`] trait and the [`KeygenProvider`] impl
//! (the exact Keygen validate/activate/node-lock dance). Swap in Polar later.
//! - [`adapters`] — `headless` (a blocking driver) and, behind the `bevy` feature,
//! a [`adapters::bevy`] plugin with resources, systems, and an event API.
//!
//! ## Quick start (headless)
//! ```no_run
//! use rustify_licensing::{KeygenProvider, LicenseConfig, LicenseState, StorageConfig};
//! use rustify_licensing::adapters::headless::check_blocking;
//!
//! let config = LicenseConfig {
//! account_id: "your-keygen-account-uuid".into(),
//! api_base: "https://api.keygen.sh/v1".into(),
//! grace_secs: 14 * 24 * 60 * 60,
//! storage: StorageConfig::app_data("MyApp", "license.env", None, Some("MYAPP_LICENSE_KEY")),
//! buy_url: "https://myapp.example/#pricing".into(),
//! };
//! let provider = KeygenProvider::from_config(&config);
//! let mut state = LicenseState::load(&config.storage);
//! let status = check_blocking(&config, &provider, &mut state, |line| println!("… {line}"));
//! println!("status: {status:?}");
//! ```
pub use crate;
pub use crateCheckErr;
pub use crate;
pub use crateLicenseStatus;
pub use crate;
/// Framework-agnostic threaded driver for immediate-mode GUIs / CLIs.
pub use crateLicenseWorker;
pub use cratebevy;
/// Open a URL in the user's default browser (for a "Buy" button → `config.buy_url`).