Skip to main content

SlotProto

Struct SlotProto 

Source
pub struct SlotProto<'a, C: Consensus, D: Driver> {
    pub cd: &'a ConsensusDriver<C, D>,
    pub local_state: &'a LocalState,
    pub slot_state: &'a mut SlotState,
}

Fields§

§cd: &'a ConsensusDriver<C, D>§local_state: &'a LocalState§slot_state: &'a mut SlotState

Implementations§

Source§

impl<'a, C: Consensus, D: Driver> SlotProto<'a, C, D>

Source

pub fn nomination_proto(&mut self) -> NominationProto<'_, 'a, C, D>

Source

pub fn ballot_proto(&mut self) -> BallotProto<'_, 'a, C, D>

Source

pub fn local_proto(&self) -> LocalProto<'_, C, D>

Source

pub fn index(&self) -> SlotIndex

Source

pub fn ballot_state(&self) -> &BallotState

Source

pub fn ballot_state_mut(&mut self) -> &mut BallotState

Source

pub fn nomination(&self) -> &NominationState

Source

pub fn nomination_mut(&mut self) -> &mut NominationState

Source

pub fn driver(&self) -> &D

Source

pub fn consensus(&self) -> &C

Source

pub fn driver_calling_back(&mut self, cb: DriverCallback)

Source

pub fn get_companion_quorum_set_hash_from_statement( statement: &SCPStatement, ) -> SCPHash

Source

pub fn get_statement_values( statement: &SCPStatement, ) -> (Vec<SCPValue>, Vec<SCPValue>)

returns (nom values, ballot values)

Source

pub fn get_quorum_set_from_statement( &self, statement: &SCPStatement, ) -> Option<SCPQuorumSet>

Source

pub fn get_state( &mut self, node: &SCPNodeID, self_already_moved_on: bool, ) -> QuorumInfoNodeState

Source

pub fn should_process_envelope(&mut self, env: &SCPEnvelope, ours: bool) -> bool

Source

pub fn process_envelope( &mut self, envelope: &SCPEnvelope, ours: bool, ) -> EnvelopeState

Source

pub fn abandon_ballot(&mut self) -> bool

Source

pub fn bump_state(&mut self, value: &SCPValue, force: bool) -> bool

Source

pub fn nominate( &mut self, value: &SCPValue, previous_value: &SCPValue, timed_out: bool, ) -> bool

Source

pub fn stop_nomination(&mut self)

Source

pub fn get_nomination_leaders(&mut self) -> HashSet<SCPNodeID>

Source

pub fn set_fully_validated(&mut self, validated: bool)

Source

pub fn get_latest_composite_candidate(&mut self) -> Option<SCPValue>

Source

pub fn create_envelope(&mut self, statement: SCPStatement) -> SCPEnvelope

Source

pub fn is_fully_validated(&self) -> bool

Source

pub fn get_json_info(&mut self, full_keys: bool) -> Value

Source

pub fn get_json_quorum_info( &mut self, id: &SCPNodeID, summary: bool, full_keys: bool, ) -> Value

Source

pub fn federated_accept<F1, F2>( &self, voted: &F1, accepted: &F2, envs: &HashMap<SCPNodeID, SCPEnvelope>, ) -> bool
where F1: Fn(&SCPStatement) -> bool, F2: Fn(&SCPStatement) -> bool,

Source

pub fn federated_ratify<F>( &self, voted: &F, envs: &HashMap<SCPNodeID, SCPEnvelope>, ) -> bool
where F: Fn(&SCPStatement) -> bool,

Source

pub fn get_statement_count(&self) -> usize

Source

pub fn got_vblocking(&self) -> bool

Source

pub fn get_entire_current_state(&mut self) -> Vec<SCPEnvelope>

Source

pub fn get_latest_messages_send(&mut self) -> Vec<SCPEnvelope>

Source

pub fn get_latest_message(&mut self, node_id: &SCPNodeID) -> Option<SCPEnvelope>

Source

pub fn maybe_set_got_vblocking(&mut self)

Source

pub fn set_state_from_envelope(&mut self, envelope: &SCPEnvelope)

Source

pub fn process_current_state<F>(&mut self, f: &mut F, force_self: bool)
where F: FnMut(&SCPEnvelope) -> bool,

Source

pub fn is_newer_nomination_or_ballot_st( old_st: &SCPStatement, new_st: &SCPStatement, ) -> bool

Source

pub fn get_externalizing_state(&mut self) -> Vec<SCPEnvelope>

Source

pub fn get_externalized_slot_proof( &mut self, ) -> Result<Option<ExternalizedSlotProof>, ExternalizedSlotProofError>

Builds a proof snapshot for this slot after it externalizes.

Returns Ok(None) only when the slot has no externalizing state yet.

Source

pub fn record_statement(&mut self, st: &SCPStatement)

Trait Implementations§

Source§

impl<'a, C: Debug + Consensus, D: Debug + Driver> Debug for SlotProto<'a, C, D>

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl<'a, C, D> !UnwindSafe for SlotProto<'a, C, D>

§

impl<'a, C, D> Forget for SlotProto<'a, C, D>

§

impl<'a, C, D> Freeze for SlotProto<'a, C, D>
where &'a ConsensusDriver<C, D>: Freeze, &'a LocalState: Freeze, &'a mut SlotState: Freeze,

§

impl<'a, C, D> Move for SlotProto<'a, C, D>

§

impl<'a, C, D> RefUnwindSafe for SlotProto<'a, C, D>

§

impl<'a, C, D> Send for SlotProto<'a, C, D>
where &'a ConsensusDriver<C, D>: Send, &'a LocalState: Send, RawTable<(BytesM<u32::MAX>, ())>: Send, RawTable<(PublicKey, SCPEnvelope)>: Send, BoxRaw<MlDsa65PublicKey>: Send, RawVecInner: Send, BoxRaw<MlDsa65Signature>: Send, RawTable<(PublicKey, ())>: Send,

§

impl<'a, C, D> Sync for SlotProto<'a, C, D>
where D: Sync, C: Sync, BoxRaw<MlDsa65PublicKey>: Sync, RawVecInner: Sync, RawTable<(BytesM<u32::MAX>, ())>: Sync, RawTable<(PublicKey, SCPEnvelope)>: Sync, BoxRaw<MlDsa65Signature>: Sync, RawTable<(PublicKey, ())>: Sync,

§

impl<'a, C, D> Unpin for SlotProto<'a, C, D>
where &'a ConsensusDriver<C, D>: Unpin, &'a LocalState: Unpin, &'a mut SlotState: Unpin,

§

impl<'a, C, D> UnsafeUnpin for SlotProto<'a, C, D>

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

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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> StaticIfNoAlloc for T

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.
Source§

impl<T> WithSubscriber for T

Source§

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
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more