Encoder

Struct Encoder 

Source
pub struct Encoder<WI, CI, T> { /* private fields */ }
Expand description

An encoder for CDF format

Implementations§

Source§

impl<WI, CI, T> Encoder<WI, CI, T>

Source

pub fn into_inner(self) -> T

Return the underlying encoder

Source§

impl<WI, CI> Encoder<WI, CI, File>

Source

pub fn init_file<P>( config: Config, witnesses: WI, constraints: CI, path: P, ) -> Result<Self>
where P: AsRef<Path>,

Initialize the encoder, filling a file with required bytes.

Check File::set_len

Source§

impl<WI, CI, B> Encoder<WI, CI, BufWriter<B>>

Source

pub fn init_buffer( config: Config, witnesses: WI, constraints: CI, buffer: B, ) -> Result<Self>

Initialize the encoder, filling the buffer with required bytes.

Source§

impl<WI, CI> Encoder<WI, CI, Cursor<Vec<u8>>>

Source

pub fn init_cursor(config: Config, witnesses: WI, constraints: CI) -> Self

Initialize the encoder, filling the buffer with required bytes.

Source§

impl<W, WI, C, CI, T> Encoder<WI, CI, T>

Source

pub fn write_all<P>(&mut self, provider: P) -> Result<usize>

Write all witnesses and constraints into the target

Trait Implementations§

Source§

impl<WI: Debug, CI: Debug, T: Debug> Debug for Encoder<WI, CI, T>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<WI, CI, T> Freeze for Encoder<WI, CI, T>
where WI: Freeze, CI: Freeze, T: Freeze,

§

impl<WI, CI, T> RefUnwindSafe for Encoder<WI, CI, T>

§

impl<WI, CI, T> Send for Encoder<WI, CI, T>
where WI: Send, CI: Send, T: Send,

§

impl<WI, CI, T> Sync for Encoder<WI, CI, T>
where WI: Sync, CI: Sync, T: Sync,

§

impl<WI, CI, T> Unpin for Encoder<WI, CI, T>
where WI: Unpin, CI: Unpin, T: Unpin,

§

impl<WI, CI, T> UnwindSafe for Encoder<WI, CI, T>
where WI: UnwindSafe, CI: UnwindSafe, T: UnwindSafe,

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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.