Struct mostro_core::order::Order
source · pub struct Order {Show 16 fields
pub id: Uuid,
pub kind: String,
pub event_id: String,
pub hash: Option<String>,
pub preimage: Option<String>,
pub creator_pubkey: String,
pub buyer_pubkey: Option<String>,
pub seller_pubkey: Option<String>,
pub status: String,
pub prime: i64,
pub payment_method: String,
pub amount: i64,
pub fiat_code: String,
pub fiat_amount: i64,
pub buyer_invoice: Option<String>,
pub created_at: i64,
}Fields§
§id: Uuid§kind: String§event_id: String§hash: Option<String>§preimage: Option<String>§creator_pubkey: String§buyer_pubkey: Option<String>§seller_pubkey: Option<String>§status: String§prime: i64§payment_method: String§amount: i64§fiat_code: String§fiat_amount: i64§buyer_invoice: Option<String>§created_at: i64Implementations§
Trait Implementations§
source§impl<'e> Crud<'e, &'e Pool<Sqlite>> for Order
impl<'e> Crud<'e, &'e Pool<Sqlite>> for Order
source§fn insert_binds(
&'e self,
query: QueryAs<'e, Sqlite, Self, <Sqlite as HasArguments<'e>>::Arguments>
) -> QueryAs<'e, Sqlite, Self, <Sqlite as HasArguments<'e>>::Arguments>
fn insert_binds( &'e self, query: QueryAs<'e, Sqlite, Self, <Sqlite as HasArguments<'e>>::Arguments> ) -> QueryAs<'e, Sqlite, Self, <Sqlite as HasArguments<'e>>::Arguments>
source§fn update_binds(
&'e self,
query: QueryAs<'e, Sqlite, Self, <Sqlite as HasArguments<'e>>::Arguments>
) -> QueryAs<'e, Sqlite, Self, <Sqlite as HasArguments<'e>>::Arguments>
fn update_binds( &'e self, query: QueryAs<'e, Sqlite, Self, <Sqlite as HasArguments<'e>>::Arguments> ) -> QueryAs<'e, Sqlite, Self, <Sqlite as HasArguments<'e>>::Arguments>
source§fn create(
&'e self,
pool: E
) -> Pin<Box<dyn Future<Output = Result<Self, Error>> + 'e, Global>>
fn create( &'e self, pool: E ) -> Pin<Box<dyn Future<Output = Result<Self, Error>> + 'e, Global>>
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, Global>>, Vec<Self, Global>>
fn all( pool: E ) -> TryCollect<Pin<Box<dyn Stream<Item = Result<Self, Error>> + Send + 'e, Global>>, Vec<Self, Global>>
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>> + 'e, Global>>
fn by_id( pool: E, id: Self::Id ) -> Pin<Box<dyn Future<Output = Result<Option<Self>, Error>> + 'e, Global>>
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>,
i64: 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>, i64: 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