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

pub struct ServerConfig { /* fields omitted */ }

Configuration for a server

Implementations

impl ServerConfig[src]

pub fn new<A, P>(addr: A, password: P, method: CipherKind) -> ServerConfig where
    A: Into<ServerAddr>,
    P: Into<String>, 
[src]

Create a new ServerConfig

pub fn set_method<P>(&mut self, method: CipherKind, password: P) where
    P: Into<String>, 
[src]

Set encryption method

pub fn set_plugin(&mut self, p: PluginConfig)[src]

Set plugin

pub fn set_addr<A>(&mut self, a: A) where
    A: Into<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) -> CipherKind[src]

Get method

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 set_timeout(&mut self, timeout: Duration)[src]

Set timeout

pub fn timeout(&self) -> Option<Duration>[src]

Timeout

pub fn remarks(&self) -> Option<&str>[src]

Get server’s remark

pub fn set_remarks<S>(&mut self, remarks: S) where
    S: Into<String>, 
[src]

Set server’s remark

pub fn id(&self) -> Option<&str>[src]

Get server’s ID (SIP008)

pub fn set_id<S>(&mut self, id: S) where
    S: Into<String>, 
[src]

Set server’s ID (SIP008)

pub fn mode(&self) -> Mode[src]

Get server’s Mode

pub fn set_mode(&mut self, mode: Mode)[src]

Set server’s Mode

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

pub fn is_basic(&self) -> bool[src]

Check if it is a basic format server

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> Any for T where
    T: Any

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

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

impl<T> CloneAny for T where
    T: Any + Clone

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

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

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>,