pub struct Resource {
pub base_path: String,
pub nav_label: Text,
pub list: ListConfig,
pub form: Option<FormConfig>,
pub permission: Option<String>,
}Expand description
An admin resource: a list screen, optionally with a create/edit form, mounted
under base_path and shown in the menu as nav_label.
Fields§
§base_path: StringThe path the resource mounts at, relative to the admin root and starting
with a slash (e.g. /products). The framework prepends the configured
admin mount, so a resource never hardcodes it and survives a moved panel.
The list’s edit_base and the form’s base_path are resolved the same
way.
The menu label, localized at render. Serde stays a plain string.
list: ListConfig§form: Option<FormConfig>§permission: Option<String>The permission an operator must hold to reach any of the resource’s
routes. A dotted string gates every route the resource mounts, and an
operator who lacks it receives 403 Forbidden; superusers pass regardless.
None leaves the resource open to any signed-in operator and is allowed
only for a read-only resource: a resource with a create/edit form must
declare a permission, or boot aborts (see [mount_resource]).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Resource
impl RefUnwindSafe for Resource
impl Send for Resource
impl Sync for Resource
impl Unpin for Resource
impl UnsafeUnpin for Resource
impl UnwindSafe for Resource
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
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