pub struct ClientRoutes { /* private fields */ }Expand description
The console’s client route set, parsed from a bundle’s manifest.
Implementations§
Source§impl ClientRoutes
impl ClientRoutes
Sourcepub fn parse(bytes: &[u8]) -> Result<Self, String>
pub fn parse(bytes: &[u8]) -> Result<Self, String>
Parse a bundle’s client-routes.json.
§Errors
Returns a human-readable message when the file is not JSON of the expected shape, when it declares no routes, or when a pattern carries a parameter shape this server does not implement. All three are refused rather than defaulted: a bundle whose route set cannot be read is a bundle whose screens would 404, and guessing at it would hide exactly the defect this file exists to prevent.
Sourcepub fn matches(&self, path: &str) -> bool
pub fn matches(&self, path: &str) -> bool
Whether a request path is one of the console’s own routes.
Matching is segment-wise, so a trailing slash is the same route and a
path with more or fewer segments is not. This is the same algorithm the
console’s matchesClientRoute implements over the same manifest, and
both are driven with the same table of cases so they cannot drift on an
answer.
Trait Implementations§
Source§impl Clone for ClientRoutes
impl Clone for ClientRoutes
Source§fn clone(&self) -> ClientRoutes
fn clone(&self) -> ClientRoutes
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for ClientRoutes
impl RefUnwindSafe for ClientRoutes
impl Send for ClientRoutes
impl Sync for ClientRoutes
impl Unpin for ClientRoutes
impl UnsafeUnpin for ClientRoutes
impl UnwindSafe for ClientRoutes
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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> IntoMaybeUndefined<T> for T
impl<T> IntoMaybeUndefined<T> for T
Source§fn into_maybe_undefined(self) -> MaybeUndefined<T>
fn into_maybe_undefined(self) -> MaybeUndefined<T>
Source§impl<T> IntoOption<T> for T
impl<T> IntoOption<T> for T
Source§fn into_option(self) -> Option<T>
fn into_option(self) -> Option<T>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request