manta_server/service/infra_backend.rs
1//! Dispatcher-meta methods on `InfraContext`.
2//!
3//! The per-domain wrapper methods that used to live in sibling files
4//! (auth/bos/bss/cfs/delete_configurations/hsm/ims/migrate/pcs/redfish/
5//! sat) have been removed; service code now calls
6//! `infra.backend.<method>(...)` directly via the corresponding trait
7//! imports. Only the truly dispatcher-level helpers remain here:
8//! `backend_kind` and `backend_clone`.
9
10use crate::server::common::app_context::InfraContext;
11
12impl InfraContext<'_> {
13 /// Stable label for the active backend (`csm`, `ochami`, ...).
14 pub fn backend_kind(&self) -> &'static str {
15 self.backend.backend_kind()
16 }
17
18 /// Return an owned clone of the backend dispatcher.
19 ///
20 /// `InfraContext<'a>` is borrowed, so it can't cross into a
21 /// `'static`-bound spawned future (`tokio::spawn`, `JoinSet::spawn`).
22 /// Service code that fans out per-node work needs an owned dispatcher
23 /// inside each spawned task — that's what this returns. Cloning is
24 /// cheap because `StaticBackendDispatcher` is `Arc`-shaped under the
25 /// hood.
26 pub fn backend_clone(&self) -> crate::dispatcher::StaticBackendDispatcher {
27 self.backend.clone()
28 }
29}