♻️ (statics): Renombra StaticResource a StaticFile
Clarifica la distinción entre un fichero estático individual (`StaticFile`) y el contenedor de varios ficheros (`StaticResources`).
This commit is contained in:
parent
b1ce79c78f
commit
2c52af4b9d
6 changed files with 32 additions and 37 deletions
|
|
@ -134,26 +134,26 @@ pub const PAGETOP_VERSION: &str = env!("CARGO_PKG_VERSION");
|
|||
|
||||
pub use pagetop_macros::{AutoDefault, builder_fn, html, main, test};
|
||||
|
||||
pub use pagetop_statics::{StaticResource, resource};
|
||||
pub use pagetop_statics::{StaticFile, resource};
|
||||
|
||||
pub use getter_methods::Getters;
|
||||
|
||||
/// Contenedor para un conjunto de recursos embebidos.
|
||||
#[derive(AutoDefault)]
|
||||
pub struct StaticResources {
|
||||
bundle: HashMap<&'static str, StaticResource>,
|
||||
bundle: HashMap<&'static str, StaticFile>,
|
||||
}
|
||||
|
||||
impl StaticResources {
|
||||
/// Crea un contenedor para un conjunto de recursos generado por `build.rs` (consultar
|
||||
/// [`pagetop_build`](https://docs.rs/pagetop-build)).
|
||||
pub fn new(bundle: HashMap<&'static str, StaticResource>) -> Self {
|
||||
pub fn new(bundle: HashMap<&'static str, StaticFile>) -> Self {
|
||||
Self { bundle }
|
||||
}
|
||||
}
|
||||
|
||||
impl Deref for StaticResources {
|
||||
type Target = HashMap<&'static str, StaticResource>;
|
||||
type Target = HashMap<&'static str, StaticFile>;
|
||||
|
||||
fn deref(&self) -> &Self::Target {
|
||||
&self.bundle
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue