Skip to main content

Proven

Struct Proven 

Source
pub struct Proven<I: Identity> { /* private fields */ }
Expand description

A chain whose peer has proven possession — §6.1’s stage 2, at 2 DH cumulative.

Drop is a silent reject.

S8 — #[must_use], see Intro. S9 is the story that makes this stage’s drop meaningful: prove an identity, then still decline.

Implementations§

Source§

impl<I: Identity> Proven<I>

Source

pub fn peer_static(&self) -> &PublicKeyOf<I>

The peer’s static — proven, and safe to authorise or deny on.

Source

pub fn timestamp(&self) -> Timestamp

§5.2’s initiation timestamp, as the peer sent it.

The one wall-clock reading in the protocol (§5.3), carried verbatim: it is not range-checked, because §5.3 specifies no validation and a slither that rejected an out-of-range value would have added a wire behaviour the spec does not have.

Source

pub async fn accept(self) -> Result<Connection<I::Suite>, AcceptError>

§6.1’s stage 3 — +2 DH (ee, se), 4 cumulative.

Writes msg2 and installs the session, returning the established Connection.

§Cancel-safety

Dropping the future before the reply arrives rejects the chain (a no-op if the driver has already consumed it). Dropping it after the driver has built the connection drops that Connection — the last handle to it — which performs §16.2’s close(NO_ERROR, ""). That is the right answer for a session nobody claimed: the peer is told at once rather than waiting out its representable effective-dead-timeout deadline.

Trait Implementations§

Source§

impl<I: Identity> Debug for Proven<I>

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<I: Identity> Drop for Proven<I>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

fn pin_drop(self: Pin<&mut Self>)

🔬This is a nightly-only experimental API. (pin_ergonomics)
Execute the destructor for this type, but different to Drop::drop, it requires self to be pinned. Read more

Auto Trait Implementations§

§

impl<I> !RefUnwindSafe for Proven<I>

§

impl<I> !Send for Proven<I>

§

impl<I> !Sync for Proven<I>

§

impl<I> !UnwindSafe for Proven<I>

§

impl<I> Freeze for Proven<I>
where Shell<I>: Freeze, <<<I as Identity>::Suite as Channel>::Curve as Curve>::PublicKey: Freeze,

§

impl<I> Unpin for Proven<I>
where Shell<I>: Unpin, <<<I as Identity>::Suite as Channel>::Curve as Curve>::PublicKey: Unpin,

§

impl<I> UnsafeUnpin for Proven<I>
where Shell<I>: UnsafeUnpin, <<<I as Identity>::Suite as Channel>::Curve as Curve>::PublicKey: UnsafeUnpin,

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<P> ProviderExt for P

Source§

fn generate<C>( &mut self, ) -> Result<<P as CryptoKeyProvider<C>>::PrivateKey, <P as CryptoKeyProvider<C>>::Error>
where C: Curve, P: CryptoKeyProvider<C>,

Generate a long-term static key for curve C.
Source§

fn generate_ephemeral<C>( &mut self, ) -> Result<<P as CryptoKeyProvider<C>>::PrivateKey, <P as CryptoKeyProvider<C>>::Error>
where C: Curve, P: CryptoKeyProvider<C>,

Generate an ephemeral key for curve C.
Source§

fn public<K>( &self, key: &K, ) -> Result<<<K as SecretKey>::Curve as Curve>::PublicKey, <P as CryptoKeyProvider<<K as SecretKey>::Curve>>::Error>
where K: SecretKey, P: CryptoKeyProvider<<K as SecretKey>::Curve, PrivateKey = K>,

Extract the public key, inferring the curve from key.
Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more