#![forbid(unsafe_code)]
#[cfg(feature = "compression")]
#[cfg_attr(feature = "compression", doc(hidden))]
pub use include_flate::flate;
#[allow(unused_imports)]
#[macro_use]
extern crate rust_embed_impl;
pub use rust_embed_impl::*;
pub use rust_embed_utils::{EmbeddedFile, Metadata};
#[doc(hidden)]
pub extern crate rust_embed_utils as utils;
pub trait RustEmbed {
fn get(file_path: &str) -> Option<EmbeddedFile>;
fn iter() -> Filenames;
}
pub use RustEmbed as Embed;
pub enum Filenames {
#[cfg(any(not(debug_assertions), feature = "debug-embed"))]
Embedded(std::slice::Iter<'static, &'static str>),
#[cfg(all(debug_assertions, not(feature = "debug-embed")))]
Dynamic(Box<dyn Iterator<Item = std::borrow::Cow<'static, str>>>),
}
impl Iterator for Filenames {
type Item = std::borrow::Cow<'static, str>;
fn next(&mut self) -> Option<Self::Item> {
match self {
#[cfg(any(not(debug_assertions), feature = "debug-embed"))]
Filenames::Embedded(names) => names.next().map(|x| std::borrow::Cow::from(*x)),
#[cfg(all(debug_assertions, not(feature = "debug-embed")))]
Filenames::Dynamic(boxed) => boxed.next(),
}
}
}