#[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§impl TryFrom<PodCOption<Pubkey>> for OptionalNonZeroPubkey
impl TryFrom<PodCOption<Pubkey>> for OptionalNonZeroPubkey
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,
Source§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: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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> 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