Trait Party

Source
pub trait Party {
    type Input: Send;
    type Output: Debug + Send;

    // Required method
    fn run(
        &mut self,
        id: usize,
        n_parties: usize,
        input: &Self::Input,
        channels: &mut Channels,
        timings: &mut Timings,
    ) -> Self::Output;

    // Provided method
    fn get_name(&self, id: usize) -> String { ... }
}
Expand description

A Party that takes part in a protocol. The party will receive a unique id when it is running the protocol, as well as communication channels to and from all the other parties. A party keeps track of its own stats.

Required Associated Types§

Source

type Input: Send

The input type of this party. It must be the same for all parties in a given protocol (but it could be e.g. an enum or Option).

Source

type Output: Debug + Send

The output type of this party. It must be the same for all parties in a given protocol (but it could be e.g. an enum or Option)

Required Methods§

Source

fn run( &mut self, id: usize, n_parties: usize, input: &Self::Input, channels: &mut Channels, timings: &mut Timings, ) -> Self::Output

Runs the code for this party in the given protocol. The id starts from 0.

Provided Methods§

Source

fn get_name(&self, id: usize) -> String

Gets the name of this party. By default, this is ‘Party {id}’.

Implementors§