pub struct ProxyFullData {
pub id: u64,
pub proxy_type: ProxyType,
pub host: String,
pub login: Option<String>,
pub password: Option<String>,
pub port: String,
pub change_ip_url: Option<String>,
}Expand description
Represents the complete proxy configuration data with decrypted sensitive fields
This struct contains all the necessary information to configure a proxy connection, including optional authentication credentials and IP change functionality.
Fields§
§id: u64Unique identifier for the proxy configuration
proxy_type: ProxyTypeType of proxy (e.g. HTTP, SOCKS5)
host: StringHostname or IP address of the proxy server
login: Option<String>Optional username for proxy authentication
password: Option<String>Optional password for proxy authentication
port: StringPort number that the proxy server listens on
change_ip_url: Option<String>Optional URL endpoint for triggering IP address rotation
Implementations§
source§impl ProxyFullData
impl ProxyFullData
sourcepub async fn new(
proxy: Proxy,
database_encryption: Arc<dyn DatabaseEncryptionTrait + Send + Sync>,
) -> AppResult<Self>
pub async fn new( proxy: Proxy, database_encryption: Arc<dyn DatabaseEncryptionTrait + Send + Sync>, ) -> AppResult<Self>
Creates a new ProxyFullData instance from an encrypted Proxy record
§Arguments
proxy- The encrypted proxy record from the databasedatabase_encryption- Service for decrypting sensitive proxy data
§Returns
Returns AppResult<Self> which is Ok if all decryption operations succeed
§Errors
Returns an error if:
- Encrypted data cannot be decoded as UTF-8
- Decryption operations fail
- Required fields are missing or invalid
sourcefn as_url(&self) -> String
fn as_url(&self) -> String
Formats the proxy configuration as a standard proxy URL string
Generates a URL in the format: protocol://[user[:pass]@]host:port
where the authentication part is included only if credentials are present
§Returns
Returns a String containing the formatted proxy URL
sourcepub fn as_base64_url(&self) -> String
pub fn as_base64_url(&self) -> String
Formats the proxy configuration as a URL with base64-encoded credentials
Similar to as_url(), but when both login and password are present,
they are combined and base64-encoded in the format:
protocol://base64_encoded_creds:base64@host:port
§Returns
Returns a String containing the proxy URL with base64-encoded credentials if applicable, otherwise returns a standard proxy URL
Trait Implementations§
source§impl Clone for ProxyFullData
impl Clone for ProxyFullData
source§fn clone(&self) -> ProxyFullData
fn clone(&self) -> ProxyFullData
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moresource§impl Debug for ProxyFullData
impl Debug for ProxyFullData
source§impl From<ProxyFullData> for ProxyData
impl From<ProxyFullData> for ProxyData
source§fn from(proxy: ProxyFullData) -> Self
fn from(proxy: ProxyFullData) -> Self
Auto Trait Implementations§
impl Freeze for ProxyFullData
impl RefUnwindSafe for ProxyFullData
impl Send for ProxyFullData
impl Sync for ProxyFullData
impl Unpin for ProxyFullData
impl UnwindSafe for ProxyFullData
Blanket Implementations§
§impl<T> AnySync for T
impl<T> AnySync for T
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit)§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
source§impl<T> IntoEither for T
impl<T> IntoEither for T
source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moresource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more