pub struct Parameters { /* private fields */ }
Expand description
Parameters for the secret sharing scheme.
Implementations§
Source§impl Parameters
impl Parameters
Sourcepub fn new(n: u16, t: u16) -> Result<Self>
pub fn new(n: u16, t: u16) -> Result<Self>
Creates new parameters for the secret sharing scheme.
§Errors
- Returns an error if
t
is not in range0 < t < n
. - Returns an error if
n
is less than 2.
Sourcepub fn threshold_reached(&self, kind: SessionKind, parties: usize) -> bool
pub fn threshold_reached(&self, kind: SessionKind, parties: usize) -> bool
Returns boolean indicating if threshold has been reached.
Trait Implementations§
Source§impl Clone for Parameters
impl Clone for Parameters
Source§fn clone(&self) -> Parameters
fn clone(&self) -> Parameters
Returns a duplicate of the value. Read more
1.0.0 · Source§const fn clone_from(&mut self, source: &Self)
const fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for Parameters
impl Debug for Parameters
Source§impl<'de> Deserialize<'de> for Parameters
impl<'de> Deserialize<'de> for Parameters
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Parameters
impl RefUnwindSafe for Parameters
impl Send for Parameters
impl Sync for Parameters
impl Unpin for Parameters
impl UnwindSafe for Parameters
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