Skip to main content

Crate lycento_sdk

Crate lycento_sdk 

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

ActivateOptions
Options for license activation.
ActivateResponse
Response from license activation.
ActivationDetails
Activation details.
ActivationRecord
An activation record.
DeactivateOptions
Options for license deactivation.
DeactivateResponse
Response from license deactivation.
DeviceInfo
Device information structure.
LicenseInfo
License information structure.
LicenseInfoResponse
License information with all activations.
LycentoClient
The main Lycento client for license operations.
LycentoConfig
Configuration for the Lycento client.
ValidateOptions
Options for license validation.
ValidateResponse
Response from license validation.

Enums§

ActivationError
Error type for license activation failures.
DeactivationError
Error type for license deactivation failures.
LycentoError
Base error type for all Lycento SDK errors.
NetworkError
Error type for network-related failures.
Platform
Supported platforms for license activation.
ValidationError
Error type for license validation failures.

Constants§

VERSION

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.