docs: document core host and ssh modules

This commit is contained in:
Christian Visintin
2026-03-21 13:36:20 +01:00
parent 7fc61e1e90
commit 3905e8ed79
6 changed files with 35 additions and 0 deletions

View File

@@ -1,3 +1,8 @@
//! ## Remote CLI Arguments
//!
//! Parses positional and bookmark-based CLI arguments into the normalized remote
//! connection parameters used by the application.
use std::path::{Path, PathBuf};
use super::Args;
@@ -13,8 +18,11 @@ enum AddrType {
/// Args for remote connection
#[derive(Debug)]
pub struct RemoteArgs {
/// Optional host bridge selected for the session.
pub host_bridge: Remote,
/// Target remote selected for the session.
pub remote: Remote,
/// Optional local working directory override.
pub local_dir: Option<PathBuf>,
}
@@ -109,6 +117,7 @@ pub enum Remote {
}
impl Remote {
/// Returns whether this CLI slot was left unspecified.
pub fn is_none(&self) -> bool {
matches!(self, Self::None)
}

View File

@@ -1,3 +1,8 @@
//! ## Host Bridge
//!
//! Defines the host abstraction used to expose localhost and bridged remote
//! filesystems through a shared interface.
use std::io::{Read, Write};
use std::path::{Path, PathBuf};

View File

@@ -1,3 +1,8 @@
//! ## Localhost Host Bridge
//!
//! Implements the host bridge abstraction directly against the local
//! filesystem.
use std::fs::{self, OpenOptions};
use std::io::{Read, Write};
#[cfg(posix)]

View File

@@ -1,3 +1,8 @@
//! ## Remote Bridged Host
//!
//! Bridges a `RemoteFs` implementation behind the local host interface used by
//! the file transfer activity.
mod temp_mapped_file;
use std::io::{Read, Write};

View File

@@ -1,3 +1,8 @@
//! ## Import SSH Hosts
//!
//! Imports OpenSSH host entries into termscp bookmarks and optionally registers
//! referenced private keys in the configured SSH key storage.
use std::fs::File;
use std::io::BufReader;
use std::path::PathBuf;

View File

@@ -1,5 +1,11 @@
//! ## SSH Utilities
//!
//! Provides small helpers for loading SSH configuration files used by bookmarks
//! and setup flows.
use ssh2_config::{ParseRule, SshConfig};
/// Parses an OpenSSH-style config file into an `ssh2_config::SshConfig`.
pub fn parse_ssh2_config(path: &str) -> Result<SshConfig, String> {
use std::fs::File;
use std::io::BufReader;