pub struct MTProxy {
pub host: String,
pub port: u32,
pub secret: String,
}
Expand description
Represents an MTProxy, a specific type of proxy.
Fields§
§host: String
The host address of the MTProxy.
port: u32
The port number for the MTProxy.
secret: String
The secret associated with the MTProxy.
Implementations§
Source§impl MTProxy
impl MTProxy
Sourcepub fn to_url(&self) -> String
pub fn to_url(&self) -> String
Converts the MTProxy information into a Telegram proxy URL.
§Example
use proxy_scraper::mtproxy::MTProxy;
let proxy = MTProxy {
host: "example.com".to_string(),
port: 443,
secret: "abcdef0123456789".to_string(),
};
let url = proxy.to_url();
assert_eq!(url, "https://t.me/proxy?server=example.com&port=443&secret=abcdef0123456789");
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MTProxy
impl RefUnwindSafe for MTProxy
impl Send for MTProxy
impl Sync for MTProxy
impl Unpin for MTProxy
impl UnwindSafe for MTProxy
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