pub struct Proxy {
pub url: String,
pub proxy_type: ProxyType,
pub username: Option<String>,
pub password: Option<String>,
pub weight: u32,
pub tags: Vec<String>,
}Expand description
A proxy endpoint with optional authentication credentials.
Debug output masks password to prevent accidental credential logging.
§Example
use stygian_proxy::types::{Proxy, ProxyType};
let p = Proxy {
url: "http://proxy.example.com:8080".into(),
proxy_type: ProxyType::Http,
username: Some("alice".into()),
password: Some("secret".into()),
weight: 1,
tags: vec!["prod".into()],
};
let debug = format!("{p:?}");
assert!(debug.contains("***"), "password must be masked in Debug output");Fields§
§url: StringThe proxy URL, e.g. http://proxy.example.com:8080.
proxy_type: ProxyType§username: Option<String>§password: Option<String>§weight: u32Relative selection weight for weighted rotation (default: 1).
User-defined tags for filtering and grouping.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Proxy
impl<'de> Deserialize<'de> for Proxy
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 Freeze for Proxy
impl RefUnwindSafe for Proxy
impl Send for Proxy
impl Sync for Proxy
impl Unpin for Proxy
impl UnsafeUnpin for Proxy
impl UnwindSafe for Proxy
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