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:
Generated
+1
-1
@@ -1274,7 +1274,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "servable"
|
||||
version = "0.0.5"
|
||||
version = "0.0.6"
|
||||
dependencies = [
|
||||
"axum",
|
||||
"chrono",
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ resolver = "2"
|
||||
[workspace.package]
|
||||
rust-version = "1.90.0"
|
||||
edition = "2024"
|
||||
version = "0.0.5"
|
||||
version = "0.0.6"
|
||||
license = "GPL-3.0"
|
||||
repository = "https://github.com/rm-dr/servable"
|
||||
readme = "README.md"
|
||||
|
||||
@@ -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