pub struct ArrayDiscriminator(/* private fields */);Expand description
Array Discriminator type
Implementations§
Source§impl ArrayDiscriminator
impl ArrayDiscriminator
Sourcepub const UNINITIALIZED: ArrayDiscriminator
pub const UNINITIALIZED: ArrayDiscriminator
Uninitialized variant of a discriminator
Sourcepub const fn new(value: [u8; 8]) -> ArrayDiscriminator
pub const fn new(value: [u8; 8]) -> ArrayDiscriminator
Creates a discriminator from an array
Sourcepub fn new_with_hash_input(hash_input: &str) -> ArrayDiscriminator
pub fn new_with_hash_input(hash_input: &str) -> ArrayDiscriminator
Creates a new ArrayDiscriminator from some hash input string literal
Trait Implementations§
Source§impl AsRef<[u8]> for ArrayDiscriminator
impl AsRef<[u8]> for ArrayDiscriminator
Source§impl Clone for ArrayDiscriminator
impl Clone for ArrayDiscriminator
Source§fn clone(&self) -> ArrayDiscriminator
fn clone(&self) -> ArrayDiscriminator
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 moreimpl Copy for ArrayDiscriminator
Source§impl Debug for ArrayDiscriminator
impl Debug for ArrayDiscriminator
Source§impl Default for ArrayDiscriminator
impl Default for ArrayDiscriminator
Source§fn default() -> ArrayDiscriminator
fn default() -> ArrayDiscriminator
Returns the “default value” for a type. Read more
Source§impl From<u64> for ArrayDiscriminator
impl From<u64> for ArrayDiscriminator
Source§fn from(from: u64) -> ArrayDiscriminator
fn from(from: u64) -> ArrayDiscriminator
Converts to this type from the input type.
Source§impl PartialEq for ArrayDiscriminator
impl PartialEq for ArrayDiscriminator
Source§fn eq(&self, other: &ArrayDiscriminator) -> bool
fn eq(&self, other: &ArrayDiscriminator) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Pod for ArrayDiscriminator
impl StructuralPartialEq for ArrayDiscriminator
Source§impl TryFrom<&[u8]> for ArrayDiscriminator
impl TryFrom<&[u8]> for ArrayDiscriminator
Source§type Error = ProgramError
type Error = ProgramError
The type returned in the event of a conversion error.
Source§fn try_from(
a: &[u8],
) -> Result<ArrayDiscriminator, <ArrayDiscriminator as TryFrom<&[u8]>>::Error>
fn try_from( a: &[u8], ) -> Result<ArrayDiscriminator, <ArrayDiscriminator as TryFrom<&[u8]>>::Error>
Performs the conversion.
Auto Trait Implementations§
impl Freeze for ArrayDiscriminator
impl RefUnwindSafe for ArrayDiscriminator
impl Send for ArrayDiscriminator
impl Sync for ArrayDiscriminator
impl Unpin for ArrayDiscriminator
impl UnsafeUnpin for ArrayDiscriminator
impl UnwindSafe for ArrayDiscriminator
Blanket Implementations§
impl<T> AnyBitPattern for Twhere
T: Pod,
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> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Casts the value.
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<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Casts the value.
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere
Dst: LosslessTryFrom<Src>,
Source§fn lossless_try_into(self) -> Option<Dst>
fn lossless_try_into(self) -> Option<Dst>
Performs the conversion.
Source§impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
impl<Src, Dst> LossyInto<Dst> for Srcwhere
Dst: LossyFrom<Src>,
Source§fn lossy_into(self) -> Dst
fn lossy_into(self) -> Dst
Performs the conversion.
impl<T> NoUninit for Twhere
T: Pod,
Source§impl<T> OverflowingAs for T
impl<T> OverflowingAs for T
Source§fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
fn overflowing_as<Dst>(self) -> (Dst, bool)where
T: OverflowingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere
Src: OverflowingCast<Dst>,
Source§fn overflowing_cast_from(src: Src) -> (Dst, bool)
fn overflowing_cast_from(src: Src) -> (Dst, bool)
Casts the value.
Source§impl<T> SaturatingAs for T
impl<T> SaturatingAs for T
Source§fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
fn saturating_as<Dst>(self) -> Dstwhere
T: SaturatingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere
Src: SaturatingCast<Dst>,
Source§fn saturating_cast_from(src: Src) -> Dst
fn saturating_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> UnwrappedAs for T
impl<T> UnwrappedAs for T
Source§fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
fn unwrapped_as<Dst>(self) -> Dstwhere
T: UnwrappedCast<Dst>,
Casts the value.
Source§impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere
Src: UnwrappedCast<Dst>,
Source§fn unwrapped_cast_from(src: Src) -> Dst
fn unwrapped_cast_from(src: Src) -> Dst
Casts the value.
Source§impl<T> WrappingAs for T
impl<T> WrappingAs for T
Source§fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
fn wrapping_as<Dst>(self) -> Dstwhere
T: WrappingCast<Dst>,
Casts the value.
Source§impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere
Src: WrappingCast<Dst>,
Source§fn wrapping_cast_from(src: Src) -> Dst
fn wrapping_cast_from(src: Src) -> Dst
Casts the value.