pub struct Admin { /* private fields */ }Expand description
The admin panel module: its address, its title, who may use it and its resources.
Implementations§
Source§impl Admin
impl Admin
Sourcepub fn new() -> Self
pub fn new() -> Self
A panel at /admin, titled “Admin”, with no resources yet, that
nobody may open until authorize says who may.
Sourcepub fn path(self, path: &str) -> Self
pub fn path(self, path: &str) -> Self
Where the panel lives (/admin by default). The route names stay
admin.*.
§Panics
If path doesn’t start with / or ends with one.
Sourcepub fn title(self, title: &str) -> Self
pub fn title(self, title: &str) -> Self
The panel’s name, at the top of its navigation and in page titles.
Who may open the panel at all: logged-in users for whom allows
says yes (others get 403, guests go to log in). Without it, nobody
may.
Sourcepub fn gate(self, name: &str) -> Self
pub fn gate(self, name: &str) -> Self
Lets in the users the gate name lets through (App::gate, or a
permission of that name with the Permissions module, after
App::gate_before).
Sourcepub fn resource<R: AdminResource>(self, resource: R) -> Self
pub fn resource<R: AdminResource>(self, resource: R) -> Self
Adds a resource, after the ones before it in the navigation.
§Panics
If its slug isn’t letters, digits, _ and -, or another resource
has it.
Trait Implementations§
Auto Trait Implementations§
impl !RefUnwindSafe for Admin
impl !UnwindSafe for Admin
impl Freeze for Admin
impl Send for Admin
impl Sync for Admin
impl Unpin for Admin
impl UnsafeUnpin for Admin
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more