pub struct PacketKeyDescriptor {
pub key_id: u32,
pub state: PacketKeyState,
pub created_at: Tick,
pub activated_at: Tick,
pub retires_at: Option<Tick>,
pub expires_at: Option<Tick>,
pub send_priority: u32,
}Expand description
Metadata for one externally managed packet security key.
SectorSync never stores secret material. The descriptor only lets hot-path
packet helpers choose send keys and reject stale receive keys deterministically.
Fields§
§key_id: u32External key identifier carried in packet security envelopes.
state: PacketKeyStateCurrent lifecycle state.
created_at: TickTick at which the embedding system created/imported the key metadata.
activated_at: TickFirst tick at which this key may be used or accepted.
retires_at: Option<Tick>Tick at which the key began retiring, if known.
expires_at: Option<Tick>First tick at which this key must be rejected and can be removed.
send_priority: u32Higher values win when multiple active keys are eligible for send.
Implementations§
Source§impl PacketKeyDescriptor
impl PacketKeyDescriptor
Sourcepub const fn active(key_id: u32, now: Tick, send_priority: u32) -> Self
pub const fn active(key_id: u32, now: Tick, send_priority: u32) -> Self
Creates active key metadata.
Sourcepub const fn with_expiry(self, expires_at: Tick) -> Self
pub const fn with_expiry(self, expires_at: Tick) -> Self
Returns a copy with an expiration tick.
Sourcepub fn is_send_eligible(self, now: Tick) -> bool
pub fn is_send_eligible(self, now: Tick) -> bool
Returns whether the key is active for sending at now.
Sourcepub fn is_accept_eligible(self, now: Tick) -> bool
pub fn is_accept_eligible(self, now: Tick) -> bool
Returns whether the key is accepted for receiving at now.
Trait Implementations§
Source§impl Clone for PacketKeyDescriptor
impl Clone for PacketKeyDescriptor
Source§fn clone(&self) -> PacketKeyDescriptor
fn clone(&self) -> PacketKeyDescriptor
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more