#[non_exhaustive]pub struct NavItem {
pub key: String,
pub label: Text,
pub path: Option<String>,
pub icon: Option<String>,
pub permission: Option<String>,
pub order: i32,
pub after: Option<String>,
pub before: Option<String>,
pub under: Option<String>,
}Expand description
One menu entry: a tab, or an entry under a section.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.key: StringUnique among every item (acme.posts): what another item names in
under.
label: Text§path: Option<String>The path under the admin mount (/posts). A section may have none: its
tab then leads to its first visible entry.
icon: Option<String>An icon name from the icon set.
permission: Option<String>What the operator must hold to see the entry. None shows it to every
signed-in operator; a section with no path shows when any entry does.
order: i32Sorts among siblings, lowest first; equal orders sort by label.
after: Option<String>Sits right after the sibling with this key, whatever the orders say.
before: Option<String>Sits right before the sibling with this key, whatever the orders say.
under: Option<String>The key of the item this sits under; None is the top bar.
Implementations§
Sourcepub fn new(
key: impl Into<String>,
label: impl Into<Text>,
path: impl Into<String>,
) -> Self
pub fn new( key: impl Into<String>, label: impl Into<Text>, path: impl Into<String>, ) -> Self
An entry leading to path.
Sourcepub fn section(key: impl Into<String>, label: impl Into<Text>) -> Self
pub fn section(key: impl Into<String>, label: impl Into<Text>) -> Self
A section: a tab that holds entries and leads to the first one.
pub fn icon(self, icon: impl Into<String>) -> Self
pub fn permission(self, permission: impl Into<String>) -> Self
pub fn order(self, order: i32) -> Self
Trait Implementations§
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
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<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
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