implementing the `ToLua` and `FromLua` traits allows `create_function` to automatically apply the appropriate conversions to the parameters and return values in a callback function. That makes it possible (and nicer!) to write properly typed callbacks.
27 lines
767 B
Rust
27 lines
767 B
Rust
use crate::config::*;
|
|
|
|
#[derive(Default, Debug, Clone, Deserialize, Serialize)]
|
|
pub struct SshDomain {
|
|
/// The name of this specific domain. Must be unique amongst
|
|
/// all types of domain in the configuration file.
|
|
pub name: String,
|
|
|
|
/// identifies the host:port pair of the remote server.
|
|
pub remote_address: String,
|
|
|
|
/// Whether agent auth should be disabled
|
|
#[serde(default)]
|
|
pub no_agent_auth: bool,
|
|
|
|
/// The username to use for authenticating with the remote host
|
|
pub username: String,
|
|
|
|
/// If true, connect to this domain automatically at startup
|
|
#[serde(default)]
|
|
pub connect_automatically: bool,
|
|
|
|
#[serde(default = "default_read_timeout")]
|
|
pub timeout: Duration,
|
|
}
|
|
impl_lua_conversion!(SshDomain);
|