[−][src]Struct shadowsocks::config::ServerConfig
Configuration for a server
Methods
impl ServerConfig[src]
pub fn new(
addr: ServerAddr,
pwd: String,
method: CipherType,
timeout: Option<Duration>,
plugin: Option<PluginConfig>
) -> ServerConfig[src]
addr: ServerAddr,
pwd: String,
method: CipherType,
timeout: Option<Duration>,
plugin: Option<PluginConfig>
) -> ServerConfig
Creates a new ServerConfig
pub fn basic(
addr: SocketAddr,
password: String,
method: CipherType
) -> ServerConfig[src]
addr: SocketAddr,
password: String,
method: CipherType
) -> ServerConfig
Create a basic config
pub fn set_method(&mut self, t: CipherType, pwd: String)[src]
Set encryption method
pub fn set_plugin(&mut self, p: PluginConfig)[src]
Set plugin
pub fn set_addr(&mut self, a: ServerAddr)[src]
Set server addr
pub fn addr(&self) -> &ServerAddr[src]
Get server address
pub fn key(&self) -> &[u8][src]
Get encryption key
pub fn password(&self) -> &str[src]
Get password
pub fn method(&self) -> CipherType[src]
Get method
pub fn timeout(&self) -> Option<Duration>[src]
Get timeout
pub fn plugin(&self) -> Option<&PluginConfig>[src]
Get plugin
pub fn udp_timeout(&self) -> &Option<Duration>[src]
Get UDP timeout
pub fn set_plugin_addr(&mut self, a: ServerAddr)[src]
Set plugin address
pub fn plugin_addr(&self) -> &Option<ServerAddr>[src]
Get plugin address
pub fn to_qrcode_url(&self) -> String[src]
Get URL for QRCode
ss:// + base64(method:password@host:port)
pub fn to_url(&self) -> String[src]
Get SIP002 URL
pub fn from_url(encoded: &str) -> Result<ServerConfig, UrlParseError>[src]
Parse from SIP002 URL
Trait Implementations
impl Clone for ServerConfig[src]
fn clone(&self) -> ServerConfig[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more
impl Debug for ServerConfig[src]
impl FromStr for ServerConfig[src]
type Err = UrlParseError
The associated error which can be returned from parsing.
fn from_str(s: &str) -> Result<ServerConfig, Self::Err>[src]
Auto Trait Implementations
impl Send for ServerConfig
impl Sync for ServerConfig
Blanket Implementations
impl<T> From for T[src]
impl<T, U> Into for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
impl<T, U> TryFrom for T where
U: Into<T>, [src]
U: Into<T>,
type Error = !
🔬 This is a nightly-only experimental API. (
try_from)The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T> Borrow for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T, U> TryInto for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
🔬 This is a nightly-only experimental API. (
try_from)The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>[src]
impl<T> Erased for T
impl<T> Same for T[src]
type Output = T
Should always be Self