pub struct MmpPeerState {
pub sender: SenderState,
pub receiver: ReceiverState,
pub metrics: MmpMetrics,
pub spin_bit: SpinBitState,
/* private fields */
}Expand description
Combined MMP state for a single peer link.
Wraps sender, receiver, metrics, and spin bit state. One instance
per ActivePeer.
Fields§
§sender: SenderState§receiver: ReceiverState§metrics: MmpMetrics§spin_bit: SpinBitStateImplementations§
Source§impl MmpPeerState
impl MmpPeerState
Sourcepub fn new(config: &MmpConfig, is_initiator: bool) -> Self
pub fn new(config: &MmpConfig, is_initiator: bool) -> Self
Create MMP state for a new peer link.
is_initiator: true if this node initiated the Noise handshake
(determines spin bit role).
Sourcepub fn reset_for_rekey(&mut self, now: Instant)
pub fn reset_for_rekey(&mut self, now: Instant)
Reset counter-dependent state for rekey cutover.
Sourcepub fn should_log(&self, now: Instant) -> bool
pub fn should_log(&self, now: Instant) -> bool
Check if it’s time to emit a periodic metrics log.
Sourcepub fn mark_logged(&mut self, now: Instant)
pub fn mark_logged(&mut self, now: Instant)
Mark that a periodic log was emitted.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MmpPeerState
impl RefUnwindSafe for MmpPeerState
impl Send for MmpPeerState
impl Sync for MmpPeerState
impl Unpin for MmpPeerState
impl UnsafeUnpin for MmpPeerState
impl UnwindSafe for MmpPeerState
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> 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