Skip to main content

Share

Struct Share 

Source
pub struct Share { /* private fields */ }
Expand description

One share of a split: the threshold of its set, the x it was evaluated at (from 1) and one y byte per byte of the secret.

Implementations§

Source§

impl Share

Source

pub fn new(threshold: u8, index: u8, y: Vec<u8>) -> Self

A share from its parts.

Source

pub fn threshold(&self) -> u8

How many shares reconstruct the secret this one belongs to.

Source

pub fn index(&self) -> u8

The x this share was evaluated at, from 1.

Source

pub fn y(&self) -> &[u8] ⓘ

The y values, borrowed.

Trait Implementations§

Source§

impl Debug for Share

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Share

§

impl RefUnwindSafe for Share

§

impl Send for Share

§

impl Sync for Share

§

impl Unpin for Share

§

impl UnsafeUnpin for Share

§

impl UnwindSafe for Share

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

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.