Skip to main content

WatchSetBuilder

Struct WatchSetBuilder 

Source
pub struct WatchSetBuilder { /* private fields */ }
Expand description

The canonical watch-set declared by a watch_set_loader on every (re)connect. It is a thin recording facade over a fresh [WatchSetMirror]: each add_* / set_categories call records interest the way the matching ResilientWatch method would, so the populated set renders to exactly the same control messages a manual replay would. The wrapper adopts the builder’s set as the mirror once the loader returns, then re-registers it and re-anchors as usual.

Only declarative add_* methods are exposed (no remove_*): the loader builds a complete set from the integrator’s source-of-truth into an empty mirror, where a removal has nothing to act on. Methods are synchronous — they only record — so a loader does its own awaiting against its truth (DB, config, upstream service) between calls.

Implementations§

Source§

impl WatchSetBuilder

Source

pub fn add_scripts( &self, items: impl IntoIterator<Item = ([u8; 32], Option<u64>)>, )

Declare scripthashes (each sha256(scriptPubKey)) with an optional per-script min_value floor. See ResilientWatch::add_scripts.

Source

pub fn add_outpoints( &self, outpoints: impl IntoIterator<Item = ([u8; 32], u32)>, )

Declare outpoints (txid:vout). See ResilientWatch::add_outpoints.

Source

pub fn add_tx_lifecycle( &self, txids: impl IntoIterator<Item = [u8; 32]>, auto_close: AutoClose, )

Declare lifecycle watches on txids. See ResilientWatch::add_tx_lifecycle.

Source

pub fn add_depth_alarms( &self, txids: impl IntoIterator<Item = [u8; 32]>, depths: impl IntoIterator<Item = u32>, )

Arm single-shot depth alarms over the cross product of txids and depths (depths < 1 dropped). See ResilientWatch::add_depth_alarms.

Source

pub fn add_descriptor( &self, descriptor: impl Into<String>, gap_limit: u32, start: u32, )

Declare a public output descriptor’s (gap_limit, start) watch window. See ResilientWatch::add_descriptor.

Source

pub fn add_script_prefixes( &self, prefixes: impl IntoIterator<Item = (Vec<u8>, u32)>, ) -> Result<(), StreamError>

Declare script-prefix buckets (validated client-side, same as the live path). An invalid (prefix, bits) aborts the load with StreamError::InvalidArgument, which the loader propagates as a (retryable) loader failure. See ResilientWatch::add_script_prefixes.

Source

pub fn add_silent_payments( &self, targets: impl IntoIterator<Item = SilentPaymentTarget>, ) -> Result<(), StreamError>

Available on crate feature bitcoin only.

Declare BIP 352 scan-key watch targets. Each target’s identity b_scan·G is derived once (hence the bitcoin feature and the fallible return) and recorded so it re-registers on every reconnect — the D3 custody model. See ResilientWatch::add_silent_payments.

Source

pub fn set_categories(&self, categories: u32)

Declare the live category filter. See ResilientWatch::set_categories.

Source

pub fn set_watch_options(&self, include_raw_tx: bool)

Declare the raw-tx opt-in. See ResilientWatch::set_watch_options. A loader that wants raw_tx on ScriptMatched must re-declare this each rebuild, exactly like set_categories — the loader is canonical.

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

Source§

fn into_request(self) -> Request<T>

Wrap the input message T in a tonic::Request
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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