tor_netdoc/doc/hsdesc/pow/
v1_stub.rs

1//! Stub; `v1` proof of work scheme has been disabled at compile time
2
3use crate::doc::hsdesc::inner::HsInnerKwd;
4use crate::parse::tokenize::Item;
5use crate::Result;
6
7/// Marker for a `pow-params v1` line which was not parsed
8///
9/// If are missing the `hs-pow-full` crate feature, we will not parse
10/// `pow-params v1` but we will remember that one exists. Clients will see
11/// that a pow scheme is available which might work if the software were
12/// compiled differently.
13///
14#[derive(Debug, Clone)]
15#[non_exhaustive]
16pub struct PowParamsV1;
17
18impl PowParamsV1 {
19    /// Accept any Item as a 'PowParamsV1' without actually parsing it
20    ///
21    #[allow(clippy::unnecessary_wraps)]
22    pub(super) fn from_item(_item: &Item<'_, HsInnerKwd>) -> Result<Self> {
23        Ok(Self)
24    }
25}