Skip to main content

Order

Struct Order 

Source
pub struct Order {
Show 39 fields pub state: u8, pub mode: u8, pub from_balance: bool, pub flags: u8, pub bump: u8, pub decimals: u8, pub reserve_days: u8, pub repo_id: u64, pub issue: u64, pub scope: [u8; 32], pub seq: u32, pub holdback_bps: u16, pub kill_bps: u16, pub amount: u64, pub fee: u64, pub rate: u64, pub paid: u64, pub deadline: i64, pub not_before: i64, pub hold_until: i64, pub warranty_s: i64, pub reserved_by: u64, pub reserved_until: i64, pub cancel_at: i64, pub payee_id: u64, pub funder_id: u64, pub owner_id: u64, pub arbiter_id: u64, pub judge_repo_id: u64, pub source: Pubkey, pub refund_to: Pubkey, pub rent_to: Pubkey, pub mint: Pubkey, pub terms: [u8; 32], pub wf_repo: [u8; 32], pub wf_sha: [u8; 40], pub fee_bps: u16, pub inc: u64, pub grace: bool,
}
Expand description

A work order as knos_pay stores it (512 bytes, version 2). An order that was paid out or refunded is gone.

Fields§

§state: u8§mode: u8§from_balance: bool§flags: u8§bump: u8§decimals: u8§reserve_days: u8§repo_id: u64§issue: u64§scope: [u8; 32]§seq: u32§holdback_bps: u16§kill_bps: u16§amount: u64§fee: u64§rate: u64§paid: u64§deadline: i64§not_before: i64§hold_until: i64§warranty_s: i64§reserved_by: u64§reserved_until: i64§cancel_at: i64§payee_id: u64§funder_id: u64§owner_id: u64§arbiter_id: u64§judge_repo_id: u64§source: Pubkey§refund_to: Pubkey§rent_to: Pubkey§mint: Pubkey§terms: [u8; 32]§wf_repo: [u8; 32]§wf_sha: [u8; 40]§fee_bps: u16§inc: u64

The slot of the order’s funding plus one, which its judges’ markers are bound to (0: funded under 2.1).

§grace: bool

A pay token issued by the deadline is still taken for a grace after it, and no refund is taken before.

Implementations§

Source§

impl Order

Source

pub fn parse(d: &[u8]) -> Option<Order>

The order’s fields, with no check of where the bytes came from: only their length and version.

Source

pub fn read( address: &Pubkey, owner: &Pubkey, data: &[u8], program: &Pubkey, ) -> Option<Order>

An order read ON CHAIN from an account another program was handed: the account’s owner is program, and its address is the one its own fields derive, so nothing else can pass for an order.

Source

pub fn is(&self, flag: u8) -> bool

Source

pub fn token_program(&self) -> Pubkey

Source

pub fn address(&self, program: &Pubkey) -> Pubkey

Source

pub fn refundable(&self, now: i64) -> bool

Whether RefundOrder would be accepted at now: open past the deadline, or held past the hold. (An order with grace is refunded only once its grace has passed as well: this does not count the grace.)

Trait Implementations§

Source§

impl Clone for Order

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Order

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Eq for Order

Source§

impl PartialEq for Order

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for Order

Auto Trait Implementations§

§

impl Freeze for Order

§

impl RefUnwindSafe for Order

§

impl Send for Order

§

impl Sync for Order

§

impl Unpin for Order

§

impl UnsafeUnpin for Order

§

impl UnwindSafe for Order

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
where ST: ?Sized, DT: ?Sized,

Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Read<Exclusive, BecauseExclusive> for T
where T: ?Sized,

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V