pub trait StaticStorage: Send + Sync {
// Required methods
fn put(&self, rel_path: &str, bytes: &[u8]) -> Result<(), StaticError>;
fn exists(&self, rel_path: &str) -> Result<bool, StaticError>;
}Expand description
A swappable destination for collected static assets, the
static-files storage backend. collectstatic writes every file through a
StaticStorage rather than calling std::fs directly, so the same
collect path targets the local filesystem (LocalStorage, the
default) or a remote object store (the feature-gated S3 backend in
umbral-storage) without the collect engine knowing which.
rel_path is always the logical path RELATIVE to static_root
("admin/admin.css", "css/app.css"), forward-slash separated. The
backend maps it onto its own addressing (a filesystem join, an S3
object key) — the engine never constructs an absolute on-disk path.
Required Methods§
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".