Expand description
§Lycento SDK for Rust
A comprehensive Rust SDK for the Lycento licensing platform, designed for integration with Tauri desktop applications.
§Features
- License activation and deactivation
- License validation
- Device information management
- Automatic device ID generation
- Full async/await support
§Quick Start
use lycento_sdk::{LycentoClient, LycentoConfig};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let config = LycentoConfig::new("https://api.lycento.com")
.with_api_key("your-api-key")
.with_timeout(10000);
let client = LycentoClient::new(config)?;
// Activate a license
let response = client.activate_license("LICENSE-KEY-HERE").await?;
println!("Activated: {}", response.success);
// Validate a license
let is_valid = client.validate_license("LICENSE-KEY-HERE").await?;
println!("Valid: {}", is_valid.valid);
Ok(())
}§Tauri Integration
This SDK is designed to work seamlessly with Tauri applications. You can expose the client functionality to your frontend using Tauri commands.
§Modules
- [
client] - Main client for license operations - [
device] - Device information and identification - [
errors] - Error types
Structs§
- Activate
Options - Options for license activation.
- Activate
Response - Response from license activation.
- Activation
Details - Activation details.
- Activation
Record - An activation record.
- Deactivate
Options - Options for license deactivation.
- Deactivate
Response - Response from license deactivation.
- Device
Info - Device information structure.
- License
Info - License information structure.
- License
Info Response - License information with all activations.
- Lycento
Client - The main Lycento client for license operations.
- Lycento
Config - Configuration for the Lycento client.
- Validate
Options - Options for license validation.
- Validate
Response - Response from license validation.
Enums§
- Activation
Error - Error type for license activation failures.
- Deactivation
Error - Error type for license deactivation failures.
- Lycento
Error - Base error type for all Lycento SDK errors.
- Network
Error - Error type for network-related failures.
- Platform
- Supported platforms for license activation.
- Validation
Error - Error type for license validation failures.
Constants§
Functions§
- create_
client - Create a new Lycento client with the given configuration.
- get_
device_ id - Get the cached device ID.
- get_
device_ info - Get the current device information.
- get_
device_ name - Get a human-readable device name.
- get_
platform - Detect the current platform.
- get_
platform_ version - Get the platform version/release.
- hash_
string - Hash a string using SHA256.
- simple_
hash - Generate a simple hash for non-cryptographic purposes.
- validate_
license - Quick validation helper - validates with auto-detected device.