Skip to main content

lycento_sdk/
lib.rs

1//! # Lycento SDK for Rust
2//!
3//! A comprehensive Rust SDK for the Lycento licensing platform, designed for
4//! integration with Tauri desktop applications.
5//!
6//! ## Features
7//!
8//! - License activation and deactivation
9//! - License validation
10//! - Device information management
11//! - Automatic device ID generation
12//! - Full async/await support
13//!
14//! ## Quick Start
15//!
16//! ```no_run
17//! use lycento_sdk::{LycentoClient, LycentoConfig};
18//!
19//! #[tokio::main]
20//! async fn main() -> Result<(), Box<dyn std::error::Error>> {
21//!     let config = LycentoConfig::new("https://api.lycento.com")
22//!         .with_api_key("your-api-key")
23//!         .with_timeout(10000);
24//!
25//!     let client = LycentoClient::new(config)?;
26//!
27//!     // Activate a license
28//!     let response = client.activate_license("LICENSE-KEY-HERE").await?;
29//!     println!("Activated: {}", response.success);
30//!
31//!     // Validate a license
32//!     let is_valid = client.validate_license("LICENSE-KEY-HERE").await?;
33//!     println!("Valid: {}", is_valid.valid);
34//!
35//!     Ok(())
36//! }
37//! ```
38//!
39//! ## Tauri Integration
40//!
41//! This SDK is designed to work seamlessly with Tauri applications. You can
42//! expose the client functionality to your frontend using Tauri commands.
43//!
44//! ## Modules
45//!
46//! - [`client`] - Main client for license operations
47//! - [`device`] - Device information and identification
48//! - [`errors`] - Error types
49
50// Re-export public API
51pub use crate::client::{
52    create_client, validate_license, ActivateOptions, ActivateResponse, DeactivateOptions,
53    DeactivateResponse, LicenseInfo, LicenseInfoResponse, LycentoClient, LycentoConfig,
54    ValidateOptions, ValidateResponse,
55};
56
57pub use crate::device::{
58    get_device_id, get_device_info, get_device_name, get_platform, get_platform_version,
59    hash_string, simple_hash, DeviceInfo, Platform,
60};
61
62pub use crate::client::{ActivationDetails, ActivationRecord};
63
64pub use crate::errors::{
65    ActivationError, DeactivationError, LycentoError, NetworkError, ValidationError,
66};
67
68mod client;
69mod device;
70mod errors;
71
72// Re-export version info
73pub const VERSION: &str = env!("CARGO_PKG_VERSION");