[][src]Struct fancy_garbling::Bundle

pub struct Bundle<W: Clone + HasModulus>(_);

A collection of wires, useful for the garbled gadgets defined by BundleGadgets.

Methods

impl<W: Clone + HasModulus> Bundle<W>[src]

pub fn new(ws: Vec<W>) -> Bundle<W>[src]

Create a new bundle from some wires.

pub fn moduli(&self) -> Vec<u16>[src]

Return the moduli of all the wires in the bundle.

pub fn wires(&self) -> &[W][src]

Extract the wires from this bundle.

pub fn size(&self) -> usize[src]

Get the number of wires in this bundle.

pub fn is_binary(&self) -> bool[src]

Whether this bundle only contains residues in mod 2.

pub fn with_moduli(&self, moduli: &[u16]) -> Bundle<W>[src]

Returns a new bundle only containing wires with matching moduli.

pub fn pad(&mut self, val: &W, n: usize)[src]

Pad the Bundle with val, n times.

pub fn extract(&mut self, wire_index: usize) -> W[src]

Extract a wire from the Bundle, removing it and returning it.

pub fn iter(&self) -> Iter<W>[src]

Access the underlying iterator

Trait Implementations

impl<W: Clone + HasModulus> From<Bundle<W>> for BinaryBundle<W>[src]

impl<W: Clone + HasModulus> From<Bundle<W>> for CrtBundle<W>[src]

impl<W: Clone + HasModulus> Clone for Bundle<W>[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl<W: Clone + HasModulus> Index<usize> for Bundle<W>[src]

type Output = W

The returned type after indexing.

Auto Trait Implementations

impl<W> Send for Bundle<W> where
    W: Send

impl<W> Sync for Bundle<W> where
    W: Sync

Blanket Implementations

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T, U> IntoBits<U> for T where
    U: FromBits<T>, 

impl<T> FromCast<T> for T

impl<T, U> Cast<U> for T where
    U: FromCast<T>, 

impl<T> FromBits<T> for T

impl<T> Same<T> for T

type Output = T

Should always be Self