pub struct BanEntry {
pub key: AddressKey,
pub reason: PenaltyReason,
pub created_at: Instant,
pub expires_at: Option<Instant>,
}Expand description
Ban entry stored in the ban list
Fields§
§key: AddressKeyAddress key that is banned
reason: PenaltyReasonReason for the ban
created_at: InstantWhen the ban was created
expires_at: Option<Instant>When the ban expires (None = permanent)
Implementations§
Source§impl BanEntry
impl BanEntry
Sourcepub fn is_expired(&self) -> bool
pub fn is_expired(&self) -> bool
Check if this ban has expired
Sourcepub fn remaining_duration(&self) -> Option<Duration>
pub fn remaining_duration(&self) -> Option<Duration>
Get remaining duration until ban expires
Trait Implementations§
Auto Trait Implementations§
impl Freeze for BanEntry
impl RefUnwindSafe for BanEntry
impl Send for BanEntry
impl Sync for BanEntry
impl Unpin for BanEntry
impl UnsafeUnpin for BanEntry
impl UnwindSafe for BanEntry
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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> 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>
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