Struct tor_relay_selection::RelayUsage
source · 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.
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§
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)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