# control.rs - source
Source of the Rust file `crates/tlsn/src/prover/control.rs`.

Skip to main content

#
tlsn/prover/
control.rs

    1use crate::prover::client::DecryptState;
    2use std::sync::Arc;
    3
    4/// A controller for the prover.
    5///
    6/// Can be used to control the decryption of server traffic.
    7#[derive(Clone, Debug)]
    8pub struct ProverControl {
    9    pub(crate) decrypt_state: Arc<DecryptState>,
    10}
    11
    12impl ProverControl {
    13    /// Returns whether the prover is decrypting the server traffic.
    14    pub fn is_decrypting(&self) -> bool {
    15        self.decrypt_state.is_decrypting()
    16    }
    17
    18    /// Enables or disables the decryption of server traffic.
    19    ///
    20    /// # Arguments
    21    ///
    22    /// * `enable` - If decryption should be enabled or disabled.
    23    pub fn enable_decryption(&self, enable: bool) {
    24        self.decrypt_state.enable_decryption(enable)
    25    }
    26}