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]]
|
[[package]]
|
||||||
name = "servable"
|
name = "servable"
|
||||||
version = "0.0.5"
|
version = "0.0.6"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"axum",
|
"axum",
|
||||||
"chrono",
|
"chrono",
|
||||||
|
|||||||
+1
-1
@@ -5,7 +5,7 @@ resolver = "2"
|
|||||||
[workspace.package]
|
[workspace.package]
|
||||||
rust-version = "1.90.0"
|
rust-version = "1.90.0"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
version = "0.0.5"
|
version = "0.0.6"
|
||||||
license = "GPL-3.0"
|
license = "GPL-3.0"
|
||||||
repository = "https://github.com/rm-dr/servable"
|
repository = "https://github.com/rm-dr/servable"
|
||||||
readme = "README.md"
|
readme = "README.md"
|
||||||
|
|||||||
@@ -60,6 +60,12 @@ impl<S: Servable> ServableWithRoute<S> {
|
|||||||
pub fn route(&self) -> &str {
|
pub fn route(&self) -> &str {
|
||||||
&self.route
|
&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> {
|
impl<S: Servable> Servable for ServableWithRoute<S> {
|
||||||
|
|||||||
@@ -91,8 +91,7 @@ pub struct RenderContext {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// The type of device that requested a page
|
/// The type of device that requested a page
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Default)]
|
||||||
#[derive(Default)]
|
|
||||||
pub enum DeviceType {
|
pub enum DeviceType {
|
||||||
/// This is a mobile device, like a phone.
|
/// This is a mobile device, like a phone.
|
||||||
Mobile,
|
Mobile,
|
||||||
@@ -103,7 +102,6 @@ pub enum DeviceType {
|
|||||||
Desktop,
|
Desktop,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// Inferred information about the client
|
/// Inferred information about the client
|
||||||
/// that requested a certain route.
|
/// that requested a certain route.
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
|
||||||
|
|||||||
Reference in New Issue
Block a user