Skip to main content

Module client

Module client 

Source
Expand description

Cliente SSH real via russh 0.62.2.

One-shot connection: TCP + handshake + auth (password and/or key) + exec with timeout, output truncation, and best-effort remote abort. Host keys: TOFU em known_hosts XDG (ver super::known_hosts).

§Workload classification (resource economy)

  • Class: I/O-bound (SSH/TCP + disk SCP). Not CPU-bound.
  • Runtime: Tokio multi-thread (see main.rs) for russh crypto/IO + tunnel accept fan-out — not a substitute for CPU parallelism.
  • No Rayon / no process pool: one-shot single session; coordination cost exceeds any local CPU fan-out on the agent path.
  • Capture RAM: stdout/stderr bounded by max_chars×4 bytes (UTF-8 worst case) and hard-capped at [EXEC_CAPTURE_HARD_MAX_BYTES] per stream.
  • SCP: stream in 32 KiB chunks to/from disk (no full-file heap load); disk I/O uses tokio::fs so the async worker is not blocked on syscalls.
  • Latency: RTT-bound; decode path reuses the capture Vec via [take_utf8_capped] when remote bytes are valid UTF-8.

Re-exports§

pub use super::connection::ConnectionConfig;

Structs§

ClientHandlerssh-real
Real SSH client backed by russh (default feature ssh-real). russh handler with TOFU known_hosts (or test-only always-trust when path is absent).
ExecutionOutput
Output of a remote SSH command execution.
SshClientssh-real
Real SSH client backed by russh (default feature ssh-real). Active SSH client with an authenticated session.
TransferResult
Result of an SCP file transfer operation.

Traits§

SshClientTrait
SSH client trait allowing a real (russh) or mock implementation for tests.
TunnelChannel
Bidirectional stream used for SSH tunnel (direct-tcpip).

Functions§

truncate_utf8
Truncates a UTF-8 string to at most max_chars codepoints.