reorginise

This commit is contained in:
2026-09-10 02:08:45 +01:00
parent 8696425590
commit bdec970b62
20 changed files with 593 additions and 548 deletions
+8 -5
View File
@@ -4,7 +4,7 @@
use iced::Subscription;
use common::{Service, ServicePayloadKind};
use common::{Service, ServiceEvent};
/// Conversion from a route key to the subscription backing it.
///
@@ -12,13 +12,16 @@ use common::{Service, ServicePayloadKind};
/// both `Service` and `Subscription` are foreign to this crate — the orphan
/// rule blocks a foreign trait (`From`) on a foreign type (`Subscription`).
pub trait IntoSubscription {
fn into_subscription(self) -> Subscription<ServicePayloadKind>;
fn into_subscription(self) -> Subscription<ServiceEvent>;
}
impl IntoSubscription for Service {
fn into_subscription(self) -> Subscription<ServicePayloadKind> {
match self {
Service::Clock(_) => service_datetime::ClockTicker::run(),
fn into_subscription(self) -> Subscription<ServiceEvent> {
match self.0 {
key if key.starts_with(service_datetime::NAMESPACE) => {
service_datetime::ClockTicker::run()
}
_ => Subscription::none(),
}
}
}