pub struct EncodedOrderAccount(/* private fields */);Expand description
Canonical 201-byte representation of an OrderAccount. The bytes
written to/read from the order PDA’s data area.
Layout: one character per byte, cell widths proportional to field size,
each divider belongs to the cell on its right. Integers are little-endian
(Anchor/Borsh convention). The intent slot holds a verbatim
EncodedOrderIntent; see that type’s docs for its inner layout.
┌───── discriminator
│┌──── bump
││┌─── cancelled
┌┬┬┬───────┬───────┬───────────────────────────────┬─────────────────...─────────────────┐
││││amount_│amount_│ │ │
││││with- │re- │ created_by │ intent (EncodedOrderIntent) │
││││drawn │ceived │ │ │
└┴┴┴───────┴───────┴───────────────────────────────┴─────────────────...─────────────────┘
0 1 2 3 11 19 51 ... 201Implementations§
Source§impl EncodedOrderAccount
impl EncodedOrderAccount
pub const SIZE: usize = 201
Sourcepub const DISCRIMINATOR: u8
pub const DISCRIMINATOR: u8
Single-byte account discriminator. See crate::SettlementAccount.
Sourcepub fn decode_and_hash(
bytes: &[u8; 201],
) -> Result<(OrderAccount, Hash), ProgramError>
pub fn decode_and_hash( bytes: &[u8; 201], ) -> Result<(OrderAccount, Hash), ProgramError>
Decode the account body and compute the embedded intent’s UID in one
shot, mirroring EncodedOrderIntent::decode_and_hash. Decoding
validates the discriminator and the intent; returns
ProgramError::InvalidAccountData on a decode error.
Trait Implementations§
Source§impl Clone for EncodedOrderAccount
impl Clone for EncodedOrderAccount
Source§fn clone(&self) -> EncodedOrderAccount
fn clone(&self) -> EncodedOrderAccount
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 moreSource§impl Debug for EncodedOrderAccount
impl Debug for EncodedOrderAccount
Source§impl Deref for EncodedOrderAccount
impl Deref for EncodedOrderAccount
impl Eq for EncodedOrderAccount
Source§impl From<EncodedOrderAccount> for [u8; 201]
impl From<EncodedOrderAccount> for [u8; 201]
Source§fn from(encoded: EncodedOrderAccount) -> Self
fn from(encoded: EncodedOrderAccount) -> Self
Converts to this type from the input type.
Source§impl From<OrderAccount> for EncodedOrderAccount
impl From<OrderAccount> for EncodedOrderAccount
Source§fn from(account: OrderAccount) -> Self
fn from(account: OrderAccount) -> Self
Converts to this type from the input type.
Source§impl PartialEq for EncodedOrderAccount
impl PartialEq for EncodedOrderAccount
impl StructuralPartialEq for EncodedOrderAccount
Source§impl TryFrom<EncodedOrderAccount> for OrderAccount
impl TryFrom<EncodedOrderAccount> for OrderAccount
Source§type Error = ProgramError
type Error = ProgramError
The type returned in the event of a conversion error.
Auto Trait Implementations§
impl Freeze for EncodedOrderAccount
impl RefUnwindSafe for EncodedOrderAccount
impl Send for EncodedOrderAccount
impl Sync for EncodedOrderAccount
impl Unpin for EncodedOrderAccount
impl UnsafeUnpin for EncodedOrderAccount
impl UnwindSafe for EncodedOrderAccount
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