use crate::view::View;
use generic_array::ArrayLength;
type GetViewResult<W, H, C, N> = Result<Box<dyn View<W, H, C, N>>, Box<dyn std::error::Error>>;
pub trait NavigationEntry<W, H, C>: Default + Send + Sync + Clone + PartialEq + 'static
where
W: ArrayLength,
H: ArrayLength,
C: Send + Clone + Sync + 'static,
{
fn get_view(
&self,
context: C,
) -> impl std::future::Future<Output = GetViewResult<W, H, C, Self>>;
}
pub trait IntoNavigationEntry<W, H, C, N>
where
W: ArrayLength,
H: ArrayLength,
C: Send + Clone + Sync + 'static,
N: NavigationEntry<W, H, C>,
{
fn into_navigation_entry(self) -> N;
}