Skip to main content

AreaGroup

Struct AreaGroup 

Source
pub struct AreaGroup { /* private fields */ }
Expand description

The entries of one group of an Area, in the order they are registered. Each resource and page mounts at {prefix}/{area}/{slug}, its slug taken from the area’s own namespace, and its def’s navigation_group gives way to the group.

Implementations§

Source§

impl AreaGroup

Source

pub fn resource<R: Resource>(self) -> Self

Registers the Resource R in the group, as Panel::resource registers it in the panel.

Source

pub fn resource_with<R: Resource>( self, customize: impl FnOnce(ResourceDef<R>) -> ResourceDef<R> + Send + 'static, ) -> Self

Registers the Resource R in the group with customize adjusting its def, as Panel::resource_with does.

Source

pub fn page<P: Page>(self) -> Self

Declares the Page P in the group, as Panel::page declares it in the panel.

Source

pub fn page_with<P: Page>( self, customize: impl FnOnce(PageDef) -> PageDef + Send + 'static, ) -> Self

Declares the Page P in the group with customize adjusting its def, as Panel::page_with does.

Source

pub fn profile(self) -> Self

Moves the profile page Auth::profile installs into the group, at {prefix}/{area}/profile. The user menu’s Profile entry follows it there.

Source

pub fn profile_with( self, customize: impl FnOnce(PageDef) -> PageDef + Send + 'static, ) -> Self

Moves the profile page into the group as profile does, with customize adjusting its def: its slug, label, icon, navigation_order and header_actions, which render in the form’s header and serve at {url}/-/actions/{NAME} as a page’s do: deleting the account belongs there.

Auth renders the page’s form and decides who opens it, so mounting refuses a def that declares widgets, filters or an access check.

Source

pub fn two_factor(self) -> Self

Moves the two-factor settings page Auth::two_factor installs into the group, at {prefix}/{area}/two-factor. The user menu’s entry follows it there.

Source

pub fn two_factor_with( self, customize: impl FnOnce(PageDef) -> PageDef + Send + 'static, ) -> Self

Moves the two-factor settings page into the group as two_factor does, with customize adjusting its def as profile_with reads it, but for header actions, which mounting refuses: the page renders no form header to hold them.

Source

pub fn tenant_profile(self) -> Self

Moves the tenant settings page Auth::tenant_profile installs into the group, at {prefix}/{area}/tenant. The tenant menu’s entry follows it there. The entry shows to a user who may edit the tenant the request acts for.

Source

pub fn tenant_profile_with( self, customize: impl FnOnce(PageDef) -> PageDef + Send + 'static, ) -> Self

Moves the tenant settings page into the group as tenant_profile does, with customize adjusting its def as profile_with reads it: deleting the tenant is a header action of it.

Source

pub fn audit_log(self) -> Self

Moves the list of the audit log Panel::audit_log keeps into the group, at {prefix}/{area}/audit-log, with the def audit_log gave it. In a tenant_group, the list sits beside the tenant’s members and billing.

Mounting refuses an area that places the log when the panel keeps none, and a second group that places it.

Trait Implementations§

Source§

impl Debug for AreaGroup

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for AreaGroup

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> ErasedDestructor for T
where T: 'static,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more