manta_server/backend_dispatcher/
console.rs

1//! [`ConsoleTrait`] impl for [`StaticBackendDispatcher`].
2//!
3//! Opens a PTY-style attachment to a CSM `cray-console-operator`
4//! pod (per-node) or the CFS session pod (per-session) via the
5//! Kubernetes exec subprotocol. Ochami's `impl ConsoleTrait for
6//! Ochami {}` uses the trait default, so both methods on the Ochami
7//! branch return [`Error::Message`] ("Attach to … console command
8//! not implemented for this backend").
9
10use super::*;
11
12impl ConsoleTrait for StaticBackendDispatcher {
13  type T = Box<dyn AsyncWrite + Unpin + Send>;
14  type U = Box<dyn AsyncRead + Unpin + Send>;
15
16  async fn attach_to_node_console(
17    &self,
18    token: &str,
19    site_name: &str,
20    xname: &str,
21    width: u16,
22    height: u16,
23    k8s: &K8sDetails,
24  ) -> Result<(Self::T, Self::U), Error> {
25    dispatch!(
26      self,
27      attach_to_node_console,
28      token,
29      site_name,
30      xname,
31      width,
32      height,
33      k8s
34    )
35  }
36
37  async fn attach_to_session_console(
38    &self,
39    token: &str,
40    site_name: &str,
41    session_name: &str,
42    width: u16,
43    height: u16,
44    k8s: &K8sDetails,
45  ) -> Result<(Self::T, Self::U), Error> {
46    dispatch!(
47      self,
48      attach_to_session_console,
49      token,
50      site_name,
51      session_name,
52      width,
53      height,
54      k8s
55    )
56  }
57}