pub struct StellarProto<'a, C: Consensus, D: Driver> {
pub cd: &'a ConsensusDriver<C, D>,
pub state: &'a mut StellarState,
}Fields§
§cd: &'a ConsensusDriver<C, D>§state: &'a mut StellarStateImplementations§
Source§impl<'a, C: Consensus, D: Driver> StellarProto<'a, C, D>
impl<'a, C: Consensus, D: Driver> StellarProto<'a, C, D>
pub fn local_proto(&self) -> LocalProto<'_, C, D>
pub fn local_proto_mut(&mut self) -> LocalProtoMut<'_, C, D>
pub fn slot_proto_or_create( &mut self, slot_index: SlotIndex, ) -> SlotProto<'_, C, D>
pub fn slot_proto( &mut self, slot_index: SlotIndex, ) -> Option<SlotProto<'_, C, D>>
pub fn is_validator(&self) -> bool
Sourcepub fn get_statement_values(
statement: &SCPStatement,
) -> (Vec<SCPValue>, Vec<SCPValue>)
pub fn get_statement_values( statement: &SCPStatement, ) -> (Vec<SCPValue>, Vec<SCPValue>)
returns (nom values, ballot values)
pub fn get_highest_known_slot_index(&self) -> SlotIndex
pub fn nominate( &mut self, slot_index: SlotIndex, value: &SCPValue, prev_value: &SCPValue, ) -> bool
pub fn stop_nomination(&mut self, slot_index: SlotIndex)
pub fn update_local_quorum_set(&mut self, qset: &SCPQuorumSet)
pub fn get_local_quorum_set(&self) -> SCPQuorumSet
pub fn get_local_node_id(&self) -> SCPNodeID
pub fn purge_slots( &mut self, max_slot_index: SlotIndex, slot_to_keep: SlotIndex, )
pub fn get_json_info(&mut self, limit: usize, full_keys: bool) -> Value
pub fn get_state( &mut self, node: &SCPNodeID, slot_index: SlotIndex, ) -> QuorumInfoNodeState
pub fn get_json_quorum_info( &mut self, id: &SCPNodeID, summary: bool, full_keys: bool, index: SlotIndex, ) -> Value
pub fn is_slot_fully_validated(&mut self, slot_index: SlotIndex) -> bool
pub fn got_vblocking(&mut self, slot_index: SlotIndex) -> bool
pub fn get_known_slots_count(&self) -> usize
pub fn get_cumulative_statement_count(&mut self) -> usize
pub fn get_latest_messages_send( &mut self, slot_index: SlotIndex, ) -> Vec<SCPEnvelope>
pub fn empty(&self) -> bool
pub fn process_current_state<F>( &mut self, slot_index: SlotIndex, f: &mut F, force_self: bool, )
pub fn process_slots_ascending_from<F>( &self, starting_slot: SlotIndex, f: &mut F, )
pub fn process_slots_descending_from<F>( &self, starting_slot: SlotIndex, f: &mut F, )
pub fn get_latest_message(&mut self, id: &SCPNodeID) -> Option<SCPEnvelope>
pub fn is_newer_nomination_or_ballot_st( &mut self, old_st: &SCPStatement, new_st: &SCPStatement, ) -> bool
pub fn get_externalizing_state( &mut self, slot_index: SlotIndex, ) -> Vec<SCPEnvelope>
Sourcepub fn get_externalized_slot_proof(
&mut self,
slot_index: SlotIndex,
) -> Result<Option<ExternalizedSlotProof>, ExternalizedSlotProofError>
pub fn get_externalized_slot_proof( &mut self, slot_index: SlotIndex, ) -> Result<Option<ExternalizedSlotProof>, ExternalizedSlotProofError>
Builds a proof snapshot for slot_index after it externalizes.
Returns Ok(None) only when the slot is unknown or has no externalizing
state yet.
pub fn get_value_string(&self, value: &SCPValue) -> String
pub fn should_process_envelope(&mut self, env: &SCPEnvelope) -> bool
pub fn envelope_to_str(&self, env: &SCPEnvelope, full_keys: bool) -> String
pub fn statement_to_str(&self, st: &SCPStatement, full_keys: bool) -> String
Trait Implementations§
Source§impl<'a, C: Consensus, D: Driver> DriverCb for StellarProto<'a, C, D>
impl<'a, C: Consensus, D: Driver> DriverCb for StellarProto<'a, C, D>
Source§fn received_envelope(&mut self, env: &SCPEnvelope)
fn received_envelope(&mut self, env: &SCPEnvelope)
Processes an envelope received from a peer. The envelope must be
authenticated; see the trait documentation.
Source§fn driver_calling_back(&mut self, cb: DriverCallback)
fn driver_calling_back(&mut self, cb: DriverCallback)
Delivers an expired nomination or ballot timer, with the callback the
driver was given in
Driver::start_timer.Source§fn set_state_from_envelope(
&mut self,
slot_index: SlotIndex,
envelope: &SCPEnvelope,
)
fn set_state_from_envelope( &mut self, slot_index: SlotIndex, envelope: &SCPEnvelope, )
Restores a slot’s state from one of this node’s own earlier envelopes,
for example after a restart. The envelope must be authenticated like
any other.
Auto Trait Implementations§
impl<'a, C, D> !UnwindSafe for StellarProto<'a, C, D>
impl<'a, C, D> Freeze for StellarProto<'a, C, D>where
&'a ConsensusDriver<C, D>: Freeze,
impl<'a, C, D> RefUnwindSafe for StellarProto<'a, C, D>where
&'a ConsensusDriver<C, D>: RefUnwindSafe,
impl<'a, C, D> Send for StellarProto<'a, C, D>where
&'a ConsensusDriver<C, D>: Send,
impl<'a, C, D> Sync for StellarProto<'a, C, D>where
&'a ConsensusDriver<C, D>: Sync,
impl<'a, C, D> Unpin for StellarProto<'a, C, D>where
&'a ConsensusDriver<C, D>: Unpin,
impl<'a, C, D> UnsafeUnpin for StellarProto<'a, C, D>where
&'a ConsensusDriver<C, D>: UnsafeUnpin,
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