pub struct EstablishIntro { /* private fields */ }
hs
only.Expand description
A hidden services establishes a new introduction point, by sending an EstablishIntro message.
This may represent either an outbound body that we’re sending, or a decoded body that we’re receiving.
§Usage
This type is a good choice for handling an incoming EstablishIntro message on a Relay, but not for generating an outgoing EstablishIntro message.
Onion services should not construct this message object; instead, they
should construct an EstablishIntroDetails
, and then call its
sign_and_encode
method.
Implementations§
Source§impl EstablishIntro
impl EstablishIntro
Sourcepub fn from_parts_for_test(
body: EstablishIntroDetails,
mac: CtByteArray<HS_MAC_LEN>,
signature: Signature,
) -> Self
Available on crate feature testing
only.
pub fn from_parts_for_test( body: EstablishIntroDetails, mac: CtByteArray<HS_MAC_LEN>, signature: Signature, ) -> Self
testing
only.Sourcepub fn check_and_unwrap<'a>(
self,
mac_key: impl Into<HsMacKey<'a>>,
) -> Result<EstablishIntroDetails, EstablishIntroSigError>
pub fn check_and_unwrap<'a>( self, mac_key: impl Into<HsMacKey<'a>>, ) -> Result<EstablishIntroDetails, EstablishIntroSigError>
Check whether this EstablishIntro message is well-signed (with its included key), and well authenticated with the provided MAC key.
On success, return the EstablishIntroDetails
describing how to function
as an introduction point for this service. On failure, return an error.
Sourcepub fn dangerously_unwrap(self) -> EstablishIntroDetails
pub fn dangerously_unwrap(self) -> EstablishIntroDetails
Consume this EstablishIntro message and return its body.
This is a “dangerous” function because it does not check correctness for the signature or the MAC.
Trait Implementations§
Source§impl Body for EstablishIntro
impl Body for EstablishIntro
Source§fn decode_from_reader(r: &mut Reader<'_>) -> Result<Self>
fn decode_from_reader(r: &mut Reader<'_>) -> Result<Self>
Source§fn encode_onto<W: Writer + ?Sized>(self, w: &mut W) -> EncodeResult<()>
fn encode_onto<W: Writer + ?Sized>(self, w: &mut W) -> EncodeResult<()>
Source§impl Clone for EstablishIntro
impl Clone for EstablishIntro
Source§fn clone(&self) -> EstablishIntro
fn clone(&self) -> EstablishIntro
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for EstablishIntro
impl Debug for EstablishIntro
Source§impl From<EstablishIntro> for AnyRelayMsg
impl From<EstablishIntro> for AnyRelayMsg
Source§fn from(m: EstablishIntro) -> AnyRelayMsg
fn from(m: EstablishIntro) -> AnyRelayMsg
Source§impl HasMemoryCostStructural for EstablishIntro
impl HasMemoryCostStructural for EstablishIntro
Source§fn indirect_memory_cost(&self, et: EnabledToken) -> usize
fn indirect_memory_cost(&self, et: EnabledToken) -> usize
Source§impl RelayMsg for EstablishIntro
impl RelayMsg for EstablishIntro
Source§fn encode_onto<W: Writer + ?Sized>(self, w: &mut W) -> EncodeResult<()>
fn encode_onto<W: Writer + ?Sized>(self, w: &mut W) -> EncodeResult<()>
Source§impl TryFrom<AnyRelayMsg> for EstablishIntro
impl TryFrom<AnyRelayMsg> for EstablishIntro
Source§fn try_from(msg: AnyRelayMsg) -> Result<EstablishIntro>
fn try_from(msg: AnyRelayMsg) -> Result<EstablishIntro>
Auto Trait Implementations§
impl Freeze for EstablishIntro
impl RefUnwindSafe for EstablishIntro
impl Send for EstablishIntro
impl Sync for EstablishIntro
impl Unpin for EstablishIntro
impl UnwindSafe for EstablishIntro
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> 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
Source§impl<T> HasMemoryCost for Twhere
T: HasMemoryCostStructural,
impl<T> HasMemoryCost for Twhere
T: HasMemoryCostStructural,
Source§fn memory_cost(&self, et: EnabledToken) -> usize
fn memory_cost(&self, et: EnabledToken) -> usize
self
, in bytes Read moreSource§impl<T> HasTypedMemoryCost<T> for Twhere
T: HasMemoryCost,
impl<T> HasTypedMemoryCost<T> for Twhere
T: HasMemoryCost,
Source§fn typed_memory_cost(&self, enabled: EnabledToken) -> TypedMemoryCost<T>
fn typed_memory_cost(&self, enabled: EnabledToken) -> TypedMemoryCost<T>
TypedMemoryCost<T>
rather than a raw usize
§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