pub struct ToolbarButton {
pub label: Text,
pub href: String,
pub icon: Option<String>,
pub permission: Option<String>,
pub primary: bool,
}Expand description
A button a list offers in its toolbar, beside the built-in New.
A resource declares its own; the framework contributes New and the export menu the same way, so the toolbar is one list of buttons rather than a hardcoded bar with special cases.
Fields§
§label: TextThe button’s text, localized at render.
href: StringWhere it goes: a path under the admin root (starting with a slash), or an absolute URL.
icon: Option<String>An icon name from the shared set. Absent renders the label alone.
permission: Option<String>Hidden from an operator who lacks this permission. Absent shows it to anyone who can reach the screen.
primary: boolRendered as the prominent action rather than a secondary one.
Implementations§
Trait Implementations§
Source§impl Clone for ToolbarButton
impl Clone for ToolbarButton
Source§fn clone(&self) -> ToolbarButton
fn clone(&self) -> ToolbarButton
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ToolbarButton
impl Debug for ToolbarButton
Auto Trait Implementations§
impl Freeze for ToolbarButton
impl RefUnwindSafe for ToolbarButton
impl Send for ToolbarButton
impl Sync for ToolbarButton
impl Unpin for ToolbarButton
impl UnsafeUnpin for ToolbarButton
impl UnwindSafe for ToolbarButton
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
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> ⓘ
Converts
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> ⓘ
Converts
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