pub struct SubscriptionClientBuilder { /* private fields */ }Expand description
Builder for a public standalone SubscriptionClient.
Implementations§
Source§impl SubscriptionClientBuilder
impl SubscriptionClientBuilder
Sourcepub fn raw_path(self, path: impl Into<String>) -> Self
pub fn raw_path(self, path: impl Into<String>) -> Self
Sets the configured raw subscription path (default /sub/).
Sourcepub fn json_path(self, path: impl Into<String>) -> Self
pub fn json_path(self, path: impl Into<String>) -> Self
Sets the configured JSON subscription path (default /json/).
Sourcepub fn clash_path(self, path: impl Into<String>) -> Self
pub fn clash_path(self, path: impl Into<String>) -> Self
Sets the configured Clash subscription path (default /clash/).
Sourcepub const fn timeout(self, timeout: Duration) -> Self
pub const fn timeout(self, timeout: Duration) -> Self
Sets the total timeout for one subscription request.
Sourcepub const fn connect_timeout(self, timeout: Duration) -> Self
pub const fn connect_timeout(self, timeout: Duration) -> Self
Sets the timeout for establishing a connection.
Sourcepub const fn danger_accept_invalid_certs(self, accept: bool) -> Self
pub const fn danger_accept_invalid_certs(self, accept: bool) -> Self
Accepts invalid TLS certificates for this subscription server.
This weakens transport security for credential-bearing documents and should only be used with an explicitly trusted self-signed deployment.
Sourcepub fn proxy(self, proxy: ProxyConfig) -> Self
pub fn proxy(self, proxy: ProxyConfig) -> Self
Routes subscription HTTP requests through an explicit proxy.
Environment proxy variables are never consulted.
Sourcepub fn proxy_url(self, proxy_url: impl AsRef<str>) -> Result<Self>
pub fn proxy_url(self, proxy_url: impl AsRef<str>) -> Result<Self>
Parses and configures a credential-free proxy URL.
§Errors
Returns Error::Configuration for an invalid proxy URL.
Sourcepub const fn response_body_limit(self, limit: usize) -> Self
pub const fn response_body_limit(self, limit: usize) -> Self
Sets the maximum in-memory size of a subscription response body.
Both declared Content-Length and actually received chunked or
decompressed bytes are checked.
Sourcepub fn device(self, device: SubscriptionDevice) -> Self
pub fn device(self, device: SubscriptionDevice) -> Self
Sends subscription-device headers used by 3x-ui’s optional HWID gate.
Sourcepub fn build(self) -> Result<SubscriptionClient>
pub fn build(self) -> Result<SubscriptionClient>
Builds the standalone client.
§Errors
Returns an error when a configured path or HTTP-client option is invalid.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for SubscriptionClientBuilder
impl RefUnwindSafe for SubscriptionClientBuilder
impl Send for SubscriptionClientBuilder
impl Sync for SubscriptionClientBuilder
impl Unpin for SubscriptionClientBuilder
impl UnsafeUnpin for SubscriptionClientBuilder
impl UnwindSafe for SubscriptionClientBuilder
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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