pub struct Pubkey(/* private fields */);Expand description
The address of a Solana account.
This is a thin copy of the [solana_pubkey::Pubkey] type, used to force more efficient
encoding when using serde.
This can be easily converted to and from the [solana_pubkey::Pubkey] type if the
solana-pubkey-convert feature is enabled.
Implementations§
Source§impl Pubkey
impl Pubkey
Sourcepub const fn new_from_array(pubkey_array: [u8; 32]) -> Pubkey
pub const fn new_from_array(pubkey_array: [u8; 32]) -> Pubkey
Constructs a new Pubkey from the given byte array.
Sourcepub const fn from_str_const(s: &str) -> Pubkey
pub const fn from_str_const(s: &str) -> Pubkey
Decode a string into a Pubkey in a const context.
Not as efficient as the standard FromStr implementation, so should generally only be used
for compile-time constants.
§Panics
This function will panic if the input value is not a valid base58 string encoding exactly 32 bytes.
§Examples
use titan_api_types::common::Pubkey;
let sol = Pubkey::from_str_const("So11111111111111111111111111111111111111111");Trait Implementations§
Source§impl<'de> Deserialize<'de> for Pubkey
impl<'de> Deserialize<'de> for Pubkey
Source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<Pubkey, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<Pubkey, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Source§impl Hash for Pubkey
Custom implementation of Hash for Pubkey.
This allows us to skip hashing the length of the pubkey, which is always the same.
impl Hash for Pubkey
Custom implementation of Hash for Pubkey. This allows us to skip hashing the length of the pubkey, which is always the same.
Implementation taken from [solana_pubkey::Pubkey]’s Hash implementation.
Source§impl Ord for Pubkey
impl Ord for Pubkey
Source§impl PartialOrd for Pubkey
impl PartialOrd for Pubkey
Source§impl Serialize for Pubkey
impl Serialize for Pubkey
Source§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl Copy for Pubkey
impl Eq for Pubkey
impl StructuralPartialEq for Pubkey
Auto Trait Implementations§
impl Freeze for Pubkey
impl RefUnwindSafe for Pubkey
impl Send for Pubkey
impl Sync for Pubkey
impl Unpin for Pubkey
impl UnwindSafe for Pubkey
Blanket Implementations§
Source§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
Source§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
Source§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
Source§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.