Trait RotSender

Source
pub trait RotSender: Connected + Send {
    type Error;

    // Required method
    fn send_into(
        &mut self,
        ots: &mut impl Buf<[Block; 2]>,
    ) -> impl Future<Output = Result<(), Self::Error>> + Send;

    // Provided method
    fn send(
        &mut self,
        count: usize,
    ) -> impl Future<Output = Result<Vec<[Block; 2]>, Self::Error>> + Send { ... }
}
Expand description

A random OT sender.

Required Associated Types§

Source

type Error

The error type returned by send operations.

Required Methods§

Source

fn send_into( &mut self, ots: &mut impl Buf<[Block; 2]>, ) -> impl Future<Output = Result<(), Self::Error>> + Send

Store OTs in the provided Buffer.

Note that implementations might temporarily take ownership of the Buf pointed to by ots. If the future returned by this method is dropped befire completion, ots might point at an empty Buf.

For large number of OTs, using HugePageMemory can significantly improve performance on Linux systems.

Provided Methods§

Source

fn send( &mut self, count: usize, ) -> impl Future<Output = Result<Vec<[Block; 2]>, Self::Error>> + Send

Send count many random OTs.

For better performance, use RotSender::send_into with an existing Buf.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementations on Foreign Types§

Source§

impl<S: RotSender> RotSender for &mut S

Source§

type Error = <S as RotSender>::Error

Source§

fn send_into( &mut self, ots: &mut impl Buf<[Block; 2]>, ) -> impl Future<Output = Result<(), Self::Error>> + Send

Implementors§