Struct tlsn_prover::Prover
source · pub struct Prover<T: ProverState> { /* private fields */ }
Expand description
A prover instance.
Implementations§
source§impl Prover<Notarize>
impl Prover<Notarize>
sourcepub fn transcript(&self) -> &Transcript
pub fn transcript(&self) -> &Transcript
Returns the transcript.
sourcepub fn transcript_commit(&mut self, config: TranscriptCommitConfig)
pub fn transcript_commit(&mut self, config: TranscriptCommitConfig)
Configures transcript commitments.
sourcepub async fn finalize(
self,
config: &RequestConfig,
) -> Result<(Attestation, Secrets), ProverError>
pub async fn finalize( self, config: &RequestConfig, ) -> Result<(Attestation, Secrets), ProverError>
Finalizes the notarization.
source§impl Prover<Prove>
impl Prover<Prove>
sourcepub fn transcript(&self) -> &Transcript
pub fn transcript(&self) -> &Transcript
Returns the transcript.
sourcepub async fn prove_transcript(
&mut self,
sent: Idx,
recv: Idx,
) -> Result<(), ProverError>
pub async fn prove_transcript( &mut self, sent: Idx, recv: Idx, ) -> Result<(), ProverError>
Prove subsequences in the transcript to the verifier.
§Arguments
sent
- Indices of the sent data.recv
- Indices of the received data.
sourcepub async fn finalize(self) -> Result<(), ProverError>
pub async fn finalize(self) -> Result<(), ProverError>
Finalize the proving
source§impl Prover<Initialized>
impl Prover<Initialized>
sourcepub fn new(config: ProverConfig) -> Self
pub fn new(config: ProverConfig) -> Self
source§impl Prover<Setup>
impl Prover<Setup>
sourcepub async fn connect<S: AsyncWrite + AsyncRead + Send + Unpin + 'static>(
self,
socket: S,
) -> Result<(TlsConnection, ProverFuture), ProverError>
pub async fn connect<S: AsyncWrite + AsyncRead + Send + Unpin + 'static>( self, socket: S, ) -> Result<(TlsConnection, ProverFuture), ProverError>
Connects to the server using the provided socket.
Returns a handle to the TLS connection, a future which returns the prover once the connection is closed.
§Arguments
socket
- The socket to the server.
source§impl Prover<Closed>
impl Prover<Closed>
sourcepub fn transcript(&self) -> &Transcript
pub fn transcript(&self) -> &Transcript
Returns the transcript.
sourcepub fn start_notarize(self) -> Prover<Notarize>
pub fn start_notarize(self) -> Prover<Notarize>
Starts notarization of the TLS session.
Used when the TLS verifier is a Notary to transition the prover to the next state where it can generate commitments to the transcript prior to finalization.
sourcepub fn start_prove(self) -> Prover<Prove>
pub fn start_prove(self) -> Prover<Prove>
Starts proving the TLS session.
This function transitions the prover into a state where it can prove content of the transcript.
Trait Implementations§
Auto Trait Implementations§
impl<T> Freeze for Prover<T>where
T: Freeze,
impl<T> !RefUnwindSafe for Prover<T>
impl<T> Send for Prover<T>where
T: Send,
impl<T> Sync for Prover<T>where
T: Sync,
impl<T> Unpin for Prover<T>where
T: Unpin,
impl<T> !UnwindSafe for Prover<T>
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
§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>
Converts
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>
Converts
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> Pointable for T
impl<T> Pointable for T
§impl<T> SpawnCompatExt for T
impl<T> SpawnCompatExt for T
§fn compat_ref(&self) -> Compat<&T>
fn compat_ref(&self) -> Compat<&T>
Wrap a reference to the executor in a
Compat
wrapper.§fn compat_mut(&mut self) -> Compat<&mut T>
fn compat_mut(&mut self) -> Compat<&mut T>
Wrap a mutable reference to the executor in a
Compat
wrapper.§impl<T> SpawnCompatExt for T
impl<T> SpawnCompatExt for T
§fn compat_ref(&self) -> Compat<&T>
fn compat_ref(&self) -> Compat<&T>
Wrap a reference to the executor in a
Compat
wrapper.§fn compat_mut(&mut self) -> Compat<&mut T>
fn compat_mut(&mut self) -> Compat<&mut T>
Wrap a mutable reference to the executor in a
Compat
wrapper.