pub struct EngineState {
pub msg_max_size: u32,
/* private fields */
}Expand description
Identity discovered for a remote authoritative engine, with optional HMAC-established trusted time.
Fields§
§msg_max_size: u32Maximum message size the remote engine can accept.
Implementations§
Source§impl EngineState
impl EngineState
Sourcepub fn new(engine_id: Bytes, engine_boots: u32, engine_time: u32) -> Self
pub fn new(engine_id: Bytes, engine_boots: u32, engine_time: u32) -> Self
Create engine state whose boots/time are already authenticated.
Sourcepub fn discovered(engine_id: Bytes, msg_max_size: u32) -> Self
pub fn discovered(engine_id: Bytes, msg_max_size: u32) -> Self
Create an identity learned through unauthenticated discovery.
Sourcepub fn with_msg_max_size(
engine_id: Bytes,
engine_boots: u32,
engine_time: u32,
msg_max_size: u32,
) -> Self
pub fn with_msg_max_size( engine_id: Bytes, engine_boots: u32, engine_time: u32, msg_max_size: u32, ) -> Self
Create authenticated state with explicit msgMaxSize.
Sourcepub fn with_msg_max_size_capped(
engine_id: Bytes,
engine_boots: u32,
engine_time: u32,
reported_msg_max_size: u32,
session_max: u32,
) -> Self
pub fn with_msg_max_size_capped( engine_id: Bytes, engine_boots: u32, engine_time: u32, reported_msg_max_size: u32, session_max: u32, ) -> Self
Create authenticated state with msgMaxSize capped to a session limit.
Sourcepub fn trusted_time(&self) -> Option<&TrustedEngineTime>
pub fn trusted_time(&self) -> Option<&TrustedEngineTime>
Return the HMAC-established trusted time, if synchronization occurred.
Sourcepub fn estimated_boots_time(&self) -> (u32, u32)
pub fn estimated_boots_time(&self) -> (u32, u32)
Return the progressing trusted boots/time pair, or (0, 0) before the
first authenticated message establishes a notion.
Sourcepub fn estimated_time(&self) -> u32
pub fn estimated_time(&self) -> u32
Retained convenience accessor for the estimated time component.
Sourcepub fn update_time(&mut self, response_boots: u32, response_time: u32) -> bool
pub fn update_time(&mut self, response_boots: u32, response_time: u32) -> bool
Apply a forward-only authenticated high-water update.
The caller must have verified the message HMAC and engine identity.
Sourcepub fn check_and_update_timeliness(
&mut self,
msg_boots: u32,
msg_time: u32,
) -> bool
pub fn check_and_update_timeliness( &mut self, msg_boots: u32, msg_time: u32, ) -> bool
Apply RFC 3414 Step 7(b) and evaluate the asymmetric time window. The caller must first verify the message HMAC and engine identity.
Sourcepub fn is_in_time_window(&self, msg_boots: u32, msg_time: u32) -> bool
pub fn is_in_time_window(&self, msg_boots: u32, msg_time: u32) -> bool
Check the authoritative-role symmetric window against trusted time.
Trait Implementations§
Source§impl Clone for EngineState
impl Clone for EngineState
Source§fn clone(&self) -> EngineState
fn clone(&self) -> EngineState
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl !Freeze for EngineState
impl RefUnwindSafe for EngineState
impl Send for EngineState
impl Sync for EngineState
impl Unpin for EngineState
impl UnsafeUnpin for EngineState
impl UnwindSafe for EngineState
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
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> ⓘ
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> ⓘ
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