Skip to main content

UploadAdapter

Trait UploadAdapter 

Source
pub trait UploadAdapter: AdapterBounds {
Show 22 methods // Required methods fn load<'life0, 'async_trait>( &'life0 self, record: UploadRecord, ) -> Pin<Box<dyn Future<Output = Result<Bytes>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait; fn pay<'life0, 'life1, 'async_trait>( &'life0 self, plans: &'life1 [ChunkPaymentPlan], ) -> Pin<Box<dyn Future<Output = Result<UploadPayment>> + Send + 'async_trait>> where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait; // Provided methods fn pay_merkle<'life0, 'life1, 'async_trait>( &'life0 self, _batch: &'life1 PreparedMerkleBatch, ) -> Pin<Box<dyn Future<Output = Result<MerkleUploadPayment>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn pay_tracked<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, plans: &'life1 [ChunkPaymentPlan], _state: &'life2 UploadState, ) -> Pin<Box<dyn Future<Output = Result<UploadPayment>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn recover_payment<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _plans: &'life1 [ChunkPaymentPlan], _state: &'life2 UploadState, ) -> Pin<Box<dyn Future<Output = Result<UploadPayment>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn pay_merkle_tracked<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, batch: &'life1 PreparedMerkleBatch, _state: &'life2 UploadState, ) -> Pin<Box<dyn Future<Output = Result<MerkleUploadPayment>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn recover_merkle<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _batch: &'life1 PreparedMerkleBatch, _state: &'life2 UploadState, ) -> Pin<Box<dyn Future<Output = Result<MerkleUploadPayment>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn initialize_payment_attempt(&self, _attempt: &mut PaymentAttempt) { ... } fn submit_payment<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, plans: &'life1 [ChunkPaymentPlan], state: &'life2 mut UploadState, ) -> Pin<Box<dyn Future<Output = Result<UploadPayment>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn reconcile_payment<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, plans: &'life1 [ChunkPaymentPlan], state: &'life2 mut UploadState, ) -> Pin<Box<dyn Future<Output = Result<UploadPayment>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn submit_merkle_payment<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, batch: &'life1 PreparedMerkleBatch, state: &'life2 mut UploadState, ) -> Pin<Box<dyn Future<Output = Result<MerkleUploadPayment>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn reconcile_merkle_payment<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, batch: &'life1 PreparedMerkleBatch, state: &'life2 mut UploadState, ) -> Pin<Box<dyn Future<Output = Result<MerkleUploadPayment>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn admit<'life0, 'life1, 'async_trait>( &'life0 self, _plan: &'life1 mut ChunkPaymentPlan, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait { ... } fn checkpoint<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _state: &'life1 UploadState, _payment: Option<&'life2 UploadPayment>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>> where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait { ... } fn quote_limit(&self) -> usize { ... } fn stored(&self, _stored: usize, _total: usize) { ... } fn record_stored(&self, _index: usize, _total: usize) { ... } fn quoted(&self, _quoted: usize, _total: usize) { ... } fn checked(&self, _checked: usize, _total: usize) { ... } fn already_stored(&self, _index: usize, _total: usize) { ... } fn payment_quotes(&self, _completed: usize, _total: usize) { ... } fn preparing(&self, _message: &str) { ... }
}
Expand description

Only byte loading, wallet submission, endpoint admission, and persistence vary by platform.

Required Methods§

Source

fn load<'life0, 'async_trait>( &'life0 self, record: UploadRecord, ) -> Pin<Box<dyn Future<Output = Result<Bytes>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

Load one previously described record.

Source

fn pay<'life0, 'life1, 'async_trait>( &'life0 self, plans: &'life1 [ChunkPaymentPlan], ) -> Pin<Box<dyn Future<Output = Result<UploadPayment>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Submit the native single-node payment plans and await confirmation.

Provided Methods§

Source

fn pay_merkle<'life0, 'life1, 'async_trait>( &'life0 self, _batch: &'life1 PreparedMerkleBatch, ) -> Pin<Box<dyn Future<Output = Result<MerkleUploadPayment>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Submit a prepared Merkle batch and await its confirmed winner.

Source

fn pay_tracked<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, plans: &'life1 [ChunkPaymentPlan], _state: &'life2 UploadState, ) -> Pin<Box<dyn Future<Output = Result<UploadPayment>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Submit with a durable attempt already recorded; adapters can journal broadcast evidence.

Source

fn recover_payment<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _plans: &'life1 [ChunkPaymentPlan], _state: &'life2 UploadState, ) -> Pin<Box<dyn Future<Output = Result<UploadPayment>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Observe an existing attempt without broadcasting another transaction.

Source

fn pay_merkle_tracked<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, batch: &'life1 PreparedMerkleBatch, _state: &'life2 UploadState, ) -> Pin<Box<dyn Future<Output = Result<MerkleUploadPayment>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Submit a Merkle payment with the prepared attempt already persisted.

Source

fn recover_merkle<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _batch: &'life1 PreparedMerkleBatch, _state: &'life2 UploadState, ) -> Pin<Box<dyn Future<Output = Result<MerkleUploadPayment>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Observe an existing Merkle attempt without broadcasting.

Source

fn initialize_payment_attempt(&self, _attempt: &mut PaymentAttempt)

Initialize adapter-owned recovery evidence before persisting an attempt.

Source

fn submit_payment<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, plans: &'life1 [ChunkPaymentPlan], state: &'life2 mut UploadState, ) -> Pin<Box<dyn Future<Output = Result<UploadPayment>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Submit while updating the shared journal. Existing adapters may keep their callback journal.

Source

fn reconcile_payment<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, plans: &'life1 [ChunkPaymentPlan], state: &'life2 mut UploadState, ) -> Pin<Box<dyn Future<Output = Result<UploadPayment>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Reconcile a previous submission while updating its journal.

Source

fn submit_merkle_payment<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, batch: &'life1 PreparedMerkleBatch, state: &'life2 mut UploadState, ) -> Pin<Box<dyn Future<Output = Result<MerkleUploadPayment>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Submit a Merkle payment with mutable recovery evidence.

Source

fn reconcile_merkle_payment<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, batch: &'life1 PreparedMerkleBatch, state: &'life2 mut UploadState, ) -> Pin<Box<dyn Future<Output = Result<MerkleUploadPayment>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Reconcile a Merkle payment without creating a new transaction.

Source

fn admit<'life0, 'life1, 'async_trait>( &'life0 self, _plan: &'life1 mut ChunkPaymentPlan, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Check transport-specific endpoint capabilities before payment.

Source

fn checkpoint<'life0, 'life1, 'life2, 'async_trait>( &'life0 self, _state: &'life1 UploadState, _payment: Option<&'life2 UploadPayment>, ) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait, 'life2: 'async_trait,

Persist before submission and again before any paid data is loaded/stored.

Source

fn quote_limit(&self) -> usize

Adapter resource ceiling; the adaptive controller still controls scheduling.

Source

fn stored(&self, _stored: usize, _total: usize)

Report a completed store or an already-present record.

Source

fn record_stored(&self, _index: usize, _total: usize)

Report a successful write in this attempt, identified by stable index + 1.

Source

fn quoted(&self, _quoted: usize, _total: usize)

Report a completed quote (the first argument is the stable record index + 1).

Source

fn checked(&self, _checked: usize, _total: usize)

Report existing-storage checks, which do not complete payment quotes.

Source

fn already_stored(&self, _index: usize, _total: usize)

Report a record confirmed already present, identified by stable index + 1.

Source

fn payment_quotes(&self, _completed: usize, _total: usize)

Report validated Merkle candidate pools for the current payment batch.

Source

fn preparing(&self, _message: &str)

Describe a preparation boundary that has no meaningful completion fraction.

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§