mirror of
https://github.com/rm-dr/servable.git
synced 2026-05-16 00:19:01 -07:00
v0.0.6
This commit is contained in:
@@ -60,6 +60,12 @@ impl<S: Servable> ServableWithRoute<S> {
|
||||
pub fn route(&self) -> &str {
|
||||
&self.route
|
||||
}
|
||||
|
||||
/// Get the route associated with this resource,
|
||||
/// with the given prefix
|
||||
pub fn route_at(&self, prefix: &str) -> String {
|
||||
format!("{prefix}/{}", &*self.route)
|
||||
}
|
||||
}
|
||||
|
||||
impl<S: Servable> Servable for ServableWithRoute<S> {
|
||||
|
||||
@@ -91,8 +91,7 @@ pub struct RenderContext {
|
||||
}
|
||||
|
||||
/// The type of device that requested a page
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||
#[derive(Default)]
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
|
||||
pub enum DeviceType {
|
||||
/// This is a mobile device, like a phone.
|
||||
Mobile,
|
||||
@@ -100,10 +99,9 @@ pub enum DeviceType {
|
||||
/// This is a device with a large screen
|
||||
/// and a mouse, like a laptop.
|
||||
#[default]
|
||||
Desktop,
|
||||
Desktop,
|
||||
}
|
||||
|
||||
|
||||
/// Inferred information about the client
|
||||
/// that requested a certain route.
|
||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||
|
||||
Reference in New Issue
Block a user