diff --git a/src/config/bookmarks/aws_s3.rs b/src/config/bookmarks/aws_s3.rs index 9522b99..649514f 100644 --- a/src/config/bookmarks/aws_s3.rs +++ b/src/config/bookmarks/aws_s3.rs @@ -1,3 +1,7 @@ +//! ## Bookmark S3 Parameters +//! +//! Stores the bookmark-specific representation of AWS S3 connection settings. + use serde::{Deserialize, Serialize}; use crate::filetransfer::params::AwsS3Params; @@ -5,13 +9,20 @@ use crate::filetransfer::params::AwsS3Params; /// Connection parameters for Aws s3 protocol #[derive(Clone, Deserialize, Serialize, Debug, PartialEq, Eq, Default)] pub struct S3Params { + /// Bucket name to open. pub bucket: String, + /// AWS region used for the bucket. pub region: Option, + /// Custom endpoint URL for S3-compatible services. pub endpoint: Option, + /// Shared credentials profile name. pub profile: Option, + /// Static access key identifier. pub access_key: Option, + /// Static secret access key. pub secret_access_key: Option, /// NOTE: there are no session token and security token since they are always temporary + /// Whether to force path-style bucket addressing. pub new_path_style: Option, } diff --git a/src/config/bookmarks/kube.rs b/src/config/bookmarks/kube.rs index 25c9647..53e9421 100644 --- a/src/config/bookmarks/kube.rs +++ b/src/config/bookmarks/kube.rs @@ -1,3 +1,7 @@ +//! ## Bookmark Kube Parameters +//! +//! Stores bookmark-specific Kubernetes connection settings. + use serde::{Deserialize, Serialize}; use crate::filetransfer::params::KubeProtocolParams; @@ -5,10 +9,15 @@ use crate::filetransfer::params::KubeProtocolParams; /// Extra Connection parameters for Kube protocol #[derive(Clone, Deserialize, Serialize, Debug, PartialEq, Eq, Default)] pub struct KubeParams { + /// Optional default namespace. pub namespace: Option, + /// Optional cluster API URL. pub cluster_url: Option, + /// Optional Kubernetes username override. pub username: Option, + /// Optional client certificate path. pub client_cert: Option, + /// Optional client key path. pub client_key: Option, } diff --git a/src/config/bookmarks/smb.rs b/src/config/bookmarks/smb.rs index 31b8366..2c79fa6 100644 --- a/src/config/bookmarks/smb.rs +++ b/src/config/bookmarks/smb.rs @@ -1,3 +1,7 @@ +//! ## Bookmark SMB Parameters +//! +//! Stores bookmark-specific SMB share configuration. + use serde::{Deserialize, Serialize}; use crate::filetransfer::params::SmbParams as TransferSmbParams; @@ -5,7 +9,9 @@ use crate::filetransfer::params::SmbParams as TransferSmbParams; /// Extra Connection parameters for SMB protocol #[derive(Clone, Deserialize, Serialize, Debug, PartialEq, Eq, Default)] pub struct SmbParams { + /// SMB share name. pub share: String, + /// Optional SMB workgroup used on POSIX platforms. pub workgroup: Option, } diff --git a/src/filetransfer/host_bridge_builder.rs b/src/filetransfer/host_bridge_builder.rs index 5ce30de..0b8ec1b 100644 --- a/src/filetransfer/host_bridge_builder.rs +++ b/src/filetransfer/host_bridge_builder.rs @@ -1,13 +1,19 @@ +//! ## Host Bridge Builder +//! +//! Builds host bridge implementations from persisted host bridge parameters and +//! the active configuration client. + use super::{HostBridgeParams, RemoteFsBuilder}; use crate::host::{HostBridge, Localhost, RemoteBridged}; use crate::system::config_client::ConfigClient; +/// Builds the host-side filesystem bridge used during file transfer sessions. pub struct HostBridgeBuilder; impl HostBridgeBuilder { - /// Build Host Bridge from parms + /// Builds a host bridge from serialized parameters. /// - /// if protocol and parameters are inconsistent, the function will return an error. + /// Returns an error when the selected host protocol and parameters are inconsistent. pub fn build( params: HostBridgeParams, config_client: &ConfigClient, diff --git a/src/host/remote_bridged/temp_mapped_file.rs b/src/host/remote_bridged/temp_mapped_file.rs index 4783cef..142942e 100644 --- a/src/host/remote_bridged/temp_mapped_file.rs +++ b/src/host/remote_bridged/temp_mapped_file.rs @@ -1,3 +1,8 @@ +//! ## Temp Mapped File +//! +//! Provides a temporary local file that mirrors a remote file while keeping a +//! lazily opened read/write handle. + use std::fs::File; use std::io::{self, Read, Write}; use std::sync::{Arc, Mutex}; @@ -34,6 +39,7 @@ impl Read for TempMappedFile { } impl TempMappedFile { + /// Creates an empty temporary file container for a downloaded remote file. pub fn new() -> HostResult { NamedTempFile::new() .map(|tempfile| TempMappedFile { diff --git a/src/system/auto_update.rs b/src/system/auto_update.rs index d01ad3e..4a3dda3 100644 --- a/src/system/auto_update.rs +++ b/src/system/auto_update.rs @@ -23,7 +23,9 @@ pub enum UpdateStatus { /// Info related to a github release #[derive(Debug)] pub struct Release { + /// Release version string returned by GitHub. pub version: String, + /// Release notes body returned by GitHub. pub body: String, } @@ -48,6 +50,7 @@ impl Update { self } + /// Installs the latest available release using the configured update options. pub fn upgrade(self) -> Result { info!("Updating termscp..."); GithubUpdater::configure()