manta-cli 1.64.3

Another CLI for ALPS
//! Dispatches `ConsoleTrait` methods to csm-rs or ochami-rs.

use manta_backend_dispatcher::{
  error::Error, interfaces::console::ConsoleTrait, types::K8sDetails,
};

use StaticBackendDispatcher::*;
use tokio::io::{AsyncRead, AsyncWrite};

use crate::manta_backend_dispatcher::StaticBackendDispatcher;

impl ConsoleTrait for StaticBackendDispatcher {
  type T = Box<dyn AsyncWrite + Unpin + Send>;
  type U = Box<dyn AsyncRead + Unpin + Send>;

  async fn attach_to_node_console(
    &self,
    shasta_token: &str,
    site_name: &str,
    xname: &str,
    width: u16,
    height: u16,
    k8s: &K8sDetails,
  ) -> Result<(Box<dyn AsyncWrite + Unpin + Send>, Box<dyn AsyncRead + Unpin + Send>), Error>
  {
    dispatch!(
      self,
      attach_to_node_console,
      shasta_token,
      site_name,
      xname,
      width,
      height,
      k8s
    )
  }

  async fn attach_to_session_console(
    &self,
    shasta_token: &str,
    site_name: &str,
    session_name: &str,
    width: u16,
    height: u16,
    k8s: &K8sDetails,
  ) -> Result<(Box<dyn AsyncWrite + Unpin + Send>, Box<dyn AsyncRead + Unpin + Send>), Error>
  {
    dispatch!(
      self,
      attach_to_session_console,
      shasta_token,
      site_name,
      session_name,
      width,
      height,
      k8s
    )
  }
}