EguiRouter

Struct EguiRouter 

Source
pub struct EguiRouter<State, History = DefaultHistory> { /* private fields */ }
Expand description

A router instance

Implementations§

Source§

impl<State: 'static, H: History + Default> EguiRouter<State, H>

Source

pub fn builder() -> RouterBuilder<State, H>

Create a new RouterBuilder

Source

pub fn active_route(&self) -> Option<&str>

Get the active route

Source

pub fn history_len(&self) -> usize

How many history entries are there?

Source

pub fn history(&self) -> impl Iterator<Item = &str>

Iterate over the paths in the history

Source

pub fn navigate_transition( &mut self, state: &mut State, path: impl Into<String>, transition_config: TransitionConfig, ) -> RouterResult

Navigate with a custom transition

Source

pub fn navigate( &mut self, state: &mut State, route: impl Into<String>, ) -> RouterResult

Navigate with the default transition

Source

pub fn back_transition( &mut self, transition_config: TransitionConfig, ) -> RouterResult

Go back with a custom transition

Source

pub fn back(&mut self) -> RouterResult

Go back with the default transition

Source

pub fn replace_transition( &mut self, state: &mut State, path: impl Into<String>, transition_config: TransitionConfig, ) -> RouterResult

Replace the current route with a custom transition

Source

pub fn replace( &mut self, state: &mut State, path: impl Into<String>, ) -> RouterResult

Replace the current route with the default transition

Source

pub fn ui(&mut self, ui: &mut Ui, state: &mut State)

Render the router

Auto Trait Implementations§

§

impl<State, History = MemoryHistory> !Freeze for EguiRouter<State, History>

§

impl<State, History = MemoryHistory> !RefUnwindSafe for EguiRouter<State, History>

§

impl<State, History = MemoryHistory> !Send for EguiRouter<State, History>

§

impl<State, History = MemoryHistory> !Sync for EguiRouter<State, History>

§

impl<State, History> Unpin for EguiRouter<State, History>
where History: Unpin,

§

impl<State, History = MemoryHistory> !UnwindSafe for EguiRouter<State, History>

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> 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.