pub struct LockedItem<T: BorshDeserialize + BorshSerialize + MaxSerializedLen> {
pub item: T,
pub expires: UnixTimestamp,
}Fields§
§item: T§expires: UnixTimestampImplementations§
Source§impl<T> LockedItem<T>
impl<T> LockedItem<T>
pub fn expired(&self, current_time: UnixTimestamp) -> bool
Trait Implementations§
Source§impl<T> BorshDeserialize for LockedItem<T>where
T: BorshDeserialize + BorshDeserialize + BorshSerialize + MaxSerializedLen,
UnixTimestamp: BorshDeserialize,
impl<T> BorshDeserialize for LockedItem<T>where
T: BorshDeserialize + BorshDeserialize + BorshSerialize + MaxSerializedLen,
UnixTimestamp: BorshDeserialize,
Source§impl<T> BorshSerialize for LockedItem<T>where
T: BorshSerialize + BorshDeserialize + BorshSerialize + MaxSerializedLen,
UnixTimestamp: BorshSerialize,
impl<T> BorshSerialize for LockedItem<T>where
T: BorshSerialize + BorshDeserialize + BorshSerialize + MaxSerializedLen,
UnixTimestamp: BorshSerialize,
Source§impl<T: Clone + BorshDeserialize + BorshSerialize + MaxSerializedLen> Clone for LockedItem<T>
impl<T: Clone + BorshDeserialize + BorshSerialize + MaxSerializedLen> Clone for LockedItem<T>
Source§fn clone(&self) -> LockedItem<T>
fn clone(&self) -> LockedItem<T>
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 moreSource§impl<T: Debug + BorshDeserialize + BorshSerialize + MaxSerializedLen> Debug for LockedItem<T>
impl<T: Debug + BorshDeserialize + BorshSerialize + MaxSerializedLen> Debug for LockedItem<T>
impl<T> Eq for LockedItem<T>
Source§impl<T> MaxSerializedLen for LockedItem<T>
impl<T> MaxSerializedLen for LockedItem<T>
const MAX_SERIALIZED_LEN: usize
Source§impl<T> Ord for LockedItem<T>
impl<T> Ord for LockedItem<T>
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<T> PartialEq for LockedItem<T>
impl<T> PartialEq for LockedItem<T>
Source§impl<T> PartialOrd for LockedItem<T>
impl<T> PartialOrd for LockedItem<T>
Auto Trait Implementations§
impl<T> Freeze for LockedItem<T>where
T: Freeze,
impl<T> RefUnwindSafe for LockedItem<T>where
T: RefUnwindSafe,
impl<T> Send for LockedItem<T>where
T: Send,
impl<T> Sync for LockedItem<T>where
T: Sync,
impl<T> Unpin for LockedItem<T>where
T: Unpin,
impl<T> UnsafeUnpin for LockedItem<T>where
T: UnsafeUnpin,
impl<T> UnwindSafe for LockedItem<T>where
T: UnwindSafe,
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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