Struct HsDescBuilder
pub(crate) struct HsDescBuilder<'a> {Show 14 fields
blinded_id: Option<&'a HsBlindIdKey>,
hs_desc_sign: Option<&'a Keypair>,
hs_desc_sign_cert: Option<EncodedEd25519Cert>,
create2_formats: Option<&'a [HandshakeType]>,
auth_required: Option<Option<SmallVec<[IntroAuthType; 2]>>>,
is_single_onion_service: Option<bool>,
intro_points: Option<&'a [IntroPointDesc]>,
intro_auth_key_cert_expiry: Option<SystemTime>,
intro_enc_key_cert_expiry: Option<SystemTime>,
pow_params: Option<Option<&'a PowParams>>,
auth_clients: Option<Option<&'a [PublicKey]>>,
lifetime: Option<IntegerMinutes<u16>>,
revision_counter: Option<RevisionCounter>,
subcredential: Option<Subcredential>,
}
Expand description
Builder for HsDesc
.
Fields§
§blinded_id: Option<&'a HsBlindIdKey>
§hs_desc_sign: Option<&'a Keypair>
§hs_desc_sign_cert: Option<EncodedEd25519Cert>
§create2_formats: Option<&'a [HandshakeType]>
§auth_required: Option<Option<SmallVec<[IntroAuthType; 2]>>>
§is_single_onion_service: Option<bool>
§intro_points: Option<&'a [IntroPointDesc]>
§intro_auth_key_cert_expiry: Option<SystemTime>
§intro_enc_key_cert_expiry: Option<SystemTime>
§pow_params: Option<Option<&'a PowParams>>
§auth_clients: Option<Option<&'a [PublicKey]>>
§lifetime: Option<IntegerMinutes<u16>>
§revision_counter: Option<RevisionCounter>
§subcredential: Option<Subcredential>
Implementations§
§impl<'a> HsDescBuilder<'a>
impl<'a> HsDescBuilder<'a>
pub fn blinded_id(self, value: &'a HsBlindIdKey) -> HsDescBuilder<'a>
pub fn blinded_id(self, value: &'a HsBlindIdKey) -> HsDescBuilder<'a>
The blinded hidden service public key used for the first half of the “SECRET_DATA” field.
(See rend-spec v3 2.5.1.1 and 2.5.2.1.)
pub fn hs_desc_sign(self, value: &'a Keypair) -> HsDescBuilder<'a>
pub fn hs_desc_sign(self, value: &'a Keypair) -> HsDescBuilder<'a>
The short-term descriptor signing key (KP_hs_desc_sign, KS_hs_desc_sign).
pub fn hs_desc_sign_cert(self, value: EncodedEd25519Cert) -> HsDescBuilder<'a>
pub fn hs_desc_sign_cert(self, value: EncodedEd25519Cert) -> HsDescBuilder<'a>
The descriptor signing key certificate.
This certificate can be created using create_desc_sign_key_cert
.
pub fn create2_formats(self, value: &'a [HandshakeType]) -> HsDescBuilder<'a>
pub fn create2_formats(self, value: &'a [HandshakeType]) -> HsDescBuilder<'a>
A list of recognized CREATE handshakes that this onion service supports.
pub fn auth_required(
self,
value: Option<SmallVec<[IntroAuthType; 2]>>,
) -> HsDescBuilder<'a>
pub fn auth_required( self, value: Option<SmallVec<[IntroAuthType; 2]>>, ) -> HsDescBuilder<'a>
A list of authentication types that this onion service supports.
pub fn is_single_onion_service(self, value: bool) -> HsDescBuilder<'a>
pub fn is_single_onion_service(self, value: bool) -> HsDescBuilder<'a>
If true, this a “single onion service” and is not trying to keep its own location private.
pub fn intro_points(self, value: &'a [IntroPointDesc]) -> HsDescBuilder<'a>
pub fn intro_points(self, value: &'a [IntroPointDesc]) -> HsDescBuilder<'a>
One or more introduction points used to contact the onion service.
pub fn intro_auth_key_cert_expiry(self, value: SystemTime) -> HsDescBuilder<'a>
pub fn intro_auth_key_cert_expiry(self, value: SystemTime) -> HsDescBuilder<'a>
The expiration time of an introduction point authentication key certificate.
pub fn intro_enc_key_cert_expiry(self, value: SystemTime) -> HsDescBuilder<'a>
pub fn intro_enc_key_cert_expiry(self, value: SystemTime) -> HsDescBuilder<'a>
The expiration time of an introduction point encryption key certificate.
pub fn pow_params(self, value: Option<&'a PowParams>) -> HsDescBuilder<'a>
pub fn pow_params(self, value: Option<&'a PowParams>) -> HsDescBuilder<'a>
Proof-of-work parameters.
pub fn auth_clients(self, value: Option<&'a [PublicKey]>) -> HsDescBuilder<'a>
pub fn auth_clients(self, value: Option<&'a [PublicKey]>) -> HsDescBuilder<'a>
The list of clients authorized to discover the hidden service.
If None
, restricted discovery is disabled.
If Some(&[])
, restricted discovery is enabled,
but there will be no authorized clients.
If restricted discovery is disabled, the resulting middle document will contain a single
auth-client
line populated with random values.
Restricted discovery is disabled by default.
pub fn lifetime(self, value: IntegerMinutes<u16>) -> HsDescBuilder<'a>
pub fn lifetime(self, value: IntegerMinutes<u16>) -> HsDescBuilder<'a>
The lifetime of this descriptor, in minutes.
This doesn’t actually list the starting time or the end time for the descriptor: presumably, because we didn’t want to leak the onion service’s view of the wallclock.
pub fn revision_counter(self, value: RevisionCounter) -> HsDescBuilder<'a>
pub fn revision_counter(self, value: RevisionCounter) -> HsDescBuilder<'a>
A revision counter to tell whether this descriptor is more or less recent than another one for the same blinded ID.
pub fn subcredential(self, value: Subcredential) -> HsDescBuilder<'a>
pub fn subcredential(self, value: Subcredential) -> HsDescBuilder<'a>
The “subcredential” of the onion service.
Trait Implementations§
§impl<'a> Clone for HsDescBuilder<'a>
impl<'a> Clone for HsDescBuilder<'a>
§fn clone(&self) -> HsDescBuilder<'a>
fn clone(&self) -> HsDescBuilder<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more§impl<'a> Debug for HsDescBuilder<'a>
impl<'a> Debug for HsDescBuilder<'a>
§impl<'a> Default for HsDescBuilder<'a>
impl<'a> Default for HsDescBuilder<'a>
§fn default() -> HsDescBuilder<'a>
fn default() -> HsDescBuilder<'a>
§impl<'a> NetdocBuilder for HsDescBuilder<'a>
impl<'a> NetdocBuilder for HsDescBuilder<'a>
Auto Trait Implementations§
impl<'a> Freeze for HsDescBuilder<'a>
impl<'a> RefUnwindSafe for HsDescBuilder<'a>
impl<'a> Send for HsDescBuilder<'a>
impl<'a> Sync for HsDescBuilder<'a>
impl<'a> Unpin for HsDescBuilder<'a>
impl<'a> UnwindSafe for HsDescBuilder<'a>
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§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,
§impl<T> Conv for T
impl<T> Conv for T
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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
.§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
.§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.§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.§impl<T> DowncastSend for T
impl<T> DowncastSend for T
§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<T> FmtForward for T
impl<T> FmtForward for T
§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self
to use its Binary
implementation when Debug
-formatted.§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self
to use its Display
implementation when
Debug
-formatted.§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self
to use its LowerExp
implementation when
Debug
-formatted.§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self
to use its LowerHex
implementation when
Debug
-formatted.§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self
to use its Octal
implementation when Debug
-formatted.§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self
to use its Pointer
implementation when
Debug
-formatted.§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self
to use its UpperExp
implementation when
Debug
-formatted.§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self
to use its UpperHex
implementation when
Debug
-formatted.§fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
fn fmt_list(self) -> FmtList<Self>where
&'a Self: for<'a> IntoIterator,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> 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§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read more§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read more§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self
, then passes self.as_ref()
into the pipe function.§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self
, then passes self.as_mut()
into the pipe
function.§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self
, then passes self.deref()
into the pipe function.§impl<T> Tap for T
impl<T> Tap for T
§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B>
of a value. Read more§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B>
of a value. Read more§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R>
view of a value. Read more§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R>
view of a value. Read more§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target
of a value. Read more§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target
of a value. Read more§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap()
only in debug builds, and is erased in release builds.§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut()
only in debug builds, and is erased in release
builds.§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow()
only in debug builds, and is erased in release
builds.§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref()
only in debug builds, and is erased in release
builds.§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut()
only in debug builds, and is erased in release
builds.§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref()
only in debug builds, and is erased in release
builds.