#[non_exhaustive]pub struct ApprovalThresholdPolicy {
pub threshold_percentage: Option<i32>,
pub proposal_duration_in_hours: Option<i32>,
pub threshold_comparator: Option<ThresholdComparator>,
}Expand description
A policy type that defines the voting rules for the network. The rules decide if a proposal is approved. Approval may be based on criteria such as the percentage of YES votes and the duration of the proposal. The policy applies to all proposals and is specified when the network is created.
Applies only to Hyperledger Fabric.
Fields (Non-exhaustive)
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.threshold_percentage: Option<i32>The percentage of votes among all members that must be YES for a proposal to be approved. For example, a ThresholdPercentage value of 50 indicates 50%. The ThresholdComparator determines the precise comparison. If a ThresholdPercentage value of 50 is specified on a network with 10 members, along with a ThresholdComparator value of GREATER_THAN, this indicates that 6 YES votes are required for the proposal to be approved.
proposal_duration_in_hours: Option<i32>The duration from the time that a proposal is created until it expires. If members cast neither the required number of YES votes to approve the proposal nor the number of NO votes required to reject it before the duration expires, the proposal is EXPIRED and ProposalActions are not carried out.
threshold_comparator: Option<ThresholdComparator>Determines whether the vote percentage must be greater than the ThresholdPercentage or must be greater than or equal to the ThreholdPercentage to be approved.
Implementations
sourceimpl ApprovalThresholdPolicy
impl ApprovalThresholdPolicy
sourcepub fn threshold_percentage(&self) -> Option<i32>
pub fn threshold_percentage(&self) -> Option<i32>
The percentage of votes among all members that must be YES for a proposal to be approved. For example, a ThresholdPercentage value of 50 indicates 50%. The ThresholdComparator determines the precise comparison. If a ThresholdPercentage value of 50 is specified on a network with 10 members, along with a ThresholdComparator value of GREATER_THAN, this indicates that 6 YES votes are required for the proposal to be approved.
sourcepub fn proposal_duration_in_hours(&self) -> Option<i32>
pub fn proposal_duration_in_hours(&self) -> Option<i32>
The duration from the time that a proposal is created until it expires. If members cast neither the required number of YES votes to approve the proposal nor the number of NO votes required to reject it before the duration expires, the proposal is EXPIRED and ProposalActions are not carried out.
sourcepub fn threshold_comparator(&self) -> Option<&ThresholdComparator>
pub fn threshold_comparator(&self) -> Option<&ThresholdComparator>
Determines whether the vote percentage must be greater than the ThresholdPercentage or must be greater than or equal to the ThreholdPercentage to be approved.
sourceimpl ApprovalThresholdPolicy
impl ApprovalThresholdPolicy
sourcepub fn builder() -> Builder
pub fn builder() -> Builder
Creates a new builder-style object to manufacture ApprovalThresholdPolicy.
Trait Implementations
sourceimpl Clone for ApprovalThresholdPolicy
impl Clone for ApprovalThresholdPolicy
sourcefn clone(&self) -> ApprovalThresholdPolicy
fn clone(&self) -> ApprovalThresholdPolicy
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source. Read more
sourceimpl Debug for ApprovalThresholdPolicy
impl Debug for ApprovalThresholdPolicy
sourceimpl PartialEq<ApprovalThresholdPolicy> for ApprovalThresholdPolicy
impl PartialEq<ApprovalThresholdPolicy> for ApprovalThresholdPolicy
sourcefn eq(&self, other: &ApprovalThresholdPolicy) -> bool
fn eq(&self, other: &ApprovalThresholdPolicy) -> bool
This method tests for self and other values to be equal, and is used
by ==. Read more
sourcefn ne(&self, other: &ApprovalThresholdPolicy) -> bool
fn ne(&self, other: &ApprovalThresholdPolicy) -> bool
This method tests for !=.
impl StructuralPartialEq for ApprovalThresholdPolicy
Auto Trait Implementations
impl RefUnwindSafe for ApprovalThresholdPolicy
impl Send for ApprovalThresholdPolicy
impl Sync for ApprovalThresholdPolicy
impl Unpin for ApprovalThresholdPolicy
impl UnwindSafe for ApprovalThresholdPolicy
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber to this type, returning a
WithDispatch wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber to this type, returning a
WithDispatch wrapper. Read more