pub struct PeerSession { /* private fields */ }Expand description
One established peering session, as the serving side tracks it: the verified peer, whether it has been cut off, and what it delivered when.
Implementations§
Source§impl PeerSession
impl PeerSession
Sourcepub fn new(peer: &VerifiedPeer) -> Self
pub fn new(peer: &VerifiedPeer) -> Self
A session with the peer the handshake verified.
Authorize the peer’s next request against the trust pinned now: the directory must still chain to the IK without rolling back, and the peer must still be enrolled and un-revoked. A refusal cuts the session off for good, so a later request is refused even if a caller retries with older trust.
Sourcepub fn record_delivery(&mut self, asset: Uuid, received_at: Timestamp)
pub fn record_delivery(&mut self, asset: Uuid, received_at: Timestamp)
Record that the peer delivered asset at received_at.
Sourcepub fn quarantined_deliveries(&self, trust: &PinnedTrust) -> Vec<Uuid>
pub fn quarantined_deliveries(&self, trust: &PinnedTrust) -> Vec<Uuid>
The assets this peer delivered at or after its revocation took effect under trust —
everything to quarantine. Empty while the peer is un-revoked. A peer absent from the
directory, or revoked at a time that does not parse, has every delivery quarantined
(fail closed).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PeerSession
impl RefUnwindSafe for PeerSession
impl Send for PeerSession
impl Sync for PeerSession
impl Unpin for PeerSession
impl UnsafeUnpin for PeerSession
impl UnwindSafe for PeerSession
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
§unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ
unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ
Arc<> Read more§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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