Skip to main content

StellarProto

Struct StellarProto 

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

Implementations§

Source§

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

Source

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

Source

pub fn local_proto_mut(&mut self) -> LocalProtoMut<'_, C, D>

Source

pub fn slot_proto_or_create( &mut self, slot_index: SlotIndex, ) -> SlotProto<'_, C, D>

Source

pub fn slot_proto( &mut self, slot_index: SlotIndex, ) -> Option<SlotProto<'_, C, D>>

Source

pub fn is_validator(&self) -> bool

Source

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

returns (nom values, ballot values)

Source

pub fn get_highest_known_slot_index(&self) -> SlotIndex

Source

pub fn nominate( &mut self, slot_index: SlotIndex, value: &SCPValue, prev_value: &SCPValue, ) -> bool

Source

pub fn stop_nomination(&mut self, slot_index: SlotIndex)

Source

pub fn update_local_quorum_set(&mut self, qset: &SCPQuorumSet)

Source

pub fn get_local_quorum_set(&self) -> SCPQuorumSet

Source

pub fn get_local_node_id(&self) -> SCPNodeID

Source

pub fn purge_slots( &mut self, max_slot_index: SlotIndex, slot_to_keep: SlotIndex, )

Source

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

Source

pub fn get_state( &mut self, node: &SCPNodeID, slot_index: SlotIndex, ) -> QuorumInfoNodeState

Source

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

Source

pub fn is_slot_fully_validated(&mut self, slot_index: SlotIndex) -> bool

Source

pub fn got_vblocking(&mut self, slot_index: SlotIndex) -> bool

Source

pub fn get_known_slots_count(&self) -> usize

Source

pub fn get_cumulative_statement_count(&mut self) -> usize

Source

pub fn get_latest_messages_send( &mut self, slot_index: SlotIndex, ) -> Vec<SCPEnvelope>

Source

pub fn empty(&self) -> bool

Source

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

Source

pub fn process_slots_ascending_from<F>( &self, starting_slot: SlotIndex, f: &mut F, )
where F: FnMut(SlotIndex) -> bool,

Source

pub fn process_slots_descending_from<F>( &self, starting_slot: SlotIndex, f: &mut F, )
where F: FnMut(SlotIndex) -> bool,

Source

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

Source

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

Source

pub fn get_externalizing_state( &mut self, slot_index: SlotIndex, ) -> Vec<SCPEnvelope>

Source

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.

Source

pub fn get_value_string(&self, value: &SCPValue) -> String

Source

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

Source

pub fn envelope_to_str(&self, env: &SCPEnvelope, full_keys: bool) -> String

Source

pub fn statement_to_str(&self, st: &SCPStatement, full_keys: bool) -> String

Trait Implementations§

Source§

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

Source§

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

Formats the value using the given formatter. Read more
Source§

impl<'a, C: Consensus, D: Driver> DriverCb for StellarProto<'a, C, D>

Source§

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)

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, )

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