pub struct MmpSessionState {
pub sender: SenderState,
pub receiver: ReceiverState,
pub metrics: MmpMetrics,
pub spin_bit: SpinBitState,
pub path_mtu: PathMtuState,
/* private fields */
}Expand description
Combined MMP state for a single end-to-end session.
Wraps sender, receiver, metrics, spin bit, and path MTU state.
One instance per established SessionEntry.
Fields§
§sender: SenderState§receiver: ReceiverState§metrics: MmpMetrics§spin_bit: SpinBitState§path_mtu: PathMtuStateImplementations§
Source§impl MmpSessionState
impl MmpSessionState
Sourcepub fn new(config: &SessionMmpConfig, is_initiator: bool) -> Self
pub fn new(config: &SessionMmpConfig, is_initiator: bool) -> Self
Create MMP state for a new session.
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 MmpSessionState
impl RefUnwindSafe for MmpSessionState
impl Send for MmpSessionState
impl Sync for MmpSessionState
impl Unpin for MmpSessionState
impl UnsafeUnpin for MmpSessionState
impl UnwindSafe for MmpSessionState
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