Struct mostro_core::order::Order
source · pub struct Order {Show 35 fields
pub id: Uuid,
pub kind: String,
pub event_id: String,
pub hash: Option<String>,
pub preimage: Option<String>,
pub creator_pubkey: String,
pub cancel_initiator_pubkey: Option<String>,
pub buyer_pubkey: Option<String>,
pub master_buyer_pubkey: Option<String>,
pub seller_pubkey: Option<String>,
pub master_seller_pubkey: Option<String>,
pub status: String,
pub price_from_api: bool,
pub premium: i64,
pub payment_method: String,
pub amount: i64,
pub min_amount: i64,
pub max_amount: i64,
pub buyer_dispute: bool,
pub seller_dispute: bool,
pub buyer_cooperativecancel: bool,
pub seller_cooperativecancel: bool,
pub fee: i64,
pub routing_fee: i64,
pub fiat_code: String,
pub fiat_amount: i64,
pub buyer_invoice: Option<String>,
pub range_parent_id: Option<Uuid>,
pub invoice_held_at: i64,
pub taken_at: i64,
pub created_at: i64,
pub buyer_sent_rate: bool,
pub seller_sent_rate: bool,
pub failed_payment: bool,
pub payment_attempts: i64,
}Expand description
Database representation of an order
Fields§
§id: Uuid§kind: String§event_id: String§hash: Option<String>§preimage: Option<String>§creator_pubkey: String§cancel_initiator_pubkey: Option<String>§buyer_pubkey: Option<String>§master_buyer_pubkey: Option<String>§seller_pubkey: Option<String>§master_seller_pubkey: Option<String>§status: String§price_from_api: bool§payment_method: String§amount: i64§min_amount: i64§max_amount: i64§buyer_dispute: bool§seller_dispute: bool§buyer_cooperativecancel: bool§seller_cooperativecancel: bool§fee: i64§routing_fee: i64§fiat_code: String§fiat_amount: i64§buyer_invoice: Option<String>§range_parent_id: Option<Uuid>§invoice_held_at: i64§taken_at: i64§created_at: i64§buyer_sent_rate: bool§seller_sent_rate: bool§failed_payment: bool§payment_attempts: i64Implementations§
source§impl Order
impl Order
pub fn as_new_order(&self) -> SmallOrder
Trait Implementations§
source§impl<'e> Crud<'e, &'e Pool<Sqlite>> for Order
impl<'e> Crud<'e, &'e Pool<Sqlite>> for Order
source§fn insert_args(self) -> <Sqlite as HasArguments<'e>>::Arguments
fn insert_args(self) -> <Sqlite as HasArguments<'e>>::Arguments
Returns an owned instance of sqlx::Arguments. self is consumed.
Values in the fields are moved in to the
Arguments instance.source§fn update_args(self) -> <Sqlite as HasArguments<'e>>::Arguments
fn update_args(self) -> <Sqlite as HasArguments<'e>>::Arguments
Returns an owned instance of sqlx::Arguments. self is consumed.
Values in the fields are moved in to the
Arguments instance.source§fn create(
self,
pool: E
) -> Pin<Box<dyn Future<Output = Result<Self, Error>> + Send + 'e>>
fn create( self, pool: E ) -> Pin<Box<dyn Future<Output = Result<Self, Error>> + Send + 'e>>
Returns a future that resolves to an insert or
sqlx::Error of the
current instance. Read moresource§fn all(
pool: E
) -> TryCollect<Pin<Box<dyn Stream<Item = Result<Self, Error>> + Send + 'e>>, Vec<Self>>
fn all( pool: E ) -> TryCollect<Pin<Box<dyn Stream<Item = Result<Self, Error>> + Send + 'e>>, Vec<Self>>
Queries all records from the table and returns a future that returns
to a try_collect stream, which resolves to a
Vec<Self> or a
sqlx::Error on error. Read moresource§fn by_id(
pool: E,
id: Self::Id
) -> Pin<Box<dyn Future<Output = Result<Option<Self>, Error>> + Send + 'e>>
fn by_id( pool: E, id: Self::Id ) -> Pin<Box<dyn Future<Output = Result<Option<Self>, Error>> + Send + 'e>>
Looks up a row by ID and returns a future that resolves an
Option<Self>. Returns None if and a record with the corresponding ID
cannot be found and Some if it exists. Read moresource§impl<'de> Deserialize<'de> for Order
impl<'de> Deserialize<'de> for Order
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl<'a, R: Row> FromRow<'a, R> for Orderwhere
&'a str: ColumnIndex<R>,
Uuid: Decode<'a, R::Database> + Type<R::Database>,
String: Decode<'a, R::Database> + Type<R::Database>,
Option<String>: Decode<'a, R::Database> + Type<R::Database>,
bool: Decode<'a, R::Database> + Type<R::Database>,
i64: Decode<'a, R::Database> + Type<R::Database>,
Option<Uuid>: Decode<'a, R::Database> + Type<R::Database>,
impl<'a, R: Row> FromRow<'a, R> for Orderwhere
&'a str: ColumnIndex<R>,
Uuid: Decode<'a, R::Database> + Type<R::Database>,
String: Decode<'a, R::Database> + Type<R::Database>,
Option<String>: Decode<'a, R::Database> + Type<R::Database>,
bool: Decode<'a, R::Database> + Type<R::Database>,
i64: Decode<'a, R::Database> + Type<R::Database>,
Option<Uuid>: Decode<'a, R::Database> + Type<R::Database>,
source§impl Schema for Order
impl Schema for Order
source§fn table_name() -> &'static str
fn table_name() -> &'static str
Database name of the table. Used by the query generation code and
available for introspection. This is generated by taking the plural
snake_case of the struct’s name. See: Inflector to_table_case. Read more
source§fn select_sql() -> &'static str
fn select_sql() -> &'static str
Returns the SQL string for a SELECT query against the table. Read more
source§fn select_by_id_sql() -> &'static str
fn select_by_id_sql() -> &'static str
Returns the SQL string for a SELECT query against the table with a
WHERE clause for the primary key. Read more
source§fn insert_sql() -> &'static str
fn insert_sql() -> &'static str
Returns the SQL for inserting a new record in to the database. The
#[external_id] attribute may be used to specify IDs are assigned
outside of the database. Read moresource§fn update_by_id_sql() -> &'static str
fn update_by_id_sql() -> &'static str
Returns the SQL for updating an existing record in the database. Read more
source§fn delete_by_id_sql() -> &'static str
fn delete_by_id_sql() -> &'static str
Returns the SQL for deleting an existing record by ID from the database. Read more
Auto Trait Implementations§
impl RefUnwindSafe for Order
impl Send for Order
impl Sync for Order
impl Unpin for Order
impl UnwindSafe for Order
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