SQLTransaction

Struct SQLTransaction 

Source
pub struct SQLTransaction<RM>
where RM: DatabasePool + 'static,
{ /* private fields */ }
Expand description

SQL Transaction Writer

Trait Implementations§

Source§

impl<RM> MintAuthTransaction<Error> for SQLTransaction<RM>
where RM: DatabasePool + 'static,

Source§

fn set_active_keyset<'life0, 'async_trait>( &'life0 mut self, id: Id, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Add Active Keyset
Source§

fn add_keyset_info<'life0, 'async_trait>( &'life0 mut self, keyset: MintKeySetInfo, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn add_proof<'life0, 'async_trait>( &'life0 mut self, proof: AuthProof, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Add spent AuthProof
Source§

fn update_proof_state<'life0, 'life1, 'async_trait>( &'life0 mut self, y: &'life1 PublicKey, proofs_state: State, ) -> Pin<Box<dyn Future<Output = Result<Option<State>, Self::Err>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Update AuthProofs state
Source§

fn add_blind_signatures<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, blinded_messages: &'life1 [PublicKey], blind_signatures: &'life2 [BlindSignature], ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source§

fn add_protected_endpoints<'life0, 'async_trait>( &'life0 mut self, protected_endpoints: HashMap<ProtectedEndpoint, AuthRequired>, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Add protected endpoints
Source§

fn remove_protected_endpoints<'life0, 'async_trait>( &'life0 mut self, protected_endpoints: Vec<ProtectedEndpoint>, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Removed Protected endpoints
Source§

impl<RM> DbTransactionFinalizer for SQLTransaction<RM>
where RM: DatabasePool + 'static,

Source§

type Err = Error

Mint Signature Database Error
Source§

fn commit<'async_trait>( self: Box<Self>, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait,

Commits all the changes into the database
Source§

fn rollback<'async_trait>( self: Box<Self>, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait,

Rollbacks the write transaction
Source§

impl<RM> KVStoreTransaction<'_, Error> for SQLTransaction<RM>
where RM: DatabasePool + 'static,

Source§

fn kv_read<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 mut self, primary_namespace: &'life1 str, secondary_namespace: &'life2 str, key: &'life3 str, ) -> Pin<Box<dyn Future<Output = Result<Option<Vec<u8>>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Read value from key-value store
Source§

fn kv_write<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>( &'life0 mut self, primary_namespace: &'life1 str, secondary_namespace: &'life2 str, key: &'life3 str, value: &'life4 [u8], ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait, 'life4: 'async_trait,

Write value to key-value store
Source§

fn kv_remove<'life0, 'life1, 'life2, 'life3, 'async_trait>( &'life0 mut self, primary_namespace: &'life1 str, secondary_namespace: &'life2 str, key: &'life3 str, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait, 'life3: 'async_trait,

Remove value from key-value store
Source§

fn kv_list<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, primary_namespace: &'life1 str, secondary_namespace: &'life2 str, ) -> Pin<Box<dyn Future<Output = Result<Vec<String>, Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

List keys in a namespace
Source§

impl<RM> KeysDatabaseTransaction<'_, Error> for SQLTransaction<RM>
where RM: DatabasePool + 'static,

Source§

fn add_keyset_info<'life0, 'async_trait>( &'life0 mut self, keyset: MintKeySetInfo, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn set_active_keyset<'life0, 'async_trait>( &'life0 mut self, unit: CurrencyUnit, id: Id, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Add Active Keyset
Source§

impl<RM> ProofsTransaction<'_> for SQLTransaction<RM>
where RM: DatabasePool + 'static,

Source§

type Err = Error

Mint Proof Database Error
Source§

fn add_proofs<'life0, 'async_trait>( &'life0 mut self, proofs: Proofs, quote_id: Option<QuoteId>, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Err>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn update_proofs_states<'life0, 'life1, 'async_trait>( &'life0 mut self, ys: &'life1 [PublicKey], new_state: State, ) -> Pin<Box<dyn Future<Output = Result<Vec<Option<State>>, Self::Err>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Updates the proofs to a given states and return the previous states
Source§

fn remove_proofs<'life0, 'life1, 'async_trait>( &'life0 mut self, ys: &'life1 [PublicKey], _quote_id: Option<QuoteId>, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Err>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Remove Proofs
Source§

fn get_proof_ys_by_quote_id<'life0, 'life1, 'async_trait>( &'life0 self, quote_id: &'life1 QuoteId, ) -> Pin<Box<dyn Future<Output = Result<Vec<PublicKey>, Self::Err>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get ys by quote id
Source§

impl<RM> QuotesTransaction<'_> for SQLTransaction<RM>
where RM: DatabasePool + 'static,

Source§

type Err = Error

Mint Quotes Database Error
Source§

fn add_melt_request_and_blinded_messages<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, quote_id: &'life1 QuoteId, inputs_amount: Amount, inputs_fee: Amount, blinded_messages: &'life2 [BlindedMessage], ) -> Pin<Box<dyn Future<Output = Result<(), Self::Err>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Add melt_request with quote_id, inputs_amount, and blinded_messages
Source§

fn get_melt_request_and_blinded_messages<'life0, 'life1, 'async_trait>( &'life0 mut self, quote_id: &'life1 QuoteId, ) -> Pin<Box<dyn Future<Output = Result<Option<MeltRequestInfo>, Self::Err>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get melt_request and associated blinded_messages by quote_id
Source§

fn delete_melt_request<'life0, 'life1, 'async_trait>( &'life0 mut self, quote_id: &'life1 QuoteId, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Err>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Delete melt_request and associated blinded_messages by quote_id
Source§

fn increment_mint_quote_amount_paid<'life0, 'life1, 'async_trait>( &'life0 mut self, quote_id: &'life1 QuoteId, amount_paid: Amount, payment_id: String, ) -> Pin<Box<dyn Future<Output = Result<Amount, Self::Err>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Increment amount paid MintMintQuote
Source§

fn increment_mint_quote_amount_issued<'life0, 'life1, 'async_trait>( &'life0 mut self, quote_id: &'life1 QuoteId, amount_issued: Amount, ) -> Pin<Box<dyn Future<Output = Result<Amount, Self::Err>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Increment amount paid MintMintQuote
Source§

fn add_mint_quote<'life0, 'async_trait>( &'life0 mut self, quote: MintQuote, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Err>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn remove_mint_quote<'life0, 'life1, 'async_trait>( &'life0 mut self, quote_id: &'life1 QuoteId, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Err>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn add_melt_quote<'life0, 'async_trait>( &'life0 mut self, quote: MeltQuote, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Err>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Source§

fn update_melt_quote_request_lookup_id<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, quote_id: &'life1 QuoteId, new_request_lookup_id: &'life2 PaymentIdentifier, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Err>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Updates the request lookup id for a melt quote
Source§

fn update_melt_quote_state<'life0, 'life1, 'async_trait>( &'life0 mut self, quote_id: &'life1 QuoteId, state: MeltQuoteState, payment_proof: Option<String>, ) -> Pin<Box<dyn Future<Output = Result<(MeltQuoteState, MeltQuote), Self::Err>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn remove_melt_quote<'life0, 'life1, 'async_trait>( &'life0 mut self, quote_id: &'life1 QuoteId, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Err>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

fn get_mint_quote<'life0, 'life1, 'async_trait>( &'life0 mut self, quote_id: &'life1 QuoteId, ) -> Pin<Box<dyn Future<Output = Result<Option<MintQuote>, Self::Err>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get MintMintQuote and lock it for update in this transaction
Source§

fn get_melt_quote<'life0, 'life1, 'async_trait>( &'life0 mut self, quote_id: &'life1 QuoteId, ) -> Pin<Box<dyn Future<Output = Result<Option<MeltQuote>, Self::Err>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get mint::MeltQuote and lock it for update in this transaction
Source§

fn get_mint_quote_by_request<'life0, 'life1, 'async_trait>( &'life0 mut self, request: &'life1 str, ) -> Pin<Box<dyn Future<Output = Result<Option<MintQuote>, Self::Err>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get all MintMintQuotes and lock it for update in this transaction
Source§

fn get_mint_quote_by_request_lookup_id<'life0, 'life1, 'async_trait>( &'life0 mut self, request_lookup_id: &'life1 PaymentIdentifier, ) -> Pin<Box<dyn Future<Output = Result<Option<MintQuote>, Self::Err>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Get all MintMintQuotes
Source§

impl<RM> SignaturesTransaction<'_> for SQLTransaction<RM>
where RM: DatabasePool + 'static,

Source§

type Err = Error

Mint Signature Database Error
Source§

fn add_blind_signatures<'life0, 'life1, 'life2, 'async_trait>( &'life0 mut self, blinded_messages: &'life1 [PublicKey], blind_signatures: &'life2 [BlindSignature], quote_id: Option<QuoteId>, ) -> Pin<Box<dyn Future<Output = Result<(), Self::Err>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Source§

fn get_blind_signatures<'life0, 'life1, 'async_trait>( &'life0 mut self, blinded_messages: &'life1 [PublicKey], ) -> Pin<Box<dyn Future<Output = Result<Vec<Option<BlindSignature>>, Self::Err>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Source§

impl<RM> Transaction<'_, Error> for SQLTransaction<RM>
where RM: DatabasePool + 'static,

Auto Trait Implementations§

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<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> ErasedDestructor for T
where T: 'static,