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 areasync. Callers must be running inside a Tokio runtime. Internally usesArc<RwLock<HashMap>>— fine to call from any task, but the task must live on the Tokio runtime.SshClient:Send(notSync). Single-owner state; wrap inArc<RwLock<SshClient>>to share across tasks (asConnectionManagerdoes).StandaloneSftpClient,FtpClient: Same pattern asSshClient.HostKeyStore:Send + Sync. Usestokio::sync::Mutexinternally. Safe to share viaArc.keychainmodule: Synchronous only. Do not call from a Tokiospawn_blockingis fine; do not hold an.awaitacross a keychain call.PtySession:Send. Theoutput_rxfield isArc<Mutex<Receiver>>for sharing.input_txandresize_txare cloneableSenders.DesktopProtocoltrait: RequiresSend + Sync. Implementations (RdpClient,VncClient) areSend(notSync) — wrap inArc<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 file_entry::FileEntry;pub use file_entry::FileEntryType;pub use file_entry::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 ssh::SshTunnel;pub use ssh::SshTunnelRef;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;pub use ssh_commander_keychain as keychain;pub use ssh_commander_pg as postgres;
Modules§
- connection_
manager - desktop_
protocol - event_
bus - Event bus — a single channel for all async-to-sync boundary crossings.
- file_
entry - Protocol-agnostic file listing types and transfer tuning shared by the SFTP and FTP clients.
- ftp_
client - 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
Structs§
- Active
Cursor - Server-side cursor metadata. Held by the client when a query has
remaining rows; consumed (closed) on
close_queryor when the nextexecutecall supersedes it. - Column
Detail - Per-column metadata used by the INSERT form to pre-set Use
DEFAULT and NULL toggles. Read from
pg_attributejoined withpg_attrdeffor the default-presence flag. - Column
Meta - DbSummary
- Execution
Outcome - Insert
Column Input - One column’s worth of input for an INSERT. Caller emits a list
of these for the columns it wants to set explicitly; columns not
in the list are left to the server’s
DEFAULT(which honorspg_attrdef-defined defaults, sequences, generated values, etc). - Inserted
Row - Object
Type - Page
Result - PgConfig
- PgPool
- Relation
- Routine
- Schema
Contents - Unified schema-contents view used by the tree’s “expand a schema” path. Six-way grouping mirrors DataGrip’s tree. Tables include regular, partitioned, and foreign tables (all “data-bearing relations”); views and materialized views split out for clarity.
- Schema
Summary - Sequence
- Update
Outcome
Enums§
- Credential
Kind - Kinds of credential we persist. Serialised in snake_case on the wire so the
frontend can emit e.g.
{"kind": "ssh_password"}. - Object
Type Kind - PgAuth
Method - How to authenticate to the Postgres server.
- PgError
- Errors surfaced from the Postgres explorer layer.
- PgTls
Mode - TLS posture for the connection.
- Relation
Kind - Discriminator for tables / views / matviews / partitioned tables /
foreign tables. Matches
pg_class.relkindvalues that an explorer cares about. Sequences, indexes, composite types, and TOAST relations are excluded fromlist_relationsand so do not appear here. - Routine
Kind
Constants§
- BROWSER_
SESSION_ ID - Stable session id used for the schema browser’s introspection
calls (
list_databases,list_schemas,list_relations). Uses a name that can’t collide with a UUID-generated tab session id.
Functions§
- core_
version - delete_
password - is_
supported - Whether this build can actually read / write the OS keychain. The frontend uses this to hide “Save to Keychain” UI on unsupported platforms instead of letting the save call error at runtime.
- list_
accounts - List all accounts stored under a given kind’s service. Returns an empty vector (not an error) when no entries exist or the platform has no keychain. Useful for the Settings UI to show the user what’s saved.
- load_
password - save_
password