pub struct Order {Show 17 fields
pub id: Option<String>,
pub kind: Option<String>,
pub status: Option<String>,
pub amount: i64,
pub fiat_code: String,
pub min_amount: Option<i64>,
pub max_amount: Option<i64>,
pub fiat_amount: i64,
pub payment_method: String,
pub premium: i64,
pub trade_keys: Option<String>,
pub counterparty_pubkey: Option<String>,
pub is_mine: Option<bool>,
pub buyer_invoice: Option<String>,
pub request_id: Option<i64>,
pub created_at: Option<i64>,
pub expires_at: Option<i64>,
}Fields§
§id: Option<String>§kind: Option<String>§status: Option<String>§amount: i64§fiat_code: String§min_amount: Option<i64>§max_amount: Option<i64>§fiat_amount: i64§payment_method: String§trade_keys: Option<String>§counterparty_pubkey: Option<String>§is_mine: Option<bool>§buyer_invoice: Option<String>§request_id: Option<i64>§created_at: Option<i64>§expires_at: Option<i64>Implementations§
Source§impl Order
impl Order
pub async fn new( pool: &SqlitePool, order: SmallOrder, trade_keys: &Keys, request_id: Option<i64>, ) -> Result<Self>
pub fn set_kind(&mut self, kind: String) -> &mut Self
pub fn set_status(&mut self, status: String) -> &mut Self
pub fn set_amount(&mut self, amount: i64) -> &mut Self
pub fn set_fiat_code(&mut self, fiat_code: String) -> &mut Self
pub fn set_min_amount(&mut self, min_amount: i64) -> &mut Self
pub fn set_max_amount(&mut self, max_amount: i64) -> &mut Self
pub fn set_fiat_amount(&mut self, fiat_amount: i64) -> &mut Self
pub fn set_payment_method(&mut self, payment_method: String) -> &mut Self
pub fn set_counterparty_pubkey( &mut self, counterparty_pubkey: String, ) -> &mut Self
pub fn set_trade_keys(&mut self, trade_keys: String) -> &mut Self
pub fn set_is_mine(&mut self, is_mine: bool) -> &mut Self
pub async fn save(&self, pool: &SqlitePool) -> Result<()>
pub async fn save_new_id( pool: &SqlitePool, id: String, new_id: String, ) -> Result<bool>
pub async fn get_by_id(pool: &SqlitePool, id: &str) -> Result<Order>
pub async fn get_all_trade_keys(pool: &SqlitePool) -> Result<Vec<String>>
pub async fn delete_by_id(pool: &SqlitePool, id: &str) -> Result<bool>
Trait Implementations§
Source§impl<'a, R: Row> FromRow<'a, R> for Orderwhere
&'a str: ColumnIndex<R>,
Option<String>: Decode<'a, R::Database> + Type<R::Database>,
i64: Decode<'a, R::Database> + Type<R::Database>,
String: Decode<'a, R::Database> + Type<R::Database>,
Option<i64>: Decode<'a, R::Database> + Type<R::Database>,
Option<bool>: Decode<'a, R::Database> + Type<R::Database>,
impl<'a, R: Row> FromRow<'a, R> for Orderwhere
&'a str: ColumnIndex<R>,
Option<String>: Decode<'a, R::Database> + Type<R::Database>,
i64: Decode<'a, R::Database> + Type<R::Database>,
String: Decode<'a, R::Database> + Type<R::Database>,
Option<i64>: Decode<'a, R::Database> + Type<R::Database>,
Option<bool>: Decode<'a, R::Database> + Type<R::Database>,
Auto Trait Implementations§
impl Freeze for Order
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more