tlsn_core/transcript/encoding/
provider.rs

1use std::ops::Range;
2
3use crate::transcript::Direction;
4
5/// A provider of plaintext encodings.
6pub trait EncodingProvider {
7    /// Writes the encoding of the given range into the destination buffer.
8    fn provide_encoding(
9        &self,
10        direction: Direction,
11        range: Range<usize>,
12        dest: &mut Vec<u8>,
13    ) -> Result<(), EncodingProviderError>;
14}
15
16#[derive(Debug, thiserror::Error)]
17#[error("failed to provide encoding")]
18pub struct EncodingProviderError;