pub struct CashuQuoteState { /* private fields */ }Implementations§
Source§impl CashuQuoteState
impl CashuQuoteState
pub fn new( routing: CashuRoutingConfig, peer_selector: Arc<RwLock<PeerSelector>>, payment_client: Option<Arc<dyn CashuPaymentClient>>, ) -> Self
pub fn new_with_mint_metadata( routing: CashuRoutingConfig, peer_selector: Arc<RwLock<PeerSelector>>, payment_client: Option<Arc<dyn CashuPaymentClient>>, mint_metadata: Arc<CashuMintMetadataStore>, ) -> Self
pub fn payment_client_available(&self) -> bool
pub async fn requester_quote_terms(&self) -> Option<(String, u64, u32)>
pub fn settlement_timeout(&self) -> Duration
pub async fn requested_quote_mint(&self, amount_sat: u64) -> Option<String>
pub async fn choose_quote_mint( &self, requested_mint: Option<&str>, ) -> Option<String>
pub async fn register_pending_quote( &self, hash_hex: String, preferred_mint_url: Option<String>, offered_payment_sat: u64, ) -> Receiver<Option<NegotiatedQuote>>
pub async fn clear_pending_quote(&self, hash_hex: &str)
pub async fn should_accept_quote_response( &self, from_peer: &str, preferred_mint_url: Option<&str>, offered_payment_sat: u64, res: &DataQuoteResponse, ) -> bool
pub async fn handle_quote_response( &self, from_peer: &str, res: DataQuoteResponse, ) -> bool
pub async fn build_quote_response( &self, from_peer: &str, req: &DataQuoteRequest, can_serve: bool, ) -> DataQuoteResponse
pub async fn take_valid_quote( &self, from_peer: &str, hash: &[u8], quote_id: u64, ) -> Option<ExpectedSettlement>
pub async fn register_expected_payment( self: &Arc<Self>, from_peer: String, hash_hex: String, quote_id: u64, settlement: ExpectedSettlement, )
pub async fn claim_expected_payment( &self, from_peer: &str, hash: &[u8], quote_id: u64, chunk_index: u32, announced_payment_sat: u64, announced_mint: Option<&str>, ) -> Result<ExpectedSettlement>
pub async fn prepare_quoted_transfer( &self, from_peer: &str, hash: &[u8], quote_id: u64, settlement: &ExpectedSettlement, data: Vec<u8>, ) -> Option<(DataChunk, ExpectedSettlement)>
pub async fn next_outgoing_chunk( &self, from_peer: &str, hash: &[u8], quote_id: u64, ) -> Option<(DataChunk, ExpectedSettlement)>
pub async fn create_payment_token( &self, mint_url: &str, amount_sat: u64, ) -> Result<CashuSentPayment>
pub async fn receive_payment_token( &self, encoded_token: &str, ) -> Result<CashuReceivedPayment>
pub async fn revoke_payment_token( &self, mint_url: &str, operation_id: &str, ) -> Result<()>
pub async fn record_paid_peer(&self, peer_id: &str, amount_sat: u64)
pub async fn record_receipt_from_peer( &self, peer_id: &str, mint_url: &str, amount_sat: u64, ) -> Result<()>
pub async fn record_payment_default_from_peer(&self, peer_id: &str)
pub async fn record_mint_receive_failure(&self, mint_url: &str) -> Result<()>
pub async fn should_refuse_requests_from_peer(&self, peer_id: &str) -> bool
Auto Trait Implementations§
impl !Freeze for CashuQuoteState
impl !RefUnwindSafe for CashuQuoteState
impl !UnwindSafe for CashuQuoteState
impl Send for CashuQuoteState
impl Sync for CashuQuoteState
impl Unpin for CashuQuoteState
impl UnsafeUnpin for CashuQuoteState
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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