#![cfg(feature = "alloc")]
use alloc::string::String;
pub mod client;
pub mod glob;
pub mod parser;
pub mod server;
pub use client::{
ClientOptions, LocalForwardSpec, RemoteForwardSpec, RequestTty, SshClientConfig, StrictMode,
};
pub use glob::HostPattern;
pub use server::SshServerConfig;
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum ConfigError {
Syntax {
line: usize,
msg: String,
},
UnknownKeyword {
line: usize,
keyword: String,
},
BadValue {
line: usize,
keyword: String,
msg: String,
},
Unsupported {
line: usize,
msg: String,
},
}
impl core::fmt::Display for ConfigError {
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
match self {
ConfigError::Syntax { line, msg } => {
write!(f, "config: line {line}: syntax: {msg}")
}
ConfigError::UnknownKeyword { line, keyword } => {
write!(f, "config: line {line}: unknown keyword: {keyword}")
}
ConfigError::BadValue { line, keyword, msg } => {
write!(f, "config: line {line}: bad value for {keyword}: {msg}")
}
ConfigError::Unsupported { line, msg } => {
write!(f, "config: line {line}: unsupported: {msg}")
}
}
}
}
#[cfg(feature = "std")]
impl std::error::Error for ConfigError {}