pub struct AdminApp {
pub title: String,
pub icon: String,
pub prefix: String,
pub entities: Vec<EntityAdmin>,
pub auth: Option<Arc<dyn AdminAuth>>,
pub upload_limit: usize,
/* private fields */
}Fields§
§title: String§icon: String§prefix: String§entities: Vec<EntityAdmin>§auth: Option<Arc<dyn AdminAuth>>§upload_limit: usizeMaximum multipart body size in bytes. Defaults to 10 MiB.
Implementations§
Source§impl AdminApp
impl AdminApp
pub fn new() -> Self
Sourcepub fn upload_limit(self, bytes: usize) -> Self
pub fn upload_limit(self, bytes: usize) -> Self
Set the maximum allowed multipart upload size in bytes. Defaults to 10 MiB (10 * 1024 * 1024).
pub fn title(self, title: &str) -> Self
Sourcepub fn icon(self, icon: &str) -> Self
pub fn icon(self, icon: &str) -> Self
Set the Font Awesome icon class for the app logo in the sidebar.
Defaults to "fa-solid fa-bolt".
pub fn prefix(self, prefix: &str) -> Self
pub fn register(self, entry: impl Into<AdminEntry>) -> Self
pub fn auth(self, auth: Box<dyn AdminAuth>) -> Self
Sourcepub fn template(self, name: &str, content: &str) -> Self
pub fn template(self, name: &str, content: &str) -> Self
Override or add a template by name. The name must match what the router
uses (e.g. "home.html", "layout.html", "form.html").
Custom templates can also be added and rendered via custom routes.
Sourcepub fn template_dir(self, path: impl Into<PathBuf>) -> Self
pub fn template_dir(self, path: impl Into<PathBuf>) -> Self
Load templates from a directory on disk. Any .html file whose name
matches a built-in template will override it; unknown names are added
as new templates. Files are loaded at startup — no runtime reloading.
Multiple directories can be registered; later calls take precedence.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for AdminApp
impl !RefUnwindSafe for AdminApp
impl Send for AdminApp
impl Sync for AdminApp
impl Unpin for AdminApp
impl UnsafeUnpin for AdminApp
impl !UnwindSafe for AdminApp
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more