Struct leptos_router::RouteListing
source · pub struct RouteListing { /* private fields */ }
Expand description
A route that this application can serve.
Implementations§
source§impl RouteListing
impl RouteListing
sourcepub fn new(
path: impl ToString,
leptos_path: impl ToString,
mode: SsrMode,
methods: impl IntoIterator<Item = Method>,
static_mode: Option<StaticMode>,
) -> Self
pub fn new( path: impl ToString, leptos_path: impl ToString, mode: SsrMode, methods: impl IntoIterator<Item = Method>, static_mode: Option<StaticMode>, ) -> Self
Create a route listing from its parts.
sourcepub fn path(&self) -> &str
pub fn path(&self) -> &str
The path this route handles.
This should be formatted for whichever web server integegration is being used. (ex: leptos-actix.)
When returned from leptos-router, it matches self.leptos_path()
.
sourcepub fn leptos_path(&self) -> &str
pub fn leptos_path(&self) -> &str
The leptos-formatted path this route handles.
sourcepub fn methods(&self) -> impl Iterator<Item = Method> + '_
pub fn methods(&self) -> impl Iterator<Item = Method> + '_
The HTTP request methods this path can handle.
sourcepub fn static_mode(&self) -> Option<StaticMode>
pub fn static_mode(&self) -> Option<StaticMode>
Whether this route is statically rendered.
sourcepub async fn build_static<IV>(
&self,
options: &LeptosOptions,
app_fn: impl Fn() -> IV + Send + 'static + Clone,
additional_context: impl Fn() + Send + 'static + Clone,
params: &StaticParamsMap,
) -> Result<bool, Error>where
IV: IntoView + 'static,
pub async fn build_static<IV>(
&self,
options: &LeptosOptions,
app_fn: impl Fn() -> IV + Send + 'static + Clone,
additional_context: impl Fn() + Send + 'static + Clone,
params: &StaticParamsMap,
) -> Result<bool, Error>where
IV: IntoView + 'static,
Build a route statically, will return Ok(true)
on success or Ok(false)
when the route
is not marked as statically rendered. All route parameters to use when resolving all paths
to render should be passed in the params
argument.
Trait Implementations§
source§impl Clone for RouteListing
impl Clone for RouteListing
source§fn clone(&self) -> RouteListing
fn clone(&self) -> RouteListing
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for RouteListing
impl Debug for RouteListing
source§impl Default for RouteListing
impl Default for RouteListing
source§fn default() -> RouteListing
fn default() -> RouteListing
Returns the “default value” for a type. Read more
source§impl PartialEq for RouteListing
impl PartialEq for RouteListing
impl Eq for RouteListing
impl StructuralPartialEq for RouteListing
Auto Trait Implementations§
impl Freeze for RouteListing
impl RefUnwindSafe for RouteListing
impl Send for RouteListing
impl Sync for RouteListing
impl Unpin for RouteListing
impl UnwindSafe for RouteListing
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§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.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