pub struct UniversalAddress {
pub bytes: [u8; 32],
}Expand description
UniversalAddress represents a 32-byte address that can be used across different chains
Fields§
§bytes: [u8; 32]The raw 32-byte address
Implementations§
Source§impl UniversalAddress
impl UniversalAddress
Sourcepub fn from_pubkey(pubkey: &Pubkey) -> Self
pub fn from_pubkey(pubkey: &Pubkey) -> Self
Creates a UniversalAddress from a Solana Pubkey
Sourcepub fn from_bytes(bytes: [u8; 32]) -> Self
pub fn from_bytes(bytes: [u8; 32]) -> Self
Creates a UniversalAddress from raw bytes
Trait Implementations§
Source§impl BorshDeserialize for UniversalAddress
impl BorshDeserialize for UniversalAddress
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 BorshSerialize for UniversalAddress
impl BorshSerialize for UniversalAddress
Source§impl Clone for UniversalAddress
impl Clone for UniversalAddress
Source§fn clone(&self) -> UniversalAddress
fn clone(&self) -> UniversalAddress
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 Debug for UniversalAddress
impl Debug for UniversalAddress
Source§impl Default for UniversalAddress
impl Default for UniversalAddress
Source§fn default() -> UniversalAddress
fn default() -> UniversalAddress
Returns the “default value” for a type. Read more
Source§impl From<Pubkey> for UniversalAddress
impl From<Pubkey> for UniversalAddress
Source§impl From<UniversalAddress> for Pubkey
impl From<UniversalAddress> for Pubkey
Source§fn from(addr: UniversalAddress) -> Self
fn from(addr: UniversalAddress) -> Self
Converts to this type from the input type.
Source§impl PartialEq for UniversalAddress
impl PartialEq for UniversalAddress
Source§impl Space for UniversalAddress
impl Space for UniversalAddress
const INIT_SPACE: usize = 32usize
impl Copy for UniversalAddress
impl Eq for UniversalAddress
impl StructuralPartialEq for UniversalAddress
Auto Trait Implementations§
impl Freeze for UniversalAddress
impl RefUnwindSafe for UniversalAddress
impl Send for UniversalAddress
impl Sync for UniversalAddress
impl Unpin for UniversalAddress
impl UnwindSafe for UniversalAddress
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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