pub struct Config {
pub server: Option<Server>,
pub client: Option<Client>,
pub remarks: Option<String>,
pub method: Option<String>,
pub password: Option<String>,
pub tunnel_path: TunnelPath,
pub test_timeout_secs: Option<u64>,
pub is_server: bool,
}Fields§
§server: Option<Server>§client: Option<Client>§remarks: Option<String>§method: Option<String>§password: Option<String>§tunnel_path: TunnelPath§test_timeout_secs: Option<u64>§is_server: boolImplementations§
Source§impl Config
impl Config
pub fn certificate_content(&self) -> Option<String>
pub fn export_certificate<P: AsRef<Path>>(&self, path: P) -> Result<()>
pub fn manage_clients(&self) -> bool
pub fn webapi_url(&self) -> Option<String>
pub fn webapi_token(&self) -> Option<String>
pub fn node_id(&self) -> Option<usize>
pub fn api_update_interval_secs(&self) -> Option<u64>
pub fn exist_server(&self) -> bool
pub fn exist_client(&self) -> bool
pub fn forward_addr(&self) -> Option<String>
pub fn listen_addr(&self) -> Result<SocketAddr>
pub fn set_listen_addr(&mut self, addr: SocketAddr)
pub fn disable_tls(&self) -> bool
pub fn dangerous_mode(&self) -> bool
pub fn set_dangerous_mode(&mut self, dangerous_mode: bool)
pub fn cache_dns(&self) -> bool
pub fn set_cache_dns(&mut self, cache_dns: bool)
pub fn check_correctness(&mut self, is_server: bool) -> Result<()>
Sourcepub fn from_config_file<P: AsRef<Path>>(path: P) -> Result<Self>
pub fn from_config_file<P: AsRef<Path>>(path: P) -> Result<Self>
load from overtls config file
Sourcepub fn from_json_str(json: &str) -> Result<Self>
pub fn from_json_str(json: &str) -> Result<Self>
load from JSON string
Sourcepub fn from_ssr_url(url: &str) -> Result<Self>
pub fn from_ssr_url(url: &str) -> Result<Self>
load from ssr://... style url
pub fn generate_ssr_url(&self) -> Result<String>
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for Config
impl StructuralPartialEq for Config
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnwindSafe for Config
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more