#[repr(C, packed(1))]pub struct EscrowOrder {
pub payer: [u8; 32],
pub amount: u64,
pub mail_id: [u64; 2],
pub created_at: i64,
pub timeout_at: i64,
pub is_usdc: bool,
pub delivered: bool,
pub bump: u8,
}Expand description
Escrow order state - holds payment until delivery confirmed
Fields§
§payer: [u8; 32]Public key of the payer who created this escrow
amount: u64Amount in lamports (SOL) or token units (USDC)
mail_id: [u64; 2]Unique 128-bit mail order ID (split into two u64s)
created_at: i64Unix timestamp when escrow was created
timeout_at: i64Unix timestamp after which refund is allowed
is_usdc: boolPayment type: false = SOL, true = USDC
delivered: boolWhether delivery has been confirmed
bump: u8PDA bump seed for this escrow
Implementations§
Source§impl EscrowOrder
impl EscrowOrder
Sourcepub fn from_bytes(data: &[u8]) -> Result<&Self, SolMailError>
pub fn from_bytes(data: &[u8]) -> Result<&Self, SolMailError>
Zero-copy parse from account data
Sourcepub fn from_bytes_mut(data: &mut [u8]) -> Result<&mut Self, SolMailError>
pub fn from_bytes_mut(data: &mut [u8]) -> Result<&mut Self, SolMailError>
Zero-copy mutable parse from account data
Sourcepub fn mail_id_bytes(&self) -> [u8; 16]
pub fn mail_id_bytes(&self) -> [u8; 16]
Get the 128-bit mail_id as bytes (for PDA derivation)
Sourcepub fn is_timed_out(&self, current_time: i64) -> bool
pub fn is_timed_out(&self, current_time: i64) -> bool
Check if the escrow has timed out
Trait Implementations§
Source§impl Clone for EscrowOrder
impl Clone for EscrowOrder
Source§fn clone(&self) -> EscrowOrder
fn clone(&self) -> EscrowOrder
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 EscrowOrder
impl Debug for EscrowOrder
impl Copy for EscrowOrder
Auto Trait Implementations§
impl Freeze for EscrowOrder
impl RefUnwindSafe for EscrowOrder
impl Send for EscrowOrder
impl Sync for EscrowOrder
impl Unpin for EscrowOrder
impl UnsafeUnpin for EscrowOrder
impl UnwindSafe for EscrowOrder
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