Struct spl_token_2022::pod::PodCOption
source · #[repr(C, packed(1))]pub struct PodCOption<T>{ /* private fields */ }
Expand description
COption
Implementations§
source§impl<T> PodCOption<T>
impl<T> PodCOption<T>
sourcepub const NONE: [u8; 4] = _
pub const NONE: [u8; 4] = _
Represents that no value is stored in the option, like Option::None
sourcepub const SOME: [u8; 4] = _
pub const SOME: [u8; 4] = _
Represents that some value is stored in the option, like
Option::Some(v)
sourcepub fn none() -> Self
pub fn none() -> Self
Create a PodCOption equivalent of Option::None
This could be made const
by using std::mem::zeroed
, but that would
require unsafe
code, which is prohibited at the crate level.
Trait Implementations§
source§impl<T> Clone for PodCOption<T>
impl<T> Clone for PodCOption<T>
source§fn clone(&self) -> PodCOption<T>
fn clone(&self) -> PodCOption<T>
Returns a copy 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 for PodCOption<T>
impl<T> Debug for PodCOption<T>
source§impl<T> Default for PodCOption<T>
impl<T> Default for PodCOption<T>
source§fn default() -> PodCOption<T>
fn default() -> PodCOption<T>
Returns the “default value” for a type. Read more
source§impl<T> PartialEq for PodCOption<T>
impl<T> PartialEq for PodCOption<T>
source§fn eq(&self, other: &PodCOption<T>) -> bool
fn eq(&self, other: &PodCOption<T>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl TryFrom<PodCOption<Pubkey>> for OptionalNonZeroPubkey
impl TryFrom<PodCOption<Pubkey>> for OptionalNonZeroPubkey
§type Error = ProgramError
type Error = ProgramError
The type returned in the event of a conversion error.
source§impl<T> Zeroable for PodCOption<T>
impl<T> Zeroable for PodCOption<T>
impl<T> Copy for PodCOption<T>
impl<T> Pod for PodCOption<T>
impl<T> StructuralPartialEq for PodCOption<T>
Auto Trait Implementations§
impl<T> Freeze for PodCOption<T>where
T: Freeze,
impl<T> RefUnwindSafe for PodCOption<T>where
T: RefUnwindSafe,
impl<T> Send for PodCOption<T>where
T: Send,
impl<T> Sync for PodCOption<T>where
T: Sync,
impl<T> Unpin for PodCOption<T>where
T: Unpin,
impl<T> UnwindSafe for PodCOption<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> CheckedBitPattern for Twhere
T: AnyBitPattern,
impl<T> CheckedBitPattern for Twhere
T: AnyBitPattern,
§type Bits = T
type Bits = T
Self
must have the same layout as the specified Bits
except for
the possible invalid bit patterns being checked during
is_valid_bit_pattern
.source§fn is_valid_bit_pattern(_bits: &T) -> bool
fn is_valid_bit_pattern(_bits: &T) -> bool
If this function returns true, then it must be valid to reinterpret
bits
as &Self
.source§impl<T> CloneToUninit for Twhere
T: Copy,
impl<T> CloneToUninit for Twhere
T: Copy,
source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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