Struct wmproxy::ConfigOption
source · pub struct ConfigOption {
pub pidfile: String,
/* private fields */
}
Expand description
代理类, 一个代理类启动一种类型的代理
Fields§
§pidfile: String
Implementations§
source§impl ConfigOption
impl ConfigOption
sourcepub fn new_by_proxy(proxy: ProxyConfig) -> Self
pub fn new_by_proxy(proxy: ProxyConfig) -> Self
Examples found in repository?
examples/proxy.rs (line 29)
26 27 28 29 30 31 32 33 34 35 36 37 38
async fn run_proxy(
proxy: ProxyConfig,
) -> ProxyResult<(SocketAddr, Sender<()>)> {
let option = ConfigOption::new_by_proxy(proxy);
let (sender_close, receiver_close) = channel::<()>(1);
let mut proxy = WMCore::new(option);
proxy.ready_serve().await.unwrap();
let addr = proxy.center_listener.as_ref().unwrap().local_addr()?;
tokio::spawn(async move {
let _ = proxy.run_serve(receiver_close, None).await;
});
Ok((addr, sender_close))
}
pub fn is_empty_listen(&self) -> bool
pub fn after_load_option(&mut self) -> ProxyResult<()>
sourcepub fn get_health_check(&self) -> Vec<OneHealth>
pub fn get_health_check(&self) -> Vec<OneHealth>
获取所有待健康检查的列表
pub fn get_log_names(&self) -> HashMap<String, String>
Trait Implementations§
source§impl Clone for ConfigOption
impl Clone for ConfigOption
source§fn clone(&self) -> ConfigOption
fn clone(&self) -> ConfigOption
Returns a copy 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 moresource§impl Debug for ConfigOption
impl Debug for ConfigOption
source§impl Default for ConfigOption
impl Default for ConfigOption
source§impl<'de> Deserialize<'de> for ConfigOption
impl<'de> Deserialize<'de> for ConfigOption
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl RefUnwindSafe for ConfigOption
impl Send for ConfigOption
impl Sync for ConfigOption
impl Unpin for ConfigOption
impl UnwindSafe for ConfigOption
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