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
64
65
66
67
//! Embedded static assets for native applications.
//!
//! This crate provides compile-time embedded access to static assets (images, icons, etc.)
//! from the `public/` directory using the `rust_embed` library. Assets are embedded directly
//! into the binary, eliminating the need for runtime file system access.
//!
//! # Primary Use Cases
//!
//! * Embedding application icons and images in native GUI applications
//! * Providing fallback assets when file system access is unavailable
//! * Ensuring assets are always available without external dependencies
//!
//! # Example
//!
//! ```rust
//! use moosicbox_app_native_image::{Asset, get_asset_arc_bytes};
//! use rust_embed::RustEmbed;
//!
//! // Access an embedded asset by path
//! if let Some(asset) = Asset::get("/public/icon.png") {
//! let bytes = get_asset_arc_bytes(asset);
//! // Use the bytes...
//! }
//! ```
//!
//! # Main Entry Points
//!
//! * [`Asset`] - The embedded asset collection
//! * [`get_asset_arc_bytes`] - Convert embedded files to `Arc<Bytes>`
use ;
use Bytes;
use ;
/// Embedded static assets from the `public/` directory.
///
/// This struct provides access to files embedded at compile time using `rust_embed`.
/// Assets are prefixed with `/public/` in their paths.
;
/// Converts a `Cow<[u8]>` into an `Arc<Bytes>`.
///
/// This internal helper handles both owned and borrowed byte slices, converting them
/// into a reference-counted byte buffer for efficient sharing.
/// Converts an embedded asset file into an `Arc<Bytes>`.
///
/// This function takes an `EmbeddedFile` and converts its data into a reference-counted
/// byte buffer for efficient sharing across threads.