pub struct Timelock<T: BorshDeserialize + BorshSerialize + MaxSerializedLen, const N: usize>(/* private fields */);Implementations§
Source§impl<T, const N: usize> Timelock<T, N>
impl<T, const N: usize> Timelock<T, N>
pub fn new() -> Self
pub fn lock( &mut self, item: T, expiration_date: UnixTimestamp, ) -> Result<(), TimelockError>
pub fn locked_items(&self) -> &Vec<LockedItem<T>>
pub fn locked_items_mut(&mut self) -> &mut Vec<LockedItem<T>>
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn max_len(&self) -> usize
Trait Implementations§
Source§impl<T: BorshDeserialize + BorshSerialize + MaxSerializedLen, const N: usize> BorshDeserialize for Timelock<T, N>
impl<T: BorshDeserialize + BorshSerialize + MaxSerializedLen, const N: usize> BorshDeserialize for Timelock<T, N>
Source§impl<T: BorshDeserialize + BorshSerialize + MaxSerializedLen, const N: usize> BorshSerialize for Timelock<T, N>
impl<T: BorshDeserialize + BorshSerialize + MaxSerializedLen, const N: usize> BorshSerialize for Timelock<T, N>
Source§impl<T: Clone + BorshDeserialize + BorshSerialize + MaxSerializedLen, const N: usize> Clone for Timelock<T, N>
impl<T: Clone + BorshDeserialize + BorshSerialize + MaxSerializedLen, const N: usize> Clone for Timelock<T, N>
Source§impl<T: Debug + BorshDeserialize + BorshSerialize + MaxSerializedLen, const N: usize> Debug for Timelock<T, N>
impl<T: Debug + BorshDeserialize + BorshSerialize + MaxSerializedLen, const N: usize> Debug for Timelock<T, N>
Source§impl<T, const N: usize> MaxSerializedLen for Timelock<T, N>
impl<T, const N: usize> MaxSerializedLen for Timelock<T, N>
const MAX_SERIALIZED_LEN: usize
Auto Trait Implementations§
impl<T, const N: usize> Freeze for Timelock<T, N>
impl<T, const N: usize> RefUnwindSafe for Timelock<T, N>where
T: RefUnwindSafe,
impl<T, const N: usize> Send for Timelock<T, N>where
T: Send,
impl<T, const N: usize> Sync for Timelock<T, N>where
T: Sync,
impl<T, const N: usize> Unpin for Timelock<T, N>where
T: Unpin,
impl<T, const N: usize> UnsafeUnpin for Timelock<T, N>
impl<T, const N: usize> UnwindSafe for Timelock<T, N>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<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