pub struct Proxy { /* private fields */ }Expand description
Proxy configuration for an outgoing HTTP / WebSocket request.
Proxy is a value type with no Arc<RwLock> wrapping — exactly like
hyperlane-core’s plain fields. Construct one with the convenience
constructors below, then pass to RequestBuilder::proxy(...) or assign
directly to RequestConfig::proxy.
§Examples
use http_request::{Proxy, ProxyType};
let https = Proxy::https("proxy.example.com", 7890);
assert_eq!(https.get_proxy_type(), &ProxyType::Https);
assert_eq!(https.get_port(), 7890);
let socks = Proxy::socks5("127.0.0.1", 1080).auth("example-user", "example-password");
assert_eq!(socks.get_proxy_type(), &ProxyType::Socks5);
assert_eq!(socks.get_username(), Some("example-user".to_string()));Implementations§
Source§impl Proxy
Inherent implementation of Proxy.
impl Proxy
Inherent implementation of Proxy.
Source§impl Proxy
impl Proxy
pub fn get_proxy_type(&self) -> &ProxyType
pub fn get_mut_proxy_type(&mut self) -> &mut ProxyType
pub fn set_proxy_type(&mut self, val: ProxyType) -> &mut Self
pub fn get_host(&self) -> &String
pub fn get_mut_host(&mut self) -> &mut String
pub fn set_host(&mut self, val: String) -> &mut Self
pub fn get_port(&self) -> u16
pub fn get_mut_port(&mut self) -> &mut u16
pub fn set_port(&mut self, val: u16) -> &mut Self
pub fn get_username(&self) -> Option<String>
pub fn try_get_username(&self) -> Option<String>
pub fn get_mut_username(&mut self) -> &mut Option<String>
pub fn set_username(&mut self, val: Option<String>) -> &mut Self
pub fn get_password(&self) -> Option<String>
pub fn try_get_password(&self) -> Option<String>
pub fn get_mut_password(&mut self) -> &mut Option<String>
pub fn set_password(&mut self, val: Option<String>) -> &mut Self
Trait Implementations§
impl Eq for Proxy
impl StructuralPartialEq for Proxy
Auto Trait Implementations§
impl Forget for Proxy
impl Freeze for Proxy
impl Move for Proxy
impl RefUnwindSafe for Proxy
impl Send for Proxywhere
RawVecInner: Send,
impl Sync for Proxywhere
RawVecInner: Sync,
impl Unpin for Proxy
impl UnsafeUnpin for Proxy
impl UnwindSafe for Proxywhere
RawVecInner: UnwindSafe,
Blanket Implementations§
impl<T> AnySend for T
impl<T> AnySendClone for T
impl<T> AnySendSync for T
impl<T> AnySendSyncClone for T
impl<T> AnySync for T
impl<T> AnySyncClone for T
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.