Struct tor_netdir::HsDirParams
source · pub struct HsDirParams { /* private fields */ }
hs-common
only.Expand description
Parameters for generating and using an HsDir ring.
These parameters are derived from the shared random values and time parameters in the consensus, and are used to determine the position of each HsDir within the ring.
Implementations§
source§impl HsDirParams
impl HsDirParams
sourcepub fn time_period(&self) -> TimePeriod
pub fn time_period(&self) -> TimePeriod
Return the time period for which these parameters are valid.
The hs_blind_id
for an onion service changes every time period: when
uploading, callers should use this time period to determine which
hs_blind_id
’s descriptor should be sent to which directory.
sourcepub fn start_of_shard_rand_period(&self) -> SystemTime
pub fn start_of_shard_rand_period(&self) -> SystemTime
Return the starting time for the shared-random-value protocol that produced the SRV for this time period.
sourcepub fn offset_within_srv_period(
&self,
when: SystemTime
) -> Option<SrvPeriodOffset>
Available on crate feature hs-service
only.
pub fn offset_within_srv_period( &self, when: SystemTime ) -> Option<SrvPeriodOffset>
hs-service
only.Return an opaque offset for when
from the start of the shared-random-value protocol
period corresponding to the SRV for this time period.
When uploading, callers should this offset to determine the revision counter for their descriptors.
Returns None
if when is after the start of the SRV period.
Trait Implementations§
source§impl Clone for HsDirParams
impl Clone for HsDirParams
source§fn clone(&self) -> HsDirParams
fn clone(&self) -> HsDirParams
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for HsDirParams
impl Debug for HsDirParams
source§impl PartialEq for HsDirParams
impl PartialEq for HsDirParams
source§fn eq(&self, other: &HsDirParams) -> bool
fn eq(&self, other: &HsDirParams) -> bool
self
and other
values to be equal, and is used
by ==
.impl Eq for HsDirParams
impl StructuralPartialEq for HsDirParams
Auto Trait Implementations§
impl Freeze for HsDirParams
impl RefUnwindSafe for HsDirParams
impl Send for HsDirParams
impl Sync for HsDirParams
impl Unpin for HsDirParams
impl UnwindSafe for HsDirParams
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
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.§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