pub struct ServiceContext { /* private fields */ }Expand description
Local Service Context
Implementations§
Source§impl ServiceContext
impl ServiceContext
Sourcepub fn context(&self) -> SharedContext
pub fn context(&self) -> SharedContext
Get cloned shadowsocks Context
Sourcepub fn context_ref(&self) -> &Context
pub fn context_ref(&self) -> &Context
Get shadowsocks Context reference
Sourcepub fn set_connect_opts(&mut self, connect_opts: ConnectOpts)
pub fn set_connect_opts(&mut self, connect_opts: ConnectOpts)
Set ConnectOpts
Sourcepub fn connect_opts_ref(&self) -> &ConnectOpts
pub fn connect_opts_ref(&self) -> &ConnectOpts
Get ConnectOpts reference
Sourcepub fn set_accept_opts(&mut self, accept_opts: AcceptOpts)
pub fn set_accept_opts(&mut self, accept_opts: AcceptOpts)
Set AcceptOpts
Sourcepub fn accept_opts(&self) -> AcceptOpts
pub fn accept_opts(&self) -> AcceptOpts
Get AcceptOpts cloned
Sourcepub fn set_acl(&mut self, acl: Arc<AccessControl>)
pub fn set_acl(&mut self, acl: Arc<AccessControl>)
Set Access Control List
Sourcepub fn acl(&self) -> Option<&AccessControl>
pub fn acl(&self) -> Option<&AccessControl>
Get Access Control List reference
Sourcepub fn flow_stat_ref(&self) -> &FlowStat
pub fn flow_stat_ref(&self) -> &FlowStat
Get flow statistic reference
Sourcepub fn set_dns_resolver(&mut self, resolver: Arc<DnsResolver>)
pub fn set_dns_resolver(&mut self, resolver: Arc<DnsResolver>)
Set customized DNS resolver
Sourcepub fn dns_resolver(&self) -> &DnsResolver
pub fn dns_resolver(&self) -> &DnsResolver
Get reference of DNS resolver
Sourcepub async fn check_target_bypassed(&self, addr: &Address) -> bool
pub async fn check_target_bypassed(&self, addr: &Address) -> bool
Check if target should be bypassed
Sourcepub async fn add_to_reverse_lookup_cache(&self, addr: IpAddr, forward: bool)
pub async fn add_to_reverse_lookup_cache(&self, addr: IpAddr, forward: bool)
Add a record to the reverse lookup cache
Sourcepub fn set_ipv6_first(&mut self, ipv6_first: bool)
pub fn set_ipv6_first(&mut self, ipv6_first: bool)
Try to connect IPv6 addresses first if hostname could be resolved to both IPv4 and IPv6
Sourcepub fn set_security_config(&mut self, security: &SecurityConfig)
pub fn set_security_config(&mut self, security: &SecurityConfig)
Set security config
Trait Implementations§
Source§impl Clone for ServiceContext
impl Clone for ServiceContext
Source§fn clone(&self) -> ServiceContext
fn clone(&self) -> ServiceContext
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreAuto Trait Implementations§
impl Freeze for ServiceContext
impl !RefUnwindSafe for ServiceContext
impl Send for ServiceContext
impl Sync for ServiceContext
impl Unpin for ServiceContext
impl !UnwindSafe for ServiceContext
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