pub struct ResolvedMenuItem {
pub id: Option<i64>,
pub label: String,
pub url: Option<String>,
pub is_page: bool,
pub page_id: Option<i64>,
pub open_in_new_tab: bool,
pub is_active: bool,
pub in_active_trail: bool,
pub children: Vec<ResolvedMenuItem>,
}Expand description
One node in the resolved menu tree. Themes iterate this shape.
Fields§
§id: Option<i64>cms_menu_item.id — lets a headless client correlate a rendered
node with the row an editor edits.
label: String§url: Option<String>Where the item points. null for a grouping header — an item with
neither a page nor an external URL, which is a label, not a link.
is_page: booltrue when this item targets a CMS page (vs. an external URL).
page_id: Option<i64>§open_in_new_tab: bool§is_active: boolThis item targets the page currently being viewed.
in_active_trail: boolThis item lies on the path to the current page — it targets an ancestor of it, or it parents a subtree containing the active item. The second case is what highlights a top-level section whose own link is a grouping label or an external URL.
children: Vec<ResolvedMenuItem>Trait Implementations§
Source§impl Clone for ResolvedMenuItem
impl Clone for ResolvedMenuItem
Source§impl Debug for ResolvedMenuItem
impl Debug for ResolvedMenuItem
Auto Trait Implementations§
impl Forget for ResolvedMenuItem
impl Freeze for ResolvedMenuItem
impl RefUnwindSafe for ResolvedMenuItem
impl Send for ResolvedMenuItem
impl Sync for ResolvedMenuItem
impl Unpin for ResolvedMenuItem
impl UnsafeUnpin for ResolvedMenuItem
impl UnwindSafe for ResolvedMenuItem
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 moreCreates a shared type from an unshared type.