pub struct Address(/* private fields */);Expand description
A Solana address (public key): 32 bytes, transparent layout.
This is part of the Hopper runtime type surface. Backends convert to and from this type at system boundaries.
Implementations§
Source§impl Address
impl Address
Sourcepub const fn new_from_array(bytes: [u8; 32]) -> Address
pub const fn new_from_array(bytes: [u8; 32]) -> Address
Construct from a raw byte array (alias for compatibility).
Source§impl Address
impl Address
Sourcepub fn as_upstream<T>(&self) -> &Twhere
T: TransparentAddress,
pub fn as_upstream<T>(&self) -> &Twhere
T: TransparentAddress,
Zero-cost borrow as a reference to any #[repr(transparent)]
32-byte type that shares layout with [u8; 32].
This is the preferred way to pass a Hopper Address where an
upstream reference is expected (e.g. &pinocchio::Address or
&Pubkey).
§Safety
Safe because Address is #[repr(transparent)] over [u8; 32]
and any upstream 32-byte address type shares this layout.
Sourcepub fn from_upstream<T>(upstream: &T) -> &Addresswhere
T: TransparentAddress,
pub fn from_upstream<T>(upstream: &T) -> &Addresswhere
T: TransparentAddress,
Construct a Hopper Address reference from any #[repr(transparent)]
32-byte address type.
Trait Implementations§
impl Copy for Address
impl Eq for Address
Source§impl Ord for Address
impl Ord for Address
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for Address
impl PartialOrd for Address
impl Pod for Address
impl StructuralPartialEq for Address
impl TransparentAddress for Address
Auto Trait Implementations§
impl Freeze for Address
impl RefUnwindSafe for Address
impl Send for Address
impl Sync for Address
impl Unpin for Address
impl UnsafeUnpin for Address
impl UnwindSafe for Address
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