pub struct RequireValidTime;Expand description
Rejects a signed Interest whose signature timestamp isn’t strictly greater than the last one seen from the same signer, and rejects signed Interests with no timestamp. Unsigned Interests are always accepted.
This is a lighter-weight alternative to RequireValidNonce: it
only needs one timestamp per signer rather than a window of recent
nonces, at the cost of requiring signers to send strictly increasing
timestamps (fine for a live clock, but unlike nonces it can’t
tolerate reordering). The first Interest seen from a signer is
compared against now - GRACE_PERIOD rather than accepted
unconditionally, so a timestamp more than a minute old is still
rejected even on the first sighting.
Implementations§
Source§impl RequireValidTime
impl RequireValidTime
pub fn new() -> RequireValidTime
Trait Implementations§
Source§impl Clone for RequireValidTime
impl Clone for RequireValidTime
Source§fn clone(&self) -> RequireValidTime
fn clone(&self) -> RequireValidTime
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for RequireValidTime
Source§impl Debug for RequireValidTime
impl Debug for RequireValidTime
Source§impl Default for RequireValidTime
impl Default for RequireValidTime
Source§fn default() -> RequireValidTime
fn default() -> RequireValidTime
Returns the “default value” for a type. Read more
Source§impl Hash for RequireValidTime
impl Hash for RequireValidTime
Source§impl InterestVerifier for RequireValidTime
impl InterestVerifier for RequireValidTime
fn verify<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
interest: &'life1 Interest<Bytes>,
context: Arc<RwLock<TypeMap>>,
_app_handler: AppHandler,
_signature_verifiers: &'life2 (dyn ToVerifier + Sync),
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Auto Trait Implementations§
impl Freeze for RequireValidTime
impl RefUnwindSafe for RequireValidTime
impl Send for RequireValidTime
impl Sync for RequireValidTime
impl Unpin for RequireValidTime
impl UnsafeUnpin for RequireValidTime
impl UnwindSafe for RequireValidTime
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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