Skip to main content

Crate ssh_commander_core

Crate ssh_commander_core 

Source
Expand description

ssh-commander-core: Rust domain layer for R-Shell.

This crate owns all connection and protocol logic: SSH, PTY lifecycle, host-key handling, connection manager, SFTP, FTP, desktop protocol (RDP/VNC), and Keychain integration.

§Thread Safety

  • ConnectionManager: Send + Sync. All public methods are async. Callers must be running inside a Tokio runtime. Internally uses Arc<RwLock<HashMap>> — fine to call from any task, but the task must live on the Tokio runtime.
  • SshClient: Send (not Sync). Single-owner state; wrap in Arc<RwLock<SshClient>> to share across tasks (as ConnectionManager does).
  • StandaloneSftpClient, FtpClient: Same pattern as SshClient.
  • HostKeyStore: Send + Sync. Uses tokio::sync::Mutex internally. Safe to share via Arc.
  • keychain module: Synchronous only. Do not call from a Tokio spawn_blocking is fine; do not hold an .await across a keychain call.
  • PtySession: Send. The output_rx field is Arc<Mutex<Receiver>> for sharing. input_tx and resize_tx are cloneable Senders.
  • DesktopProtocol trait: Requires Send + Sync. Implementations (RdpClient, VncClient) are Send (not Sync) — wrap in Arc<RwLock<Box<dyn DesktopProtocol>>>.

Re-exports§

pub use connection_manager::ConnectionManager;
pub use connection_manager::ManagedConnection;
pub use connection_manager::ProtocolKind;
pub use desktop_protocol::DesktopConnectRequest;
pub use desktop_protocol::DesktopConnectResponse;
pub use desktop_protocol::DesktopKind;
pub use desktop_protocol::DesktopProtocol;
pub use desktop_protocol::FrameUpdate;
pub use desktop_protocol::RdpConfig;
pub use desktop_protocol::VncConfig;
pub use event_bus::CoreEvent;
pub use keychain::CredentialKind;
pub use keychain::delete_password;
pub use keychain::is_supported;
pub use keychain::list_accounts;
pub use keychain::load_password;
pub use keychain::save_password;
pub use postgres::ActiveCursor;
pub use postgres::BROWSER_SESSION_ID;
pub use postgres::ColumnDetail;
pub use postgres::ColumnMeta;
pub use postgres::DbSummary;
pub use postgres::ExecutionOutcome;
pub use postgres::InsertColumnInput;
pub use postgres::InsertedRow;
pub use postgres::ObjectType;
pub use postgres::ObjectTypeKind;
pub use postgres::PageResult;
pub use postgres::PgAuthMethod;
pub use postgres::PgConfig;
pub use postgres::PgError;
pub use postgres::PgPool;
pub use postgres::PgTlsMode;
pub use postgres::Relation;
pub use postgres::RelationKind;
pub use postgres::Routine;
pub use postgres::RoutineKind;
pub use postgres::SchemaContents;
pub use postgres::SchemaSummary;
pub use postgres::Sequence;
pub use postgres::SshTunnelRef;
pub use postgres::UpdateOutcome;
pub use sftp_client::FileEntry;
pub use sftp_client::FileEntryType;
pub use sftp_client::RemoteFileEntry;
pub use sftp_client::SftpAuthMethod;
pub use sftp_client::SftpConfig;
pub use sftp_client::StandaloneSftpClient;
pub use ssh::AuthMethod;
pub use ssh::CommandOutput;
pub use ssh::HostKeyMismatch;
pub use ssh::HostKeyStore;
pub use ssh::HostKeyStoreAccessError;
pub use ssh::HostKeyVerificationFailure;
pub use ssh::PtySession;
pub use ssh::SshClient;
pub use ssh::SshConfig;
pub use tools::DnsAnswer;
pub use tools::DnsQuery;
pub use tools::GitStatus;
pub use tools::ListeningPort;
pub use tools::TcpdumpEvent;
pub use tools::TcpdumpRegistry;
pub use tools::ToolsError;
pub use tools::dns_resolve_local;
pub use tools::dns_resolve_remote;
pub use tools::git_status;
pub use tools::listening_ports;

Modules§

connection_manager
desktop_protocol
event_bus
Event bus — a single channel for all async-to-sync boundary crossings.
ftp_client
keychain
macOS Keychain integration for SSH / SFTP / FTP credentials.
postgres
PostgreSQL pool for the database explorer.
rdp_client
sftp_client
ssh
tools
Network/dev tools surface — features that ride on top of an existing SSH connection without requiring a separate protocol implementation.
vnc_client

Functions§

core_version