Struct tlsn_prover::tls::Prover
source · pub struct Prover<T: ProverState> { /* private fields */ }
Expand description
A prover instance.
Implementations§
source§impl Prover<Notarize>
impl Prover<Notarize>
sourcepub fn sent_transcript(&self) -> &Transcript
pub fn sent_transcript(&self) -> &Transcript
Returns the transcript of the sent data.
sourcepub fn recv_transcript(&self) -> &Transcript
pub fn recv_transcript(&self) -> &Transcript
Returns the transcript of the received data.
sourcepub fn commitment_builder(&mut self) -> &mut TranscriptCommitmentBuilder
pub fn commitment_builder(&mut self) -> &mut TranscriptCommitmentBuilder
Returns the transcript commitment builder.
sourcepub async fn finalize(self) -> Result<NotarizedSession, ProverError>
pub async fn finalize(self) -> Result<NotarizedSession, ProverError>
Finalizes the notarization returning a NotarizedSession
.
source§impl Prover<Prove>
impl Prover<Prove>
sourcepub fn sent_transcript(&self) -> &Transcript
pub fn sent_transcript(&self) -> &Transcript
Returns the transcript of the sent requests
sourcepub fn recv_transcript(&self) -> &Transcript
pub fn recv_transcript(&self) -> &Transcript
Returns the transcript of the received responses
sourcepub fn reveal(
&mut self,
ranges: impl Into<RangeSet<usize>>,
direction: Direction,
) -> Result<(), ProverError>
pub fn reveal( &mut self, ranges: impl Into<RangeSet<usize>>, direction: Direction, ) -> Result<(), ProverError>
Reveal certain parts of the transcripts to the verifier
This function allows to collect certain transcript ranges. When Prover::prove is called, these ranges will be opened to the verifier.
§Arguments
ranges
- The ranges of the transcript to revealdirection
- The direction of the transcript to reveal
sourcepub async fn prove(&mut self) -> Result<(), ProverError>
pub async fn prove(&mut self) -> Result<(), ProverError>
Prove transcript values
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 sent_transcript(&self) -> &Transcript
pub fn sent_transcript(&self) -> &Transcript
Returns the transcript of the sent requests
sourcepub fn recv_transcript(&self) -> &Transcript
pub fn recv_transcript(&self) -> &Transcript
Returns the transcript of the received responses
sourcepub fn to_http(self) -> Result<HttpProver<Closed>, HttpProverError>
pub fn to_http(self) -> Result<HttpProver<Closed>, HttpProverError>
Creates an HTTP prover.
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
§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§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>
Compat
wrapper.§fn compat_mut(&mut self) -> Compat<&mut T>
fn compat_mut(&mut self) -> Compat<&mut T>
Compat
wrapper.§impl<T> SpawnCompatExt for T
impl<T> SpawnCompatExt for T
§fn compat_ref(&self) -> Compat<&T>
fn compat_ref(&self) -> Compat<&T>
Compat
wrapper.§fn compat_mut(&mut self) -> Compat<&mut T>
fn compat_mut(&mut self) -> Compat<&mut T>
Compat
wrapper.