aboutsummaryrefslogtreecommitdiff
path: root/crates/tor-netdoc/src/doc/hsdesc/pow/v1_stub.rs
blob: f1b1f74d897cce4441cbe29c5654e165d97be692 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
//! Stub; `v1` proof of work scheme has been disabled at compile time

use crate::Result;
use crate::doc::hsdesc::inner::HsInnerKwd;
use crate::parse::tokenize::Item;

/// Marker for a `pow-params v1` line which was not parsed
///
/// If are missing the `hs-pow-full` crate feature, we will not parse
/// `pow-params v1` but we will remember that one exists. Clients will see
/// that a pow scheme is available which might work if the software were
/// compiled differently.
///
#[derive(Debug, Clone)]
#[non_exhaustive]
pub struct PowParamsV1;

impl PowParamsV1 {
    /// Accept any Item as a 'PowParamsV1' without actually parsing it
    ///
    #[allow(clippy::unnecessary_wraps)]
    pub(super) fn from_item(_item: &Item<'_, HsInnerKwd>) -> Result<Self> {
        Ok(Self)
    }
}