#[non_exhaustive]pub struct MpcParty<M, D, R = DefaultRuntime> {
pub delivery: D,
pub runtime: R,
/* private fields */
}Expand description
Party of MPC protocol
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.delivery: DDefines transport layer
runtime: RDefines how computationally heavy tasks should be handled
Implementations§
Source§impl<M, D, X> MpcParty<M, D, X>where
D: Delivery<M>,
impl<M, D, X> MpcParty<M, D, X>where
D: Delivery<M>,
Sourcepub fn map_delivery<D2>(self, f: impl FnOnce(D) -> D2) -> MpcParty<M, D2, X>
pub fn map_delivery<D2>(self, f: impl FnOnce(D) -> D2) -> MpcParty<M, D2, X>
Modify the delivery of this party while keeping everything else the same
Sourcepub fn map_runtime<R>(self, f: impl FnOnce(X) -> R) -> MpcParty<M, D, R>
pub fn map_runtime<R>(self, f: impl FnOnce(X) -> R) -> MpcParty<M, D, R>
Modify the runtime of this party while keeping everything else the same
Sourcepub fn set_runtime<R>(self, runtime: R) -> MpcParty<M, D, R>where
R: AsyncRuntime,
pub fn set_runtime<R>(self, runtime: R) -> MpcParty<M, D, R>where
R: AsyncRuntime,
Specifies a async runtime
Trait Implementations§
Source§impl<M, D, R> Mpc for MpcParty<M, D, R>where
D: Delivery<M>,
D::SendError: Error + Send + Sync + 'static,
D::ReceiveError: Error + Send + Sync + 'static,
R: AsyncRuntime,
impl<M, D, R> Mpc for MpcParty<M, D, R>where
D: Delivery<M>,
D::SendError: Error + Send + Sync + 'static,
D::ReceiveError: Error + Send + Sync + 'static,
R: AsyncRuntime,
Source§type ProtocolMessage = M
type ProtocolMessage = M
MPC message
Source§type ReceiveError = <D as Delivery<M>>::ReceiveError
type ReceiveError = <D as Delivery<M>>::ReceiveError
Receiving message error
Source§fn into_party(
self,
) -> MpcParty<Self::ProtocolMessage, Self::Delivery, Self::Runtime>
fn into_party( self, ) -> MpcParty<Self::ProtocolMessage, Self::Delivery, Self::Runtime>
Converts into
MpcPartyAuto Trait Implementations§
impl<M, D, R> Freeze for MpcParty<M, D, R>
impl<M, D, R> RefUnwindSafe for MpcParty<M, D, R>
impl<M, D, R> Send for MpcParty<M, D, R>
impl<M, D, R> Sync for MpcParty<M, D, R>
impl<M, D, R> Unpin for MpcParty<M, D, R>
impl<M, D, R> UnwindSafe for MpcParty<M, D, R>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more