pub struct BftNode { /* private fields */ }
Expand description
Byzantine fault tolerant node
Implementations§
Source§impl BftNode
impl BftNode
Sourcepub fn new(config: BftConfig, node_id: NodeId, nodes: Vec<NodeInfo>) -> Self
pub fn new(config: BftConfig, node_id: NodeId, nodes: Vec<NodeInfo>) -> Self
Create a new BFT node
Sourcepub fn is_primary(&self) -> bool
pub fn is_primary(&self) -> bool
Check if this node is the primary for the current view
Sourcepub fn get_primary(&self, view: ViewNumber) -> NodeId
pub fn get_primary(&self, view: ViewNumber) -> NodeId
Get the primary node ID for a given view
Sourcepub async fn process_message(
&self,
from: NodeId,
message: BftMessage,
) -> Result<()>
pub async fn process_message( &self, from: NodeId, message: BftMessage, ) -> Result<()>
Process incoming message with enhanced Byzantine detection
Sourcepub fn get_status(&self) -> NodeStatus
pub fn get_status(&self) -> NodeStatus
Get node status information
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BftNode
impl !RefUnwindSafe for BftNode
impl Send for BftNode
impl Sync for BftNode
impl Unpin for BftNode
impl !UnwindSafe for BftNode
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more