[][src]Struct shadowsocks::config::ServerConfig

pub struct ServerConfig { /* fields omitted */ }

Configuration for a server

Implementations

impl ServerConfig[src]

pub fn new(
    addr: ServerAddr,
    pwd: String,
    method: CipherType,
    timeout: Option<Duration>,
    plugin: Option<PluginConfig>
) -> ServerConfig
[src]

Creates a new ServerConfig

pub fn basic(
    addr: SocketAddr,
    password: String,
    method: CipherType
) -> ServerConfig
[src]

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 clone_key(&self) -> Bytes[src]

Clone 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 set_plugin_addr(&mut self, a: ServerAddr)[src]

Set plugin address

pub fn plugin_addr(&self) -> Option<&ServerAddr>[src]

Get plugin address

pub fn external_addr(&self) -> &ServerAddr[src]

Get server's external 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]

impl Debug for ServerConfig[src]

impl FromStr for ServerConfig[src]

type Err = UrlParseError

The associated error which can be returned from parsing.

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T[src]

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,