pub struct OnionProxyConfig {
pub protocol: OnionProxyProtocol,
pub hop_count: usize,
pub allow_short_paths: bool,
/* private fields */
}Expand description
Target-agnostic onion proxy configuration.
A client owns one proxy configuration per ingress style, then resolves one route per target authority. This keeps browser proxy APIs from becoming one-off URL fetch wrappers.
Fields§
§protocol: OnionProxyProtocolRequested ingress protocol.
hop_count: usizeDesired hop count including the exit. 0 uses crate::onion::DEFAULT_ONION_ROUTE_HOPS.
allow_short_paths: boolWhether route selection may use fewer hops when too few relays are live.
Implementations§
Source§impl OnionProxyConfig
impl OnionProxyConfig
Sourcepub fn new(
protocol: OnionProxyProtocol,
hop_count: usize,
allow_short_paths: bool,
) -> Self
pub fn new( protocol: OnionProxyProtocol, hop_count: usize, allow_short_paths: bool, ) -> Self
Create a proxy configuration for protocol.
Sourcepub fn with_service(
protocol: OnionProxyProtocol,
service: OnionServiceName,
hop_count: usize,
allow_short_paths: bool,
) -> Result<Self>
pub fn with_service( protocol: OnionProxyProtocol, service: OnionServiceName, hop_count: usize, allow_short_paths: bool, ) -> Result<Self>
Create a proxy configuration with an explicit exit service.
Sourcepub fn tcp_connect(hop_count: usize, allow_short_paths: bool) -> Self
pub fn tcp_connect(hop_count: usize, allow_short_paths: bool) -> Self
Create a native TCP CONNECT proxy configuration.
Sourcepub fn tcp_connect_service(
service: OnionServiceName,
hop_count: usize,
allow_short_paths: bool,
) -> Result<Self>
pub fn tcp_connect_service( service: OnionServiceName, hop_count: usize, allow_short_paths: bool, ) -> Result<Self>
Create a native TCP CONNECT proxy configuration for a specific TCP exit service.
Sourcepub fn https_proxy(hop_count: usize, allow_short_paths: bool) -> Self
pub fn https_proxy(hop_count: usize, allow_short_paths: bool) -> Self
Create an HTTPS proxy configuration.
Sourcepub fn exit_service(&self) -> &str
pub fn exit_service(&self) -> &str
Return the onion-exit service name required by this proxy.
Sourcepub fn exit_service_name(&self) -> &OnionServiceName
pub fn exit_service_name(&self) -> &OnionServiceName
Return the canonical onion-exit service required by this proxy.
Sourcepub fn exit_transport(&self) -> OnionExitTransport
pub fn exit_transport(&self) -> OnionExitTransport
Return the onion-exit transport required by this proxy.
Trait Implementations§
Source§impl Clone for OnionProxyConfig
impl Clone for OnionProxyConfig
Source§fn clone(&self) -> OnionProxyConfig
fn clone(&self) -> OnionProxyConfig
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for OnionProxyConfig
impl Debug for OnionProxyConfig
impl Eq for OnionProxyConfig
Source§impl PartialEq for OnionProxyConfig
impl PartialEq for OnionProxyConfig
impl StructuralPartialEq for OnionProxyConfig
Auto Trait Implementations§
impl Freeze for OnionProxyConfig
impl RefUnwindSafe for OnionProxyConfig
impl Send for OnionProxyConfig
impl Sync for OnionProxyConfig
impl Unpin for OnionProxyConfig
impl UnsafeUnpin for OnionProxyConfig
impl UnwindSafe for OnionProxyConfig
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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§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§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
key and return true if they are equal.impl<T> ErasedDestructor for Twhere
T: 'static,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
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 moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
impl<T> MaybeSend for T
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.