Skip to main content

Crate moosicbox_profiles

Crate moosicbox_profiles 

Source
Expand description

Profile management for MoosicBox.

This crate provides a global registry for managing profile names, allowing applications to track and switch between different user profiles or configurations.

§Features

  • events - Enables profile update event listeners for reacting to profile changes
  • api - Provides actix-web extractors for HTTP requests with profile information

§Example

use moosicbox_profiles::PROFILES;

// Add a profile to the global registry
PROFILES.add("user1".to_string());

// Retrieve a profile
if let Some(profile) = PROFILES.get("user1") {
    println!("Found profile: {}", profile);
}

// List all profiles
let all_profiles = PROFILES.names();

Modules§

api
actix-web integration for profile extraction from HTTP requests.
events
Profile update event handling.

Structs§

Profiles
Registry for managing profile names.

Statics§

PROFILES
Global instance of the profiles registry.