Struct FullScanRequest

Source
pub struct FullScanRequest<K> { /* private fields */ }
Expand description

Data required to perform a spk-based blockchain client full scan.

A client full scan iterates through all the scripts for the given keychains, fetching relevant data until some stop gap number of scripts is found that have no data. This operation is generally only used when importing or restoring previously used keychains in which the list of used scripts is not known. The full scan process also updates the chain from the given chain_tip (if provided).

Implementations§

Source§

impl<K: Ord + Clone> FullScanRequest<K>

Source

pub fn builder_at(start_time: u64) -> FullScanRequestBuilder<K>

Start building a FullScanRequest with a given start_time.

start_time specifies the start time of sync. Chain sources can use this value to set TxUpdate::seen_ats for mempool transactions. A transaction without any seen_ats is assumed to be unseen in the mempool.

Use FullScanRequest::builder to use the current timestamp as start_time (this requires feature = "std).

Source

pub fn builder() -> FullScanRequestBuilder<K>

Start building a FullScanRequest with the current timestamp as the start_time.

Use FullScanRequest::builder_at to manually set the start_time, or if feature = "std" is not available.

Source

pub fn start_time(&self) -> u64

When the full-scan-request was initiated.

Source

pub fn chain_tip(&self) -> Option<CheckPoint>

Get the chain tip CheckPoint of this request (if any).

Source

pub fn keychains(&self) -> Vec<K>

List all keychains contained in this request.

Source

pub fn next_spk(&mut self, keychain: K) -> Option<Indexed<ScriptBuf>>

Advances the full scan request and returns the next indexed ScriptBuf of the given keychain.

Source

pub fn iter_spks( &mut self, keychain: K, ) -> impl Iterator<Item = Indexed<ScriptBuf>> + '_

Iterate over indexed ScriptBufs contained in this request of the given keychain.

Trait Implementations§

Source§

impl<K> From<FullScanRequestBuilder<K>> for FullScanRequest<K>

Source§

fn from(builder: FullScanRequestBuilder<K>) -> Self

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<K> Freeze for FullScanRequest<K>

§

impl<K> !RefUnwindSafe for FullScanRequest<K>

§

impl<K> Send for FullScanRequest<K>
where K: Send,

§

impl<K> !Sync for FullScanRequest<K>

§

impl<K> Unpin for FullScanRequest<K>

§

impl<K> !UnwindSafe for FullScanRequest<K>

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, 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