pub struct RelayUsage { /* private fields */ }
Expand description
Description for how we plan to use a single relay.
Implementations§
Source§impl RelayUsage
impl RelayUsage
Sourcepub fn any_exit(_cfg: &RelaySelectionConfig<'_>) -> Self
pub fn any_exit(_cfg: &RelaySelectionConfig<'_>) -> Self
Require a relay that exits to at least one port.
This usage is generally suitable as the final relay for a testing circuit of some kind, or for a circuit that needs to look like an exit circuit without actually being useful for any exit in particular.
Sourcepub fn exit_to_all_ports(
cfg: &RelaySelectionConfig<'_>,
ports: Vec<TargetPort>,
) -> Self
pub fn exit_to_all_ports( cfg: &RelaySelectionConfig<'_>, ports: Vec<TargetPort>, ) -> Self
Require a relay that exits to every port in a given list.
Sourcepub fn exit_to_any_port(
cfg: &RelaySelectionConfig<'_>,
ports: Vec<TargetPort>,
) -> Self
pub fn exit_to_any_port( cfg: &RelaySelectionConfig<'_>, ports: Vec<TargetPort>, ) -> Self
Require a relay that exits to at least one port in a given list.
Sourcepub fn middle_relay(known_final_hop_usage: Option<&RelayUsage>) -> Self
pub fn middle_relay(known_final_hop_usage: Option<&RelayUsage>) -> Self
Require a relay that is suitable for a middle relay.
If known_final_hop_usage
is provided, then the middle relay must support any
additional properties needed in order to build a circuit for the usage
of the final hop.
If known_final_hop_usage
is not provided, then the middle relay must
support all possible such additional properties.
(Note that providing a known_final_hop_usage
can only weaken the
requirements of this usage.)
Sourcepub fn new_intro_point() -> Self
pub fn new_intro_point() -> Self
Require a relay that is suitable as a newly selected introduction point.
This usage is suitable for selecting new introduction points for an
onion service. When deciding whether to keep an introduction point,
use RelayUsage::continuing_intro_point
.
Sourcepub fn continuing_intro_point() -> Self
pub fn continuing_intro_point() -> Self
Require a relay that is suitable to keep using as a pre-existing introduction point.
Sourcepub fn new_guard() -> Self
pub fn new_guard() -> Self
Require a relay that is suitable as a newly selected guard.
This usage is suitable for selecting new guards.
When deciding whether to keep a guard,
use RelayUsage::continuing_guard
.
Sourcepub fn continuing_guard() -> Self
pub fn continuing_guard() -> Self
Require a relay that is suitable to keep using as a pre-existing guard.
Sourcepub fn vanguard() -> Self
Available on crate feature vanguards
only.
pub fn vanguard() -> Self
vanguards
only.Require a relay that is suitable as a vanguard.
Sourcepub fn directory_cache() -> Self
pub fn directory_cache() -> Self
Require a relay that is suitable to use for a directory request.
Note that this usage is suitable for fetching consensuses, authority certificates, descriptors and microdescriptors. It is not suitable for use with the HsDir system.
Sourcepub fn new_rend_point() -> Self
pub fn new_rend_point() -> Self
Require a relay that is suitable as a newly selected rendezvous point (as chosen by a client to connect to an onion service).
Trait Implementations§
Source§impl Clone for RelayUsage
impl Clone for RelayUsage
Source§fn clone(&self) -> RelayUsage
fn clone(&self) -> RelayUsage
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for RelayUsage
impl Debug for RelayUsage
Source§impl LowLevelRelayPredicate for RelayUsage
impl LowLevelRelayPredicate for RelayUsage
Source§fn low_level_predicate_permits_relay(&self, relay_in: &Relay<'_>) -> bool
fn low_level_predicate_permits_relay(&self, relay_in: &Relay<'_>) -> bool
relay
provides this predicate.Auto Trait Implementations§
impl Freeze for RelayUsage
impl RefUnwindSafe for RelayUsage
impl Send for RelayUsage
impl Sync for RelayUsage
impl Unpin for RelayUsage
impl UnwindSafe for RelayUsage
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§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,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait>
(where Trait: Downcast
) to Box<dyn Any>
, which can then be
downcast
into Box<dyn ConcreteType>
where ConcreteType
implements Trait
.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait>
(where Trait: Downcast
) to Rc<Any>
, which can then be further
downcast
into Rc<ConcreteType>
where ConcreteType
implements Trait
.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &Any
’s vtable from &Trait
’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait
(where Trait: Downcast
) to &Any
. This is needed since Rust cannot
generate &mut Any
’s vtable from &mut Trait
’s.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§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