pub struct ProofOfWorkV1 {
nonce: Nonce,
effort: Effort,
seed_head: SeedHead,
solution: SolutionByteArray,
}Expand description
Proof of work using the v1 scheme
Specified as part of https://spec.torproject.org/rend-spec/introduction-protocol.html#INTRO1_POW_EXT
Fields§
§nonce: NonceNonce value chosen by the client
effort: EffortEffort chosen by the client
seed_head: SeedHeadHeader with which to identify the applicable service-provided seed
solution: SolutionByteArrayProposed solution proof, not validated
This byte array still needs to be validated first as a well-formed Equix solution, and then as a proof for a particular puzzle.
Implementations§
Source§impl ProofOfWorkV1
impl ProofOfWorkV1
pub const fn new( nonce: Nonce, effort: Effort, seed_head: SeedHead, solution: SolutionByteArray, ) -> ProofOfWorkV1
Source§impl ProofOfWorkV1
impl ProofOfWorkV1
Sourcepub fn nonce(&self) -> &Nonce
pub fn nonce(&self) -> &Nonce
Method borrowing ProofOfWorkV1::nonce field.
Nonce value chosen by the client
Sourcepub fn effort(&self) -> Effort
pub fn effort(&self) -> Effort
Method returning copy of ProofOfWorkV1::effort field.
Effort chosen by the client
Sourcepub fn seed_head(&self) -> SeedHead
pub fn seed_head(&self) -> SeedHead
Method returning copy of ProofOfWorkV1::seed_head field.
Header with which to identify the applicable service-provided seed
Sourcepub fn solution(&self) -> &SolutionByteArray
pub fn solution(&self) -> &SolutionByteArray
Method borrowing ProofOfWorkV1::solution field.
Proposed solution proof, not validated
Source§impl ProofOfWorkV1
impl ProofOfWorkV1
Sourcepub(super) fn try_take_body_from(
scheme: u8,
b: &mut Reader<'_>,
) -> Result<Option<Self>>
pub(super) fn try_take_body_from( scheme: u8, b: &mut Reader<'_>, ) -> Result<Option<Self>>
Construct by reading the scheme-specific data, if the scheme ID is correct for ProofOfWorkV1
Sourcepub(super) fn write_onto<B: Writer + ?Sized>(
&self,
b: &mut B,
) -> EncodeResult<()>
pub(super) fn write_onto<B: Writer + ?Sized>( &self, b: &mut B, ) -> EncodeResult<()>
Write the scheme and scheme-specific portion the v1 Proof Of Work
Trait Implementations§
Source§impl Clone for ProofOfWorkV1
impl Clone for ProofOfWorkV1
Source§fn clone(&self) -> ProofOfWorkV1
fn clone(&self) -> ProofOfWorkV1
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 ProofOfWorkV1
impl Debug for ProofOfWorkV1
Source§impl PartialEq for ProofOfWorkV1
impl PartialEq for ProofOfWorkV1
Source§fn eq(&self, other: &ProofOfWorkV1) -> bool
fn eq(&self, other: &ProofOfWorkV1) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for ProofOfWorkV1
Auto Trait Implementations§
impl Freeze for ProofOfWorkV1
impl RefUnwindSafe for ProofOfWorkV1
impl Send for ProofOfWorkV1
impl Sync for ProofOfWorkV1
impl Unpin for ProofOfWorkV1
impl UnsafeUnpin for ProofOfWorkV1
impl UnwindSafe for ProofOfWorkV1
Blanket Implementations§
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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§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.Source§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.Source§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.Source§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.Source§impl<T> DowncastSend for T
impl<T> DowncastSend for T
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for 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