manta_server/backend_dispatcher/
mod.rs

1//! `StaticBackendDispatcher` implementation modules and the `dispatch!` macro.
2
3/// Dispatches a method call to the underlying backend variant.
4///
5/// Both `CSM` and `OCHAMI` variants always delegate to the
6/// same method with identical arguments, so this macro
7/// eliminates the repetitive `match self` boilerplate.
8///
9/// # Usage
10/// ```ignore
11/// // async method:
12/// dispatch!(self, method_name, arg1, arg2)
13/// // sync method:
14/// dispatch!(sync self, method_name, arg1)
15/// ```
16macro_rules! dispatch {
17  // async (default): adds `.await` after the call
18  ($self:ident, $method:ident $(, $arg:expr)*) => {
19    match $self {
20      CSM(b) => b.$method($($arg),*).await,
21      OCHAMI(b) => b.$method($($arg),*).await,
22    }
23  };
24  // sync: no `.await`
25  (sync $self:ident, $method:ident $(, $arg:expr)*) => {
26    match $self {
27      CSM(b) => b.$method($($arg),*),
28      OCHAMI(b) => b.$method($($arg),*),
29    }
30  };
31}
32
33mod apply_hardware_cluster_pin;
34mod apply_session;
35mod authentication;
36mod boot_parameters;
37mod cfs;
38mod cluster_session;
39mod cluster_template;
40mod component;
41mod console;
42mod delete_configurations_and_related;
43mod group;
44mod hardware_inventory;
45mod ims;
46mod migrate_backup;
47mod migrate_restore;
48mod pcs;
49mod redfish_endpoint;
50mod sat;