Skip to main content

DocsViewerState

Struct DocsViewerState 

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

Shared reactive state driving the showcase-parity euv-docs viewer across native desktop, headless, and WebAssembly targets.

Implementations§

Source§

impl DocsViewerState

Lifecycle, theme cycling, search grouping, and navigation helpers for DocsViewerState.

Source

pub fn new( site: DocSite, active_route: Signal<String>, search_query: Signal<String>, tokens: ThemeTokens, ) -> Self

Creates a new reactive DocsViewerState from site, route/search signals, and initial tokens.

§Arguments
  • DocSite - Loaded documentation site.
  • Signal<String> - Active canonical route signal.
  • Signal<String> - Live sidebar search query signal.
  • ThemeTokens - Initial design scheme and Light/Dark theme tokens.
§Returns
  • Self - Initialized reactive documentation viewer state.
Source

pub fn next_scheme(&self)

Cycles to the next DesignScheme across all 17 built-in euv-ui schemes.

§Arguments
  • &Self - Documentation viewer state reference.
Source

pub fn toggle_theme_mode(&self)

Toggles the active theme between Light and Dark modes.

§Arguments
  • &Self - Documentation viewer state reference.
Source

pub fn breadcrumb_for_route(&self, route: &str) -> String

Formats the persistent top-bar context breadcrumb string for route.

§Arguments
  • &Self - Documentation viewer state reference.
  • &str - Active canonical route path.
§Returns
  • String - Formatted "Section / Page Title" breadcrumb string.
Source

pub fn ordered_routes(&self) -> Vec<String>

Returns all visible page routes in canonical reading order for swipe navigation and pagination.

§Arguments
  • &Self - Documentation viewer state reference.
§Returns
  • Vec<String> - Ordered canonical route strings.
Source

pub fn filtered_section_groups( &self, query: &str, ) -> (usize, Vec<EuvDocSectionGroup>)

Groups search-filtered sidebar pages into collapsible EuvDocSectionGroup entries.

§Arguments
  • &Self - Documentation viewer state reference.
  • &str - Current search filter query.
§Returns
  • (usize, Vec<EuvDocSectionGroup>) - Total matched page count and ordered section groups.

Resolves the previous and next neighbor pages surrounding route in canonical reading order.

§Arguments
  • &Self - Documentation viewer state reference.
  • &str - Active canonical page route.
§Returns
  • (Option<EuvDocPagerLink>, Option<EuvDocPagerLink>) - Previous and next pager link descriptors.
Source

pub fn asset_base(&self) -> String

Returns the relative site-root asset base prefix ("./" for root locale, "../" for /en/, etc.).

§Arguments
  • &Self - Documentation viewer state reference.
§Returns
  • String - Relative site-root prefix for static assets and images.
Source

pub fn home_route(&self) -> String

Returns the canonical home route for this documentation site ("/" when present, else first page).

§Arguments
  • &Self - Documentation viewer state reference.
§Returns
  • String - Canonical home route path.
Source

pub fn bottom_nav_items(&self) -> Vec<EuvNavItem>

Builds the strictly two-item mobile EuvBottomNav tabs (Home and Catalog) localized for the active site language.

§Arguments
  • &Self - Documentation viewer state reference.
§Returns
  • Vec<EuvNavItem> - Exactly two mobile bottom navigation tabs (Home and Catalog).
Source§

impl DocsViewerState

Source

pub fn get_site(&self) -> &Rc<DocSite>

Source

pub fn get_mut_site(&mut self) -> &mut Rc<DocSite>

Source

pub fn set_site(&mut self, val: Rc<DocSite>) -> &mut Self

Source

pub fn get_theme(&self) -> &UiThemeState

Source

pub fn get_mut_theme(&mut self) -> &mut UiThemeState

Source

pub fn set_theme(&mut self, val: UiThemeState) -> &mut Self

Source

pub fn get_router(&self) -> &EuvRouter

Source

pub fn get_mut_router(&mut self) -> &mut EuvRouter

Source

pub fn set_router(&mut self, val: EuvRouter) -> &mut Self

Source

pub fn get_active_route(&self) -> Signal<String>

Source

pub fn get_mut_active_route(&mut self) -> &mut Signal<String>

Source

pub fn set_active_route(&mut self, val: Signal<String>) -> &mut Self

Source

pub fn get_search_query(&self) -> Signal<String>

Source

pub fn get_mut_search_query(&mut self) -> &mut Signal<String>

Source

pub fn set_search_query(&mut self, val: Signal<String>) -> &mut Self

Source

pub fn get_active_toc_slug(&self) -> Signal<String>

Source

pub fn get_mut_active_toc_slug(&mut self) -> &mut Signal<String>

Source

pub fn set_active_toc_slug(&mut self, val: Signal<String>) -> &mut Self

Source

pub fn get_cmd_open(&self) -> Signal<bool>

Source

pub fn get_mut_cmd_open(&mut self) -> &mut Signal<bool>

Source

pub fn set_cmd_open(&mut self, val: Signal<bool>) -> &mut Self

Source

pub fn get_cmd_query(&self) -> Signal<String>

Source

pub fn get_mut_cmd_query(&mut self) -> &mut Signal<String>

Source

pub fn set_cmd_query(&mut self, val: Signal<String>) -> &mut Self

Source

pub fn get_catalog_drawer_open(&self) -> Signal<bool>

Source

pub fn get_mut_catalog_drawer_open(&mut self) -> &mut Signal<bool>

Source

pub fn set_catalog_drawer_open(&mut self, val: Signal<bool>) -> &mut Self

Source

pub fn get_catalog_items(&self) -> Signal<Vec<DocsCatalogArtifact>>

Source

pub fn get_mut_catalog_items(&mut self) -> &mut Signal<Vec<DocsCatalogArtifact>>

Source

pub fn set_catalog_items( &mut self, val: Signal<Vec<DocsCatalogArtifact>>, ) -> &mut Self

Source

pub fn get_catalog_loading(&self) -> Signal<bool>

Source

pub fn get_mut_catalog_loading(&mut self) -> &mut Signal<bool>

Source

pub fn set_catalog_loading(&mut self, val: Signal<bool>) -> &mut Self

Source

pub fn get_catalog_error(&self) -> Signal<bool>

Source

pub fn get_mut_catalog_error(&mut self) -> &mut Signal<bool>

Source

pub fn set_catalog_error(&mut self, val: Signal<bool>) -> &mut Self

Source

pub fn get_router_ready(&self) -> &Rc<Cell<bool>>

Source

pub fn get_mut_router_ready(&mut self) -> &mut Rc<Cell<bool>>

Source

pub fn set_router_ready(&mut self, val: Rc<Cell<bool>>) -> &mut Self

Trait Implementations§

Source§

impl Clone for DocsViewerState

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for DocsViewerState

§

impl !Send for DocsViewerState

§

impl !Sync for DocsViewerState

§

impl !UnwindSafe for DocsViewerState

§

impl Forget for DocsViewerState

§

impl Freeze for DocsViewerState

§

impl Move for DocsViewerState

§

impl Unpin for DocsViewerState

§

impl UnsafeUnpin for DocsViewerState

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<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.