Services refactor

Replace structs of Dep<Service> with OnceServices, so each service has a Services reference

Remove service name => Service map

Flatten Services.rooms

Make reqwest Clients lazy initialized (client service)
This commit is contained in:
dasha_uwu
2025-08-22 20:15:54 +05:00
parent 26b3a84b88
commit b5890b9664
118 changed files with 457 additions and 1923 deletions

View File

@@ -90,7 +90,6 @@ where
.collect::<Vec<_>>();
let summary = services
.rooms
.spaces
.get_summary_and_children_client(room_id, suggested_only, sender_user, &via)
.await;
@@ -139,7 +138,6 @@ where
.stream()
.skip_while(|(room, _)| {
services
.rooms
.short
.get_shortroomid(room)
.map_ok(|short| {
@@ -172,7 +170,6 @@ where
.into_iter()
.map(|(room_id, via)| async move {
let summary = services
.rooms
.spaces
.get_summary_and_children_client(
&room_id,
@@ -199,7 +196,7 @@ where
let next_short_room_ids: Vec<_> = parents
.iter()
.stream()
.filter_map(|room_id| services.rooms.short.get_shortroomid(room_id).ok())
.filter_map(|room_id| services.short.get_shortroomid(room_id).ok())
.collect()
.await;