Struct shadowsocks::config::ServerConfig [−][src]
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]
A: Into<ServerAddr>,
P: Into<String>,
Create a new ServerConfig
pub fn set_method<P>(&mut self, method: CipherKind, password: P) where
P: Into<String>,
[src]
P: Into<String>,
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]
A: Into<ServerAddr>,
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]
S: Into<String>,
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]
S: Into<String>,
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]
fn clone(&self) -> ServerConfig
[src]
pub fn clone_from(&mut self, source: &Self)
1.0.0[src]
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 RefUnwindSafe for ServerConfig
impl Send for ServerConfig
impl Sync for ServerConfig
impl Unpin for ServerConfig
impl UnwindSafe for ServerConfig
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Any for T where
T: Any,
T: Any,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> CloneAny for T where
T: Any + Clone,
T: Any + Clone,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,