#[repr(C)]pub enum FutureEpoch<T> {
None,
One(T),
Two(T),
}Expand description
Wrapper type that “counts down” epochs, which is Borsh-compatible with the
native Option
Variants§
None
Nothing is set
One(T)
Value is ready after the next epoch boundary
Two(T)
Value is ready after two epoch boundaries
Implementations§
Source§impl<T> FutureEpoch<T>
impl<T> FutureEpoch<T>
Source§impl<T: Clone> FutureEpoch<T>
impl<T: Clone> FutureEpoch<T>
Trait Implementations§
Source§impl<T> BorshDeserialize for FutureEpoch<T>where
T: BorshDeserialize,
impl<T> BorshDeserialize for FutureEpoch<T>where
T: BorshDeserialize,
fn deserialize_reader<__R: Read>(reader: &mut __R) -> Result<Self, Error>
Source§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
Deserializes this instance from a given slice of bytes.
Updates the buffer to point at the remaining bytes.
Source§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
Deserialize this instance from a slice of bytes.
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
Source§impl<T> BorshSchema for FutureEpoch<T>where
T: BorshSchema,
impl<T> BorshSchema for FutureEpoch<T>where
T: BorshSchema,
Source§fn declaration() -> Declaration
fn declaration() -> Declaration
Get the name of the type without brackets.
Source§fn add_definitions_recursively(
definitions: &mut BTreeMap<Declaration, Definition>,
)
fn add_definitions_recursively( definitions: &mut BTreeMap<Declaration, Definition>, )
Recursively, using DFS, add type definitions required for this type.
Type definition partially explains how to serialize/deserialize a type.
Source§impl<T> BorshSerialize for FutureEpoch<T>where
T: BorshSerialize,
impl<T> BorshSerialize for FutureEpoch<T>where
T: BorshSerialize,
Source§impl<T: Clone> Clone for FutureEpoch<T>
impl<T: Clone> Clone for FutureEpoch<T>
Source§fn clone(&self) -> FutureEpoch<T>
fn clone(&self) -> FutureEpoch<T>
Returns a duplicate of the value. Read more
1.0.0 · 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> Debug for FutureEpoch<T>
impl<T: Debug> Debug for FutureEpoch<T>
Source§impl<T> Default for FutureEpoch<T>
impl<T> Default for FutureEpoch<T>
Source§impl<T> EnumExt for FutureEpoch<T>where
T: BorshDeserialize,
impl<T> EnumExt for FutureEpoch<T>where
T: BorshDeserialize,
Source§impl<T> From<FutureEpoch<T>> for Option<T>
impl<T> From<FutureEpoch<T>> for Option<T>
Source§fn from(v: FutureEpoch<T>) -> Option<T>
fn from(v: FutureEpoch<T>) -> Option<T>
Converts to this type from the input type.
Source§impl<T: PartialEq> PartialEq for FutureEpoch<T>
impl<T: PartialEq> PartialEq for FutureEpoch<T>
impl<T: Copy> Copy for FutureEpoch<T>
impl<T> StructuralPartialEq for FutureEpoch<T>
Auto Trait Implementations§
impl<T> Freeze for FutureEpoch<T>where
T: Freeze,
impl<T> RefUnwindSafe for FutureEpoch<T>where
T: RefUnwindSafe,
impl<T> Send for FutureEpoch<T>where
T: Send,
impl<T> Sync for FutureEpoch<T>where
T: Sync,
impl<T> Unpin for FutureEpoch<T>where
T: Unpin,
impl<T> UnwindSafe for FutureEpoch<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
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