From 9b99c75c876e8d034180f9a629ff0bafa3dd61a9 Mon Sep 17 00:00:00 2001 From: jbearer Date: Wed, 10 Jan 2024 20:15:01 +0000 Subject: [PATCH] deploy: 2e9883cd533d42b46538968ff2f64317f7960917 --- hotshot_query_service/all.html | 2 +- .../availability/enum.Error.html | 63 +- .../availability/enum.Fetch.html | 162 ++ .../availability/enum.ResourceId.html | 2 +- .../availability/fetch/enum.Fetch.html | 11 + .../availability/fn.define_api.html | 2 +- hotshot_query_service/availability/index.html | 15 +- .../availability/sidebar-items.js | 2 +- .../availability/struct.BlockQueryData.html | 13 +- .../availability/struct.CustomSnafu.html | 10 +- ...Snafu.html => struct.FetchBlockSnafu.html} | 20 +- ...fSnafu.html => struct.FetchLeafSnafu.html} | 20 +- ...html => struct.FetchTransactionSnafu.html} | 20 +- .../struct.InconsistentLeafError.html | 2 +- .../struct.InvalidTransactionIndexSnafu.html | 10 +- .../availability/struct.Options.html | 8 +- .../availability/struct.RequestSnafu.html | 6 +- .../struct.TransactionQueryData.html | 26 +- .../trait.AvailabilityDataSource.html | 171 +- .../trait.UpdateAvailabilityData.html | 18 +- .../struct.FetchingDataSource.html} | 6 +- .../fs/type.FileSystemDataSource.html | 11 + hotshot_query_service/data_source/index.html | 16 +- .../data_source/sidebar-items.js | 2 +- .../sql/fn.default_migrations.html | 2 - .../data_source/sql/index.html | 4 +- .../data_source/sql/macro.include_dir.html | 2 - .../sql/macro.include_migrations.html | 6 +- .../data_source/sql/sidebar-items.js | 2 +- .../data_source/sql/struct.Error.html | 14 +- .../data_source/sql/struct.Migration.html | 10 +- .../data_source/sql/type.SqlDataSource.html | 249 ++ .../data_source/storage/fs/index.html | 1 + .../data_source/storage/fs/sidebar-items.js | 1 + .../storage/fs/struct.FileSystemStorage.html | 256 ++ .../data_source/storage/index.html | 12 + .../data_source/storage/sidebar-items.js | 1 + .../storage/sql/fn.default_migrations.html | 2 + .../data_source/storage/sql/index.html | 3 + .../{ => storage}/sql/macro.include_dir!.html | 0 .../storage/sql/macro.include_dir.html | 2 + .../sql/macro.include_migrations!.html | 11 + .../storage/sql/macro.include_migrations.html | 27 + .../data_source/storage/sql/sidebar-items.js | 1 + .../{ => storage}/sql/struct.Config.html | 37 +- .../data_source/storage/sql/struct.Error.html | 310 ++ .../storage/sql/struct.Migration.html} | 62 +- .../sql/struct.SqlStorage.html} | 352 +-- .../{ => storage}/sql/struct.Transaction.html | 42 +- .../{ => storage}/sql/trait.Query.html | 54 +- .../storage/trait.AvailabilityStorage.html | 79 + .../struct.ExtensibleDataSource.html | 103 +- ...ce.html => struct.FetchingDataSource.html} | 322 +- .../data_source/struct.MetricsDataSource.html | 2 +- .../data_source/trait.UpdateDataSource.html | 11 +- .../trait.VersionedDataSource.html | 16 +- .../type.FileSystemDataSource.html | 118 + hotshot_query_service/enum.Error.html | 13 +- hotshot_query_service/enum.QueryError.html | 16 +- .../fn.run_standalone_service.html | 4 +- hotshot_query_service/index.html | 80 +- .../macro.include_migrations.html | 6 +- .../macro.instantiate_data_source_tests.html | 2 +- .../data_source/trait.NodeDataSource.html | 11 + .../data_source/trait.UpdateNodeData.html | 11 + hotshot_query_service/node/enum.Error.html | 170 ++ hotshot_query_service/node/fn.define_api.html | 5 + hotshot_query_service/node/index.html | 9 + hotshot_query_service/node/sidebar-items.js | 1 + .../struct.CustomSnafu.html} | 36 +- .../struct.InvalidSignatureKeySnafu.html | 10 +- .../node/struct.Options.html | 141 + .../struct.QueryProposalsSnafu.html | 16 +- .../struct.QuerySnafu.html} | 6 +- .../struct.RequestSnafu.html} | 6 +- .../node/trait.NodeDataSource.html | 48 + .../node/trait.UpdateNodeData.html | 24 + hotshot_query_service/sidebar-items.js | 2 +- hotshot_query_service/status/enum.Error.html | 10 +- .../status/fn.define_api.html | 2 +- hotshot_query_service/status/index.html | 15 +- .../status/struct.Options.html | 8 +- .../status/trait.StatusDataSource.html | 9 +- .../struct.MissingSnafu.html | 10 +- .../struct.NotFoundSnafu.html | 10 +- hotshot_query_service/struct.Options.html | 9 +- hotshot_query_service/struct.Snafu.html | 10 +- hotshot_query_service/type.Header.html | 2 +- hotshot_query_service/type.Metadata.html | 2 +- hotshot_query_service/type.Payload.html | 2 +- hotshot_query_service/type.QueryResult.html | 2 +- hotshot_query_service/type.SignatureKey.html | 2 +- hotshot_query_service/type.Transaction.html | 2 +- search-index.js | 2 +- src-files.js | 2 +- .../availability.rs.html | 428 +-- .../availability/data_source.rs.html | 122 +- .../availability/fetch.rs.html | 225 ++ .../availability/query_data.rs.html | 20 +- src/hotshot_query_service/data_source.rs.html | 280 +- .../data_source/buffered_channel.rs.html | 171 -- .../data_source/extension.rs.html | 92 +- .../data_source/fetching.rs.html | 1785 ++++++++++++ .../data_source/fs.rs.html | 866 +----- .../data_source/notifier.rs.html | 737 +++++ .../data_source/sql.rs.html | 2592 +---------------- .../data_source/storage.rs.html | 173 ++ .../data_source/storage/fs.rs.html | 801 +++++ .../{ => storage}/ledger_log.rs.html | 304 +- .../data_source/storage/sql.rs.html | 2591 ++++++++++++++++ .../data_source/update.rs.html | 46 +- src/hotshot_query_service/error.rs.html | 8 +- src/hotshot_query_service/lib.rs.html | 216 +- src/hotshot_query_service/node.rs.html | 659 +++++ .../node/data_source.rs.html | 71 + .../node/query_data.rs.html | 27 + src/hotshot_query_service/status.rs.html | 54 +- trait.impl/clap_builder/derive/trait.Args.js | 2 +- .../derive/trait.FromArgMatches.js | 2 +- trait.impl/core/clone/trait.Clone.js | 2 +- trait.impl/core/cmp/trait.Eq.js | 2 +- trait.impl/core/cmp/trait.PartialEq.js | 2 +- trait.impl/core/convert/trait.From.js | 2 +- trait.impl/core/default/trait.Default.js | 2 +- trait.impl/core/error/trait.Error.js | 2 +- trait.impl/core/fmt/trait.Debug.js | 2 +- trait.impl/core/fmt/trait.Display.js | 2 +- .../future/into_future/trait.IntoFuture.js | 3 + trait.impl/core/marker/trait.Copy.js | 2 +- trait.impl/core/marker/trait.Freeze.js | 2 +- trait.impl/core/marker/trait.Send.js | 2 +- trait.impl/core/marker/trait.StructuralEq.js | 2 +- .../core/marker/trait.StructuralPartialEq.js | 2 +- trait.impl/core/marker/trait.Sync.js | 2 +- trait.impl/core/marker/trait.Unpin.js | 2 +- trait.impl/core/ops/drop/trait.Drop.js | 2 +- .../panic/unwind_safe/trait.RefUnwindSafe.js | 2 +- .../panic/unwind_safe/trait.UnwindSafe.js | 2 +- trait.impl/core/str/traits/trait.FromStr.js | 2 +- .../{ => storage}/sql/trait.Query.js | 0 .../storage/trait.AvailabilityStorage.js | 3 + .../node/data_source/trait.NodeDataSource.js | 3 + .../node/data_source/trait.UpdateNodeData.js | 3 + trait.impl/serde/de/trait.Deserialize.js | 2 +- trait.impl/serde/ser/trait.Serialize.js | 2 +- trait.impl/snafu/trait.ErrorCompat.js | 2 +- trait.impl/snafu/trait.IntoError.js | 2 +- type.impl/core/result/enum.Result.js | 2 +- .../availability/enum.ResourceId.js | 2 +- .../data_source/struct.FetchingDataSource.js | 3 + 150 files changed, 10275 insertions(+), 5510 deletions(-) create mode 100644 hotshot_query_service/availability/enum.Fetch.html create mode 100644 hotshot_query_service/availability/fetch/enum.Fetch.html rename hotshot_query_service/availability/{struct.QueryBlockSnafu.html => struct.FetchBlockSnafu.html} (86%) rename hotshot_query_service/availability/{struct.QueryLeafSnafu.html => struct.FetchLeafSnafu.html} (86%) rename hotshot_query_service/availability/{struct.QueryTransactionSnafu.html => struct.FetchTransactionSnafu.html} (86%) rename hotshot_query_service/data_source/{fs/struct.FileSystemDataSource.html => fetching/struct.FetchingDataSource.html} (51%) create mode 100644 hotshot_query_service/data_source/fs/type.FileSystemDataSource.html delete mode 100644 hotshot_query_service/data_source/sql/fn.default_migrations.html delete mode 100644 hotshot_query_service/data_source/sql/macro.include_dir.html create mode 100644 hotshot_query_service/data_source/sql/type.SqlDataSource.html create mode 100644 hotshot_query_service/data_source/storage/fs/index.html create mode 100644 hotshot_query_service/data_source/storage/fs/sidebar-items.js create mode 100644 hotshot_query_service/data_source/storage/fs/struct.FileSystemStorage.html create mode 100644 hotshot_query_service/data_source/storage/index.html create mode 100644 hotshot_query_service/data_source/storage/sidebar-items.js create mode 100644 hotshot_query_service/data_source/storage/sql/fn.default_migrations.html create mode 100644 hotshot_query_service/data_source/storage/sql/index.html rename hotshot_query_service/data_source/{ => storage}/sql/macro.include_dir!.html (100%) create mode 100644 hotshot_query_service/data_source/storage/sql/macro.include_dir.html create mode 100644 hotshot_query_service/data_source/storage/sql/macro.include_migrations!.html create mode 100644 hotshot_query_service/data_source/storage/sql/macro.include_migrations.html create mode 100644 hotshot_query_service/data_source/storage/sql/sidebar-items.js rename hotshot_query_service/data_source/{ => storage}/sql/struct.Config.html (78%) create mode 100644 hotshot_query_service/data_source/storage/sql/struct.Error.html rename hotshot_query_service/{availability/struct.BlockStreamSnafu.html => data_source/storage/sql/struct.Migration.html} (67%) rename hotshot_query_service/data_source/{sql/struct.SqlDataSource.html => storage/sql/struct.SqlStorage.html} (59%) rename hotshot_query_service/data_source/{ => storage}/sql/struct.Transaction.html (85%) rename hotshot_query_service/data_source/{ => storage}/sql/trait.Query.html (60%) create mode 100644 hotshot_query_service/data_source/storage/trait.AvailabilityStorage.html rename hotshot_query_service/data_source/{struct.FileSystemDataSource.html => struct.FetchingDataSource.html} (62%) create mode 100644 hotshot_query_service/data_source/type.FileSystemDataSource.html create mode 100644 hotshot_query_service/node/data_source/trait.NodeDataSource.html create mode 100644 hotshot_query_service/node/data_source/trait.UpdateNodeData.html create mode 100644 hotshot_query_service/node/enum.Error.html create mode 100644 hotshot_query_service/node/fn.define_api.html create mode 100644 hotshot_query_service/node/index.html create mode 100644 hotshot_query_service/node/sidebar-items.js rename hotshot_query_service/{availability/struct.LeafStreamSnafu.html => node/struct.CustomSnafu.html} (84%) rename hotshot_query_service/{availability => node}/struct.InvalidSignatureKeySnafu.html (84%) create mode 100644 hotshot_query_service/node/struct.Options.html rename hotshot_query_service/{availability => node}/struct.QueryProposalsSnafu.html (87%) rename hotshot_query_service/{availability/struct.StreamLeafSnafu.html => node/struct.QuerySnafu.html} (85%) rename hotshot_query_service/{availability/struct.StreamBlockSnafu.html => node/struct.RequestSnafu.html} (87%) create mode 100644 hotshot_query_service/node/trait.NodeDataSource.html create mode 100644 hotshot_query_service/node/trait.UpdateNodeData.html create mode 100644 src/hotshot_query_service/availability/fetch.rs.html delete mode 100644 src/hotshot_query_service/data_source/buffered_channel.rs.html create mode 100644 src/hotshot_query_service/data_source/fetching.rs.html create mode 100644 src/hotshot_query_service/data_source/notifier.rs.html create mode 100644 src/hotshot_query_service/data_source/storage.rs.html create mode 100644 src/hotshot_query_service/data_source/storage/fs.rs.html rename src/hotshot_query_service/data_source/{ => storage}/ledger_log.rs.html (65%) create mode 100644 src/hotshot_query_service/data_source/storage/sql.rs.html create mode 100644 src/hotshot_query_service/node.rs.html create mode 100644 src/hotshot_query_service/node/data_source.rs.html create mode 100644 src/hotshot_query_service/node/query_data.rs.html create mode 100644 trait.impl/core/future/into_future/trait.IntoFuture.js rename trait.impl/hotshot_query_service/data_source/{ => storage}/sql/trait.Query.js (100%) create mode 100644 trait.impl/hotshot_query_service/data_source/storage/trait.AvailabilityStorage.js create mode 100644 trait.impl/hotshot_query_service/node/data_source/trait.NodeDataSource.js create mode 100644 trait.impl/hotshot_query_service/node/data_source/trait.UpdateNodeData.js create mode 100644 type.impl/hotshot_query_service/data_source/struct.FetchingDataSource.js diff --git a/hotshot_query_service/all.html b/hotshot_query_service/all.html index b2cbbd6f8..73ae36c67 100644 --- a/hotshot_query_service/all.html +++ b/hotshot_query_service/all.html @@ -1 +1 @@ -List of all items in this crate

List of all items

Structs

Enums

Traits

Macros

Functions

Type Aliases

\ No newline at end of file +List of all items in this crate

List of all items

Structs

Enums

Traits

Macros

Functions

Type Aliases

\ No newline at end of file diff --git a/hotshot_query_service/availability/enum.Error.html b/hotshot_query_service/availability/enum.Error.html index dab5d0783..d853db81a 100644 --- a/hotshot_query_service/availability/enum.Error.html +++ b/hotshot_query_service/availability/enum.Error.html @@ -1,76 +1,43 @@ -Error in hotshot_query_service::availability - Rust
pub enum Error {
+Error in hotshot_query_service::availability - Rust
pub enum Error {
     Request {
         source: RequestError,
     },
-    QueryLeaf {
-        source: QueryError,
+    FetchLeaf {
         resource: String,
     },
-    StreamLeaf {
-        source: QueryError,
-    },
-    QueryBlock {
-        source: QueryError,
+    FetchBlock {
         resource: String,
     },
-    StreamBlock {
-        source: QueryError,
-    },
-    QueryTransaction {
-        source: QueryError,
+    FetchTransaction {
         resource: String,
     },
-    QueryProposals {
-        source: QueryError,
-        proposer: EncodedPublicKey,
-    },
     InvalidTransactionIndex {
         height: u64,
         index: u64,
     },
-    LeafStream {
-        height: usize,
-        reason: String,
-    },
-    BlockStream {
-        height: usize,
-        reason: String,
-    },
-    InvalidSignatureKey,
     Custom {
         message: String,
         status: StatusCode,
     },
-}

Variants§

§

Request

Fields

§source: RequestError
§

QueryLeaf

Fields

§source: QueryError
§resource: String
§

StreamLeaf

Fields

§source: QueryError
§

QueryBlock

Fields

§source: QueryError
§resource: String
§

StreamBlock

Fields

§source: QueryError
§

QueryTransaction

Fields

§source: QueryError
§resource: String
§

QueryProposals

Fields

§source: QueryError
§proposer: EncodedPublicKey
§

InvalidTransactionIndex

Fields

§height: u64
§index: u64
§

LeafStream

Fields

§height: usize
§reason: String
§

BlockStream

Fields

§height: usize
§reason: String
§

InvalidSignatureKey

§

Custom

Fields

§message: String
§status: StatusCode

Implementations§

source§

impl Error

source

pub fn internal<M: Display>(message: M) -> Self

source

pub fn status(&self) -> StatusCode

Trait Implementations§

source§

impl Clone for Error

source§

fn clone(&self) -> Error

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Error

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for Error

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where - __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Display for Error

source§

fn fmt(&self, __snafu_display_formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for Errorwhere - Self: Debug + Display,

source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl ErrorCompat for Error

source§

fn backtrace(&self) -> Option<&Backtrace>

Returns a Backtrace that may be printed.
§

fn iter_chain(&self) -> ChainCompat<'_>where +}

Variants§

§

Request

Fields

§source: RequestError
§

FetchLeaf

Fields

§resource: String
§

FetchBlock

Fields

§resource: String
§

FetchTransaction

Fields

§resource: String
§

InvalidTransactionIndex

Fields

§height: u64
§index: u64
§

Custom

Fields

§message: String
§status: StatusCode

Implementations§

source§

impl Error

source

pub fn internal<M: Display>(message: M) -> Self

source

pub fn status(&self) -> StatusCode

Trait Implementations§

source§

impl Clone for Error

source§

fn clone(&self) -> Error

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Error

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de> Deserialize<'de> for Error

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl Display for Error

source§

fn fmt(&self, __snafu_display_formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Error for Errorwhere + Self: Debug + Display,

source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl ErrorCompat for Error

source§

fn backtrace(&self) -> Option<&Backtrace>

Returns a Backtrace that may be printed.
§

fn iter_chain(&self) -> ChainCompat<'_>where Self: AsErrorSource,

Returns an iterator for traversing the chain of errors, starting with the current error -and continuing with recursive calls to Error::source. Read more
source§

impl From<(String, StatusCode)> for Error

source§

fn from(original: (String, StatusCode)) -> Error

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(original: Error) -> Error

Converts to this type from the input type.
source§

impl From<RequestError> for Error

source§

fn from(original: RequestError) -> Error

Converts to this type from the input type.
source§

impl<__T0, __T1> IntoError<Error> for BlockStreamSnafu<__T0, __T1>where - Error: Error + ErrorCompat, - __T0: Into<usize>, - __T1: Into<String>,

§

type Source = NoneError

The underlying error
source§

fn into_error(self, error: Self::Source) -> Error

Combine the information to produce the error
source§

impl<__T0, __T1> IntoError<Error> for CustomSnafu<__T0, __T1>where +and continuing with recursive calls to Error::source. Read more

source§

impl From<(String, StatusCode)> for Error

source§

fn from(original: (String, StatusCode)) -> Error

Converts to this type from the input type.
source§

impl From<Error> for Error

source§

fn from(original: Error) -> Error

Converts to this type from the input type.
source§

impl From<RequestError> for Error

source§

fn from(original: RequestError) -> Error

Converts to this type from the input type.
source§

impl<__T0, __T1> IntoError<Error> for CustomSnafu<__T0, __T1>where Error: Error + ErrorCompat, __T0: Into<String>, - __T1: Into<StatusCode>,

§

type Source = NoneError

The underlying error
source§

fn into_error(self, error: Self::Source) -> Error

Combine the information to produce the error
source§

impl IntoError<Error> for InvalidSignatureKeySnafuwhere - Error: Error + ErrorCompat,

§

type Source = NoneError

The underlying error
source§

fn into_error(self, error: Self::Source) -> Error

Combine the information to produce the error
source§

impl<__T0, __T1> IntoError<Error> for InvalidTransactionIndexSnafu<__T0, __T1>where - Error: Error + ErrorCompat, - __T0: Into<u64>, - __T1: Into<u64>,

§

type Source = NoneError

The underlying error
source§

fn into_error(self, error: Self::Source) -> Error

Combine the information to produce the error
source§

impl<__T0, __T1> IntoError<Error> for LeafStreamSnafu<__T0, __T1>where + __T1: Into<StatusCode>,

§

type Source = NoneError

The underlying error
source§

fn into_error(self, error: Self::Source) -> Error

Combine the information to produce the error
source§

impl<__T0> IntoError<Error> for FetchBlockSnafu<__T0>where Error: Error + ErrorCompat, - __T0: Into<usize>, - __T1: Into<String>,

§

type Source = NoneError

The underlying error
source§

fn into_error(self, error: Self::Source) -> Error

Combine the information to produce the error
source§

impl<__T0> IntoError<Error> for QueryBlockSnafu<__T0>where + __T0: Into<String>,

§

type Source = NoneError

The underlying error
source§

fn into_error(self, error: Self::Source) -> Error

Combine the information to produce the error
source§

impl<__T0> IntoError<Error> for FetchLeafSnafu<__T0>where Error: Error + ErrorCompat, - __T0: Into<String>,

§

type Source = QueryError

The underlying error
source§

fn into_error(self, error: Self::Source) -> Error

Combine the information to produce the error
source§

impl<__T0> IntoError<Error> for QueryLeafSnafu<__T0>where + __T0: Into<String>,

§

type Source = NoneError

The underlying error
source§

fn into_error(self, error: Self::Source) -> Error

Combine the information to produce the error
source§

impl<__T0> IntoError<Error> for FetchTransactionSnafu<__T0>where Error: Error + ErrorCompat, - __T0: Into<String>,

§

type Source = QueryError

The underlying error
source§

fn into_error(self, error: Self::Source) -> Error

Combine the information to produce the error
source§

impl<__T0> IntoError<Error> for QueryProposalsSnafu<__T0>where + __T0: Into<String>,

§

type Source = NoneError

The underlying error
source§

fn into_error(self, error: Self::Source) -> Error

Combine the information to produce the error
source§

impl<__T0, __T1> IntoError<Error> for InvalidTransactionIndexSnafu<__T0, __T1>where Error: Error + ErrorCompat, - __T0: Into<EncodedPublicKey>,

§

type Source = QueryError

The underlying error
source§

fn into_error(self, error: Self::Source) -> Error

Combine the information to produce the error
source§

impl<__T0> IntoError<Error> for QueryTransactionSnafu<__T0>where - Error: Error + ErrorCompat, - __T0: Into<String>,

§

type Source = QueryError

The underlying error
source§

fn into_error(self, error: Self::Source) -> Error

Combine the information to produce the error
source§

impl IntoError<Error> for RequestSnafuwhere - Error: Error + ErrorCompat,

§

type Source = RequestError

The underlying error
source§

fn into_error(self, error: Self::Source) -> Error

Combine the information to produce the error
source§

impl IntoError<Error> for StreamBlockSnafuwhere - Error: Error + ErrorCompat,

§

type Source = QueryError

The underlying error
source§

fn into_error(self, error: Self::Source) -> Error

Combine the information to produce the error
source§

impl IntoError<Error> for StreamLeafSnafuwhere - Error: Error + ErrorCompat,

§

type Source = QueryError

The underlying error
source§

fn into_error(self, error: Self::Source) -> Error

Combine the information to produce the error
source§

impl Serialize for Error

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where + __T0: Into<u64>, + __T1: Into<u64>,

§

type Source = NoneError

The underlying error
source§

fn into_error(self, error: Self::Source) -> Error

Combine the information to produce the error
source§

impl IntoError<Error> for RequestSnafuwhere + Error: Error + ErrorCompat,

§

type Source = RequestError

The underlying error
source§

fn into_error(self, error: Self::Source) -> Error

Combine the information to produce the error
source§

impl Serialize for Error

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnwindSafe for Error

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> AsErrorSource for Twhere T: Error + 'static,

§

fn as_error_source(&self) -> &(dyn Error + 'static)

For maximum effectiveness, this needs to be called as a method diff --git a/hotshot_query_service/availability/enum.Fetch.html b/hotshot_query_service/availability/enum.Fetch.html new file mode 100644 index 000000000..ed8835522 --- /dev/null +++ b/hotshot_query_service/availability/enum.Fetch.html @@ -0,0 +1,162 @@ +Fetch in hotshot_query_service::availability - Rust
pub enum Fetch<T> {
+    Ready(T),
+    Pending(BoxFuture<'static, T>),
+}
Expand description

An in-progress request to fetch some data.

+

A Fetch represents the period of uncertainty after some data has been requested, before it +is known whether that data exists locally or must be retrieved from an external source (or +whether we must wait for the data to be created in the first place).

+

For data that is already available locally, a request for that data may return Fetch::Ready +with the data itself. Otherwise, the request will return Fetch::Pending with a future that +will resolve once the data is available.

+

Depending on the context, Fetch can behave a bit like a Future or a bit +like a Result. Therefore, it implements IntoFuture, so it can be awaited (this is the +same as calling resolve) and it implements methods context +and with_context, which make it easy to convert a Fetch to a +Result, mimicking the methods from Snafu traits OptionExt and +ResultExt.

+

Variants§

§

Ready(T)

§

Pending(BoxFuture<'static, T>)

Implementations§

source§

impl<T> Fetch<T>

source

pub fn try_resolve(self) -> Result<T, Self>

Get the requested data if it is available immediately.

+

If the requested data is not immediately available, Err(self) is returned so that the +Fetch object may be used again.

+
source

pub fn context<C, E>(self, context: C) -> Result<T, E>where + C: IntoError<E, Source = NoneError>, + E: Error + ErrorCompat,

Convert this Fetch to a Result with the provided error context.

+

The result indicates whether the requested data is immediately available. If it is, Ok +is returned. Otherwise, an error is created from context using Snafu.

+
source

pub fn with_context<F, C, E>(self, context: F) -> Result<T, E>where + F: FnOnce() -> C, + C: IntoError<E, Source = NoneError>, + E: Error + ErrorCompat,

Convert this Fetch to a Result with the provided error context.

+

The result indicates whether the requested data is immediately available. If it is, Ok +is returned. Otherwise, an error is created from context using Snafu.

+
source§

impl<T: Send + 'static> Fetch<T>

source

pub async fn resolve(self) -> T

Wait for the data to become available, if it is not already.

+
source§

impl<T: 'static> Fetch<T>

source

pub fn map<F, U>(self, f: F) -> Fetch<U>where + F: 'static + Send + FnOnce(T) -> U,

Transform the result of this fetch.

+

If the requested data is already available, f will be applied immediately. Otherwise, f +will be saved and applied after the pending future resolves.

+

Trait Implementations§

source§

impl<T: Send + 'static> IntoFuture for Fetch<T>

§

type Output = T

The output that the future will produce on completion.
§

type IntoFuture = Pin<Box<dyn Future<Output = <Fetch<T> as IntoFuture>::Output> + Send>>

Which kind of future are we turning this into?
source§

fn into_future(self) -> Self::IntoFuture

Creates a future from a value. Read more

Auto Trait Implementations§

§

impl<T> !RefUnwindSafe for Fetch<T>

§

impl<T> Send for Fetch<T>where + T: Send,

§

impl<T> !Sync for Fetch<T>

§

impl<T> Unpin for Fetch<T>where + T: Unpin,

§

impl<T> !UnwindSafe for Fetch<T>

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32 +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Conv for T

§

fn conv<T>(self) -> Twhere + Self: Into<T>,

Converts self into T using Into<T>. Read more
§

impl<T> Downcast for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can +then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be +further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot +generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot +generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> FmtForward for T

§

fn fmt_binary(self) -> FmtBinary<Self>where + Self: Binary,

Causes self to use its Binary implementation when Debug-formatted.
§

fn fmt_display(self) -> FmtDisplay<Self>where + Self: Display,

Causes self to use its Display implementation when +Debug-formatted.
§

fn fmt_lower_exp(self) -> FmtLowerExp<Self>where + Self: LowerExp,

Causes self to use its LowerExp implementation when +Debug-formatted.
§

fn fmt_lower_hex(self) -> FmtLowerHex<Self>where + Self: LowerHex,

Causes self to use its LowerHex implementation when +Debug-formatted.
§

fn fmt_octal(self) -> FmtOctal<Self>where + Self: Octal,

Causes self to use its Octal implementation when Debug-formatted.
§

fn fmt_pointer(self) -> FmtPointer<Self>where + Self: Pointer,

Causes self to use its Pointer implementation when +Debug-formatted.
§

fn fmt_upper_exp(self) -> FmtUpperExp<Self>where + Self: UpperExp,

Causes self to use its UpperExp implementation when +Debug-formatted.
§

fn fmt_upper_hex(self) -> FmtUpperHex<Self>where + Self: UpperHex,

Causes self to use its UpperHex implementation when +Debug-formatted.
§

fn fmt_list(self) -> FmtList<Self>where + &'a Self: for<'a> IntoIterator,

Formats each item in a sequence. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

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

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

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
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 Twhere + 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.

+
§

impl<D> OwoColorize for D

§

fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where + C: Color,

Set the foreground color generically Read more
§

fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where + C: Color,

Set the background color generically. Read more
§

fn black<'a>(&'a self) -> FgColorDisplay<'a, Black, Self>

Change the foreground color to black
§

fn on_black<'a>(&'a self) -> BgColorDisplay<'a, Black, Self>

Change the background color to black
§

fn red<'a>(&'a self) -> FgColorDisplay<'a, Red, Self>

Change the foreground color to red
§

fn on_red<'a>(&'a self) -> BgColorDisplay<'a, Red, Self>

Change the background color to red
§

fn green<'a>(&'a self) -> FgColorDisplay<'a, Green, Self>

Change the foreground color to green
§

fn on_green<'a>(&'a self) -> BgColorDisplay<'a, Green, Self>

Change the background color to green
§

fn yellow<'a>(&'a self) -> FgColorDisplay<'a, Yellow, Self>

Change the foreground color to yellow
§

fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>

Change the background color to yellow
§

fn blue<'a>(&'a self) -> FgColorDisplay<'a, Blue, Self>

Change the foreground color to blue
§

fn on_blue<'a>(&'a self) -> BgColorDisplay<'a, Blue, Self>

Change the background color to blue
§

fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>

Change the foreground color to magenta
§

fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>

Change the background color to magenta
§

fn purple<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>

Change the foreground color to purple
§

fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>

Change the background color to purple
§

fn cyan<'a>(&'a self) -> FgColorDisplay<'a, Cyan, Self>

Change the foreground color to cyan
§

fn on_cyan<'a>(&'a self) -> BgColorDisplay<'a, Cyan, Self>

Change the background color to cyan
§

fn white<'a>(&'a self) -> FgColorDisplay<'a, White, Self>

Change the foreground color to white
§

fn on_white<'a>(&'a self) -> BgColorDisplay<'a, White, Self>

Change the background color to white
§

fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>

Change the foreground color to the terminal default
§

fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>

Change the background color to the terminal default
§

fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>

Change the foreground color to bright black
§

fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>

Change the background color to bright black
§

fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>

Change the foreground color to bright red
§

fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>

Change the background color to bright red
§

fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>

Change the foreground color to bright green
§

fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>

Change the background color to bright green
§

fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>

Change the foreground color to bright yellow
§

fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>

Change the background color to bright yellow
§

fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>

Change the foreground color to bright blue
§

fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>

Change the background color to bright blue
§

fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>

Change the foreground color to bright magenta
§

fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>

Change the background color to bright magenta
§

fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>

Change the foreground color to bright purple
§

fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>

Change the background color to bright purple
§

fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>

Change the foreground color to bright cyan
§

fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>

Change the background color to bright cyan
§

fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>

Change the foreground color to bright white
§

fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>

Change the background color to bright white
§

fn bold<'a>(&'a self) -> BoldDisplay<'a, Self>

Make the text bold
§

fn dimmed<'a>(&'a self) -> DimDisplay<'a, Self>

Make the text dim
§

fn italic<'a>(&'a self) -> ItalicDisplay<'a, Self>

Make the text italicized
§

fn underline<'a>(&'a self) -> UnderlineDisplay<'a, Self>

Make the text italicized
Make the text blink
Make the text blink (but fast!)
§

fn reversed<'a>(&'a self) -> ReversedDisplay<'a, Self>

Swap the foreground and background colors
§

fn hidden<'a>(&'a self) -> HiddenDisplay<'a, Self>

Hide the text
§

fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>

Cross out the text
§

fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where + Color: DynColor,

Set the foreground color at runtime. Only use if you do not know which color will be used at +compile-time. If the color is constant, use either OwoColorize::fg or +a color-specific method, such as OwoColorize::green, Read more
§

fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where + Color: DynColor,

Set the background color at runtime. Only use if you do not know what color to use at +compile-time. If the color is constant, use either OwoColorize::bg or +a color-specific method, such as OwoColorize::on_yellow, Read more
§

fn fg_rgb<const R: u8, const G: u8, const B: u8>( + &self +) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the foreground color to a specific RGB value.
§

fn bg_rgb<const R: u8, const G: u8, const B: u8>( + &self +) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the background color to a specific RGB value.
§

fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>

Sets the foreground color to an RGB value.
§

fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>

Sets the background color to an RGB value.
§

fn style(&self, style: Style) -> Styled<&Self>

Apply a runtime-determined style
§

impl<T> Pipe for Twhere + T: ?Sized,

§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere + Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere + R: 'a,

Borrows self and passes that borrow into the pipe function. Read more
§

fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere + R: 'a,

Mutably borrows self and passes that borrow into the pipe function. Read more
§

fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> Rwhere + Self: Borrow<B>, + B: 'a + ?Sized, + R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
§

fn pipe_borrow_mut<'a, B, R>( + &'a mut self, + func: impl FnOnce(&'a mut B) -> R +) -> Rwhere + Self: BorrowMut<B>, + B: 'a + ?Sized, + R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe +function. Read more
§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> Rwhere + Self: AsRef<U>, + U: 'a + ?Sized, + R: 'a,

Borrows self, then passes self.as_ref() into the pipe function.
§

fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> Rwhere + Self: AsMut<U>, + U: 'a + ?Sized, + R: 'a,

Mutably borrows self, then passes self.as_mut() into the pipe +function.
§

fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> Rwhere + Self: Deref<Target = T>, + T: 'a + ?Sized, + R: 'a,

Borrows self, then passes self.deref() into the pipe function.
§

fn pipe_deref_mut<'a, T, R>( + &'a mut self, + func: impl FnOnce(&'a mut T) -> R +) -> Rwhere + Self: DerefMut<Target = T> + Deref, + T: 'a + ?Sized, + R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe +function.
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
§

impl<T> Tap for T

§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Selfwhere + Self: Borrow<B>, + B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
§

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere + Self: BorrowMut<B>, + B: ?Sized,

Mutable access to the BorrowMut<B> of a value. Read more
§

fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Selfwhere + Self: AsRef<R>, + R: ?Sized,

Immutable access to the AsRef<R> view of a value. Read more
§

fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere + Self: AsMut<R>, + R: ?Sized,

Mutable access to the AsMut<R> view of a value. Read more
§

fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Selfwhere + Self: Deref<Target = T>, + T: ?Sized,

Immutable access to the Deref::Target of a value. Read more
§

fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Selfwhere + Self: DerefMut<Target = T> + Deref, + T: ?Sized,

Mutable access to the Deref::Target of a value. Read more
§

fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

Calls .tap() only in debug builds, and is erased in release builds.
§

fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

Calls .tap_mut() only in debug builds, and is erased in release +builds.
§

fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Selfwhere + Self: Borrow<B>, + B: ?Sized,

Calls .tap_borrow() only in debug builds, and is erased in release +builds.
§

fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere + Self: BorrowMut<B>, + B: ?Sized,

Calls .tap_borrow_mut() only in debug builds, and is erased in release +builds.
§

fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Selfwhere + Self: AsRef<R>, + R: ?Sized,

Calls .tap_ref() only in debug builds, and is erased in release +builds.
§

fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere + Self: AsMut<R>, + R: ?Sized,

Calls .tap_ref_mut() only in debug builds, and is erased in release +builds.
§

fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Selfwhere + Self: Deref<Target = T>, + T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release +builds.
§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Selfwhere + Self: DerefMut<Target = T> + Deref, + T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release +builds.
§

impl<T> TryConv for T

§

fn try_conv<T>(self) -> Result<T, Self::Error>where + Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

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 Twhere + U: TryFrom<T>,

§

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.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
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
\ No newline at end of file diff --git a/hotshot_query_service/availability/enum.ResourceId.html b/hotshot_query_service/availability/enum.ResourceId.html index 41c9123e7..3cec37b0b 100644 --- a/hotshot_query_service/availability/enum.ResourceId.html +++ b/hotshot_query_service/availability/enum.ResourceId.html @@ -1,7 +1,7 @@ ResourceId in hotshot_query_service::availability - Rust
pub enum ResourceId<T: Committable> {
     Number(usize),
     Hash(Commitment<T>),
-}

Variants§

§

Number(usize)

§

Hash(Commitment<T>)

Trait Implementations§

source§

impl<T: Committable> Clone for ResourceId<T>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T: Committable> Debug for ResourceId<T>

source§

fn fmt(&self, __f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T: Committable> Display for ResourceId<T>

source§

fn fmt(&self, _derive_more_display_formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T: Committable> From<Commitment<T>> for ResourceId<T>

source§

fn from(original: Commitment<T>) -> ResourceId<T>

Converts to this type from the input type.
source§

impl<T: Committable> From<usize> for ResourceId<T>

source§

fn from(original: usize) -> ResourceId<T>

Converts to this type from the input type.
source§

impl<T: Committable> Hash for ResourceId<T>

source§

fn hash<__HT>(&self, __state: &mut __HT)where +}

Variants§

§

Number(usize)

§

Hash(Commitment<T>)

Trait Implementations§

source§

impl<T: Committable> Clone for ResourceId<T>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<T: Committable> Debug for ResourceId<T>

source§

fn fmt(&self, __f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T: Committable> Display for ResourceId<T>

source§

fn fmt(&self, _derive_more_display_formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<T: Committable> From<Commitment<T>> for ResourceId<T>

source§

fn from(original: Commitment<T>) -> ResourceId<T>

Converts to this type from the input type.
source§

impl<T: Committable> From<usize> for ResourceId<T>

source§

fn from(original: usize) -> ResourceId<T>

Converts to this type from the input type.
source§

impl<T: Committable> Hash for ResourceId<T>

source§

fn hash<__HT>(&self, __state: &mut __HT)where __HT: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl<T: Committable> Ord for ResourceId<T>

source§

fn cmp(&self, other: &Self) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere diff --git a/hotshot_query_service/availability/fetch/enum.Fetch.html b/hotshot_query_service/availability/fetch/enum.Fetch.html new file mode 100644 index 000000000..05d0ec8ab --- /dev/null +++ b/hotshot_query_service/availability/fetch/enum.Fetch.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../hotshot_query_service/availability/enum.Fetch.html...

+ + + \ No newline at end of file diff --git a/hotshot_query_service/availability/fn.define_api.html b/hotshot_query_service/availability/fn.define_api.html index fc31f91c5..bdbb6f627 100644 --- a/hotshot_query_service/availability/fn.define_api.html +++ b/hotshot_query_service/availability/fn.define_api.html @@ -1,4 +1,4 @@ -define_api in hotshot_query_service::availability - Rust
pub fn define_api<State, Types: NodeType>(
+define_api in hotshot_query_service::availability - Rust
pub fn define_api<State, Types: NodeType>(
     options: &Options
 ) -> Result<Api<State, Error>, ApiError>where
     State: 'static + Send + Sync + ReadState,
diff --git a/hotshot_query_service/availability/index.html b/hotshot_query_service/availability/index.html
index 71a587f60..e52f2c42e 100644
--- a/hotshot_query_service/availability/index.html
+++ b/hotshot_query_service/availability/index.html
@@ -1 +1,14 @@
-hotshot_query_service::availability - Rust

Structs

Enums

Traits

Functions

Type Aliases

\ No newline at end of file +hotshot_query_service::availability - Rust
Expand description

Queries for HotShot chain state.

+

The availability API provides an objective view of the HotShot blockchain. It provides access +only to normative data: that is, data which is agreed upon by all honest consensus nodes and +which is immutable. This means access to core consensus data structures including leaves, +blocks, and headers, where each query is pure and idempotent. This also means that it is +possible for a client to verify all of the information provided by this API, by running a +HotShot light client and downloading the appropriate evidence with each query.

+

This API does not provide any queries which represent only the current state of the chain or +may change over time, and it does not provide information for which there is not (yet) agreement +of a supermajority of consensus nodes. For information about the current dynamic state of +consensus and uncommitted state, try the status API. For information about the +chain which is tabulated by this specific node and not subject to full consensus agreement, try +the node API.

+

Structs

Enums

Traits

Functions

Type Aliases

\ No newline at end of file diff --git a/hotshot_query_service/availability/sidebar-items.js b/hotshot_query_service/availability/sidebar-items.js index b5946f8ac..c68ce245f 100644 --- a/hotshot_query_service/availability/sidebar-items.js +++ b/hotshot_query_service/availability/sidebar-items.js @@ -1 +1 @@ -window.SIDEBAR_ITEMS = {"enum":["Error","ResourceId"],"fn":["define_api"],"struct":["BlockQueryData","BlockStreamSnafu","CustomSnafu","InconsistentLeafError","InvalidSignatureKeySnafu","InvalidTransactionIndexSnafu","LeafQueryData","LeafStreamSnafu","Options","QueryBlockSnafu","QueryLeafSnafu","QueryProposalsSnafu","QueryTransactionSnafu","RequestSnafu","StreamBlockSnafu","StreamLeafSnafu","TransactionQueryData"],"trait":["AvailabilityDataSource","QueryablePayload","UpdateAvailabilityData"],"type":["BlockHash","BlockId","LeafHash","LeafId","Timestamp","TransactionHash","TransactionInclusionProof","TransactionIndex"]}; \ No newline at end of file +window.SIDEBAR_ITEMS = {"enum":["Error","Fetch","ResourceId"],"fn":["define_api"],"struct":["BlockQueryData","CustomSnafu","FetchBlockSnafu","FetchLeafSnafu","FetchTransactionSnafu","InconsistentLeafError","InvalidTransactionIndexSnafu","LeafQueryData","Options","RequestSnafu","TransactionQueryData"],"trait":["AvailabilityDataSource","QueryablePayload","UpdateAvailabilityData"],"type":["BlockHash","BlockId","LeafHash","LeafId","Timestamp","TransactionHash","TransactionInclusionProof","TransactionIndex"]}; \ No newline at end of file diff --git a/hotshot_query_service/availability/struct.BlockQueryData.html b/hotshot_query_service/availability/struct.BlockQueryData.html index d27aa1087..d4f2ceb9d 100644 --- a/hotshot_query_service/availability/struct.BlockQueryData.html +++ b/hotshot_query_service/availability/struct.BlockQueryData.html @@ -1,6 +1,6 @@ -BlockQueryData in hotshot_query_service::availability - Rust
pub struct BlockQueryData<Types: NodeType> { /* private fields */ }

Implementations§

source§

impl<Types: NodeType> BlockQueryData<Types>

source

pub fn new( - leaf: Leaf<Types>, - qc: QuorumCertificate<Types>, +BlockQueryData in hotshot_query_service::availability - Rust
pub struct BlockQueryData<Types: NodeType> { /* private fields */ }

Implementations§

source§

impl<Types: NodeType> BlockQueryData<Types>

source

pub fn new( + leaf: &Leaf<Types>, + qc: &QuorumCertificate<Types>, payload: Payload<Types> ) -> Result<Self, InconsistentLeafError<Types>>

Collect information about a block.

Returns a new BlockQueryData object populated from leaf, qc, and payload.

@@ -10,11 +10,14 @@
Errors
unspecified. In debug builds, the call may panic. However, this consistency check is quite expensive, and may be omitted in optimized builds. The responsibility of ensuring consistency between leaf and payload ultimately falls on the caller.

-
source

pub fn genesis() -> Self

source

pub fn header(&self) -> &Header<Types>

source

pub fn metadata(&self) -> &Metadata<Types>

source

pub fn payload(&self) -> &Payload<Types>

source

pub fn hash(&self) -> BlockHash<Types>

source

pub fn height(&self) -> u64

source

pub fn size(&self) -> u64

source§

impl<Types: NodeType> BlockQueryData<Types>where +

source

pub fn genesis() -> Self

source

pub fn header(&self) -> &Header<Types>

source

pub fn metadata(&self) -> &Metadata<Types>

source

pub fn payload(&self) -> &Payload<Types>

source

pub fn hash(&self) -> BlockHash<Types>

source

pub fn height(&self) -> u64

source

pub fn size(&self) -> u64

source§

impl<Types: NodeType> BlockQueryData<Types>where Payload<Types>: QueryablePayload,

source

pub fn transaction( &self, i: &TransactionIndex<Types> -) -> Option<TransactionQueryData<Types>>

source

pub fn len(&self) -> usize

source

pub fn is_empty(&self) -> bool

source

pub fn enumerate( +) -> Option<TransactionQueryData<Types>>

source

pub fn transaction_by_hash( + &self, + hash: Commitment<Transaction<Types>> +) -> Option<TransactionIndex<Types>>

source

pub fn len(&self) -> usize

source

pub fn is_empty(&self) -> bool

source

pub fn enumerate( &self ) -> impl '_ + Iterator<Item = (TransactionIndex<Types>, Transaction<Types>)>

Trait Implementations§

source§

impl<Types: Clone + NodeType> Clone for BlockQueryData<Types>

source§

fn clone(&self) -> BlockQueryData<Types>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<Types: Debug + NodeType> Debug for BlockQueryData<Types>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de, Types: NodeType> Deserialize<'de> for BlockQueryData<Types>

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<Types: PartialEq + NodeType> PartialEq for BlockQueryData<Types>

source§

fn eq(&self, other: &BlockQueryData<Types>) -> bool

This method tests for self and other values to be equal, and is used diff --git a/hotshot_query_service/availability/struct.CustomSnafu.html b/hotshot_query_service/availability/struct.CustomSnafu.html index 377718a5e..5d7d10f09 100644 --- a/hotshot_query_service/availability/struct.CustomSnafu.html +++ b/hotshot_query_service/availability/struct.CustomSnafu.html @@ -1,17 +1,17 @@ -CustomSnafu in hotshot_query_service::availability - Rust
pub struct CustomSnafu<__T0, __T1> {
+CustomSnafu in hotshot_query_service::availability - Rust
pub struct CustomSnafu<__T0, __T1> {
     pub message: __T0,
     pub status: __T1,
 }
Expand description

SNAFU context selector for the Error::Custom variant

-

Fields§

§message: __T0§status: __T1

Implementations§

source§

impl<__T0, __T1> CustomSnafu<__T0, __T1>

source

pub fn build(self) -> Errorwhere +

Fields§

§message: __T0§status: __T1

Implementations§

source§

impl<__T0, __T1> CustomSnafu<__T0, __T1>

source

pub fn build(self) -> Errorwhere __T0: Into<String>, __T1: Into<StatusCode>,

Consume the selector and return the associated error

-
source

pub fn fail<__T>(self) -> Result<__T, Error>where +

source

pub fn fail<__T>(self) -> Result<__T, Error>where __T0: Into<String>, __T1: Into<StatusCode>,

Consume the selector and return a Result with the associated error

-

Trait Implementations§

source§

impl<__T0: Clone, __T1: Clone> Clone for CustomSnafu<__T0, __T1>

source§

fn clone(&self) -> CustomSnafu<__T0, __T1>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<__T0: Debug, __T1: Debug> Debug for CustomSnafu<__T0, __T1>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<__T0, __T1> IntoError<Error> for CustomSnafu<__T0, __T1>where +

Trait Implementations§

source§

impl<__T0: Clone, __T1: Clone> Clone for CustomSnafu<__T0, __T1>

source§

fn clone(&self) -> CustomSnafu<__T0, __T1>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<__T0: Debug, __T1: Debug> Debug for CustomSnafu<__T0, __T1>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<__T0, __T1> IntoError<Error> for CustomSnafu<__T0, __T1>where Error: Error + ErrorCompat, __T0: Into<String>, - __T1: Into<StatusCode>,

§

type Source = NoneError

The underlying error
source§

fn into_error(self, error: Self::Source) -> Error

Combine the information to produce the error
source§

impl<__T0: Copy, __T1: Copy> Copy for CustomSnafu<__T0, __T1>

Auto Trait Implementations§

§

impl<__T0, __T1> RefUnwindSafe for CustomSnafu<__T0, __T1>where + __T1: Into<StatusCode>,

§

type Source = NoneError

The underlying error
source§

fn into_error(self, error: Self::Source) -> Error

Combine the information to produce the error
source§

impl<__T0: Copy, __T1: Copy> Copy for CustomSnafu<__T0, __T1>

Auto Trait Implementations§

§

impl<__T0, __T1> RefUnwindSafe for CustomSnafu<__T0, __T1>where __T0: RefUnwindSafe, __T1: RefUnwindSafe,

§

impl<__T0, __T1> Send for CustomSnafu<__T0, __T1>where __T0: Send, diff --git a/hotshot_query_service/availability/struct.QueryBlockSnafu.html b/hotshot_query_service/availability/struct.FetchBlockSnafu.html similarity index 86% rename from hotshot_query_service/availability/struct.QueryBlockSnafu.html rename to hotshot_query_service/availability/struct.FetchBlockSnafu.html index 7a3e034f8..c5f2203b7 100644 --- a/hotshot_query_service/availability/struct.QueryBlockSnafu.html +++ b/hotshot_query_service/availability/struct.FetchBlockSnafu.html @@ -1,13 +1,17 @@ -QueryBlockSnafu in hotshot_query_service::availability - Rust
pub struct QueryBlockSnafu<__T0> {
+FetchBlockSnafu in hotshot_query_service::availability - Rust
pub struct FetchBlockSnafu<__T0> {
     pub resource: __T0,
-}
Expand description

SNAFU context selector for the Error::QueryBlock variant

-

Fields§

§resource: __T0

Trait Implementations§

source§

impl<__T0: Clone> Clone for QueryBlockSnafu<__T0>

source§

fn clone(&self) -> QueryBlockSnafu<__T0>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<__T0: Debug> Debug for QueryBlockSnafu<__T0>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<__T0> IntoError<Error> for QueryBlockSnafu<__T0>where +}

Expand description

SNAFU context selector for the Error::FetchBlock variant

+

Fields§

§resource: __T0

Implementations§

source§

impl<__T0> FetchBlockSnafu<__T0>

source

pub fn build(self) -> Errorwhere + __T0: Into<String>,

Consume the selector and return the associated error

+
source

pub fn fail<__T>(self) -> Result<__T, Error>where + __T0: Into<String>,

Consume the selector and return a Result with the associated error

+

Trait Implementations§

source§

impl<__T0: Clone> Clone for FetchBlockSnafu<__T0>

source§

fn clone(&self) -> FetchBlockSnafu<__T0>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<__T0: Debug> Debug for FetchBlockSnafu<__T0>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<__T0> IntoError<Error> for FetchBlockSnafu<__T0>where Error: Error + ErrorCompat, - __T0: Into<String>,

§

type Source = QueryError

The underlying error
source§

fn into_error(self, error: Self::Source) -> Error

Combine the information to produce the error
source§

impl<__T0: Copy> Copy for QueryBlockSnafu<__T0>

Auto Trait Implementations§

§

impl<__T0> RefUnwindSafe for QueryBlockSnafu<__T0>where - __T0: RefUnwindSafe,

§

impl<__T0> Send for QueryBlockSnafu<__T0>where - __T0: Send,

§

impl<__T0> Sync for QueryBlockSnafu<__T0>where - __T0: Sync,

§

impl<__T0> Unpin for QueryBlockSnafu<__T0>where - __T0: Unpin,

§

impl<__T0> UnwindSafe for QueryBlockSnafu<__T0>where + __T0: Into<String>,

§

type Source = NoneError

The underlying error
source§

fn into_error(self, error: Self::Source) -> Error

Combine the information to produce the error

source§

impl<__T0: Copy> Copy for FetchBlockSnafu<__T0>

Auto Trait Implementations§

§

impl<__T0> RefUnwindSafe for FetchBlockSnafu<__T0>where + __T0: RefUnwindSafe,

§

impl<__T0> Send for FetchBlockSnafu<__T0>where + __T0: Send,

§

impl<__T0> Sync for FetchBlockSnafu<__T0>where + __T0: Sync,

§

impl<__T0> Unpin for FetchBlockSnafu<__T0>where + __T0: Unpin,

§

impl<__T0> UnwindSafe for FetchBlockSnafu<__T0>where __T0: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere diff --git a/hotshot_query_service/availability/struct.QueryLeafSnafu.html b/hotshot_query_service/availability/struct.FetchLeafSnafu.html similarity index 86% rename from hotshot_query_service/availability/struct.QueryLeafSnafu.html rename to hotshot_query_service/availability/struct.FetchLeafSnafu.html index 900f79d08..a689b283f 100644 --- a/hotshot_query_service/availability/struct.QueryLeafSnafu.html +++ b/hotshot_query_service/availability/struct.FetchLeafSnafu.html @@ -1,13 +1,17 @@ -QueryLeafSnafu in hotshot_query_service::availability - Rust
pub struct QueryLeafSnafu<__T0> {
+FetchLeafSnafu in hotshot_query_service::availability - Rust
pub struct FetchLeafSnafu<__T0> {
     pub resource: __T0,
-}
Expand description

SNAFU context selector for the Error::QueryLeaf variant

-

Fields§

§resource: __T0

Trait Implementations§

source§

impl<__T0: Clone> Clone for QueryLeafSnafu<__T0>

source§

fn clone(&self) -> QueryLeafSnafu<__T0>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<__T0: Debug> Debug for QueryLeafSnafu<__T0>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<__T0> IntoError<Error> for QueryLeafSnafu<__T0>where +}

Expand description

SNAFU context selector for the Error::FetchLeaf variant

+

Fields§

§resource: __T0

Implementations§

source§

impl<__T0> FetchLeafSnafu<__T0>

source

pub fn build(self) -> Errorwhere + __T0: Into<String>,

Consume the selector and return the associated error

+
source

pub fn fail<__T>(self) -> Result<__T, Error>where + __T0: Into<String>,

Consume the selector and return a Result with the associated error

+

Trait Implementations§

source§

impl<__T0: Clone> Clone for FetchLeafSnafu<__T0>

source§

fn clone(&self) -> FetchLeafSnafu<__T0>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<__T0: Debug> Debug for FetchLeafSnafu<__T0>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<__T0> IntoError<Error> for FetchLeafSnafu<__T0>where Error: Error + ErrorCompat, - __T0: Into<String>,

§

type Source = QueryError

The underlying error
source§

fn into_error(self, error: Self::Source) -> Error

Combine the information to produce the error
source§

impl<__T0: Copy> Copy for QueryLeafSnafu<__T0>

Auto Trait Implementations§

§

impl<__T0> RefUnwindSafe for QueryLeafSnafu<__T0>where - __T0: RefUnwindSafe,

§

impl<__T0> Send for QueryLeafSnafu<__T0>where - __T0: Send,

§

impl<__T0> Sync for QueryLeafSnafu<__T0>where - __T0: Sync,

§

impl<__T0> Unpin for QueryLeafSnafu<__T0>where - __T0: Unpin,

§

impl<__T0> UnwindSafe for QueryLeafSnafu<__T0>where + __T0: Into<String>,

§

type Source = NoneError

The underlying error
source§

fn into_error(self, error: Self::Source) -> Error

Combine the information to produce the error
source§

impl<__T0: Copy> Copy for FetchLeafSnafu<__T0>

Auto Trait Implementations§

§

impl<__T0> RefUnwindSafe for FetchLeafSnafu<__T0>where + __T0: RefUnwindSafe,

§

impl<__T0> Send for FetchLeafSnafu<__T0>where + __T0: Send,

§

impl<__T0> Sync for FetchLeafSnafu<__T0>where + __T0: Sync,

§

impl<__T0> Unpin for FetchLeafSnafu<__T0>where + __T0: Unpin,

§

impl<__T0> UnwindSafe for FetchLeafSnafu<__T0>where __T0: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere diff --git a/hotshot_query_service/availability/struct.QueryTransactionSnafu.html b/hotshot_query_service/availability/struct.FetchTransactionSnafu.html similarity index 86% rename from hotshot_query_service/availability/struct.QueryTransactionSnafu.html rename to hotshot_query_service/availability/struct.FetchTransactionSnafu.html index edc7ce549..1f0d01659 100644 --- a/hotshot_query_service/availability/struct.QueryTransactionSnafu.html +++ b/hotshot_query_service/availability/struct.FetchTransactionSnafu.html @@ -1,13 +1,17 @@ -QueryTransactionSnafu in hotshot_query_service::availability - Rust
pub struct QueryTransactionSnafu<__T0> {
+FetchTransactionSnafu in hotshot_query_service::availability - Rust
pub struct FetchTransactionSnafu<__T0> {
     pub resource: __T0,
-}
Expand description

SNAFU context selector for the Error::QueryTransaction variant

-

Fields§

§resource: __T0

Trait Implementations§

source§

impl<__T0: Clone> Clone for QueryTransactionSnafu<__T0>

source§

fn clone(&self) -> QueryTransactionSnafu<__T0>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<__T0: Debug> Debug for QueryTransactionSnafu<__T0>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<__T0> IntoError<Error> for QueryTransactionSnafu<__T0>where +}

Expand description

SNAFU context selector for the Error::FetchTransaction variant

+

Fields§

§resource: __T0

Implementations§

source§

impl<__T0> FetchTransactionSnafu<__T0>

source

pub fn build(self) -> Errorwhere + __T0: Into<String>,

Consume the selector and return the associated error

+
source

pub fn fail<__T>(self) -> Result<__T, Error>where + __T0: Into<String>,

Consume the selector and return a Result with the associated error

+

Trait Implementations§

source§

impl<__T0: Clone> Clone for FetchTransactionSnafu<__T0>

source§

fn clone(&self) -> FetchTransactionSnafu<__T0>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<__T0: Debug> Debug for FetchTransactionSnafu<__T0>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<__T0> IntoError<Error> for FetchTransactionSnafu<__T0>where Error: Error + ErrorCompat, - __T0: Into<String>,

§

type Source = QueryError

The underlying error
source§

fn into_error(self, error: Self::Source) -> Error

Combine the information to produce the error
source§

impl<__T0: Copy> Copy for QueryTransactionSnafu<__T0>

Auto Trait Implementations§

§

impl<__T0> RefUnwindSafe for QueryTransactionSnafu<__T0>where - __T0: RefUnwindSafe,

§

impl<__T0> Send for QueryTransactionSnafu<__T0>where - __T0: Send,

§

impl<__T0> Sync for QueryTransactionSnafu<__T0>where - __T0: Sync,

§

impl<__T0> Unpin for QueryTransactionSnafu<__T0>where - __T0: Unpin,

§

impl<__T0> UnwindSafe for QueryTransactionSnafu<__T0>where + __T0: Into<String>,

§

type Source = NoneError

The underlying error
source§

fn into_error(self, error: Self::Source) -> Error

Combine the information to produce the error
source§

impl<__T0: Copy> Copy for FetchTransactionSnafu<__T0>

Auto Trait Implementations§

§

impl<__T0> RefUnwindSafe for FetchTransactionSnafu<__T0>where + __T0: RefUnwindSafe,

§

impl<__T0> Send for FetchTransactionSnafu<__T0>where + __T0: Send,

§

impl<__T0> Sync for FetchTransactionSnafu<__T0>where + __T0: Sync,

§

impl<__T0> Unpin for FetchTransactionSnafu<__T0>where + __T0: Unpin,

§

impl<__T0> UnwindSafe for FetchTransactionSnafu<__T0>where __T0: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere diff --git a/hotshot_query_service/availability/struct.InconsistentLeafError.html b/hotshot_query_service/availability/struct.InconsistentLeafError.html index 07832bbe3..db369d3e6 100644 --- a/hotshot_query_service/availability/struct.InconsistentLeafError.html +++ b/hotshot_query_service/availability/struct.InconsistentLeafError.html @@ -1,7 +1,7 @@ InconsistentLeafError in hotshot_query_service::availability - Rust
pub struct InconsistentLeafError<Types: NodeType> {
     pub leaf: LeafHash<Types>,
     pub qc_leaf: LeafHash<Types>,
-}

Fields§

§leaf: LeafHash<Types>§qc_leaf: LeafHash<Types>

Trait Implementations§

source§

impl<Types: Clone + NodeType> Clone for InconsistentLeafError<Types>

source§

fn clone(&self) -> InconsistentLeafError<Types>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<Types: Debug + NodeType> Debug for InconsistentLeafError<Types>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<Types: NodeType> Display for InconsistentLeafError<Types>

source§

fn fmt(&self, __snafu_display_formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<Types: NodeType> Error for InconsistentLeafError<Types>where +}

Fields§

§leaf: LeafHash<Types>§qc_leaf: LeafHash<Types>

Trait Implementations§

source§

impl<Types: Clone + NodeType> Clone for InconsistentLeafError<Types>

source§

fn clone(&self) -> InconsistentLeafError<Types>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<Types: Debug + NodeType> Debug for InconsistentLeafError<Types>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<Types: NodeType> Display for InconsistentLeafError<Types>

source§

fn fmt(&self, __snafu_display_formatter: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<Types: NodeType> Error for InconsistentLeafError<Types>where Self: Debug + Display,

source§

fn description(&self) -> &str

👎Deprecated since 1.42.0: use the Display impl or to_string()
source§

fn cause(&self) -> Option<&dyn Error>

👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
source§

fn source(&self) -> Option<&(dyn Error + 'static)>

The lower-level source of this error, if any. Read more
source§

fn provide<'a>(&'a self, request: &mut Request<'a>)

🔬This is a nightly-only experimental API. (error_generic_member_access)
Provides type based access to context intended for error reports. Read more
source§

impl<Types: NodeType> ErrorCompat for InconsistentLeafError<Types>

source§

fn backtrace(&self) -> Option<&Backtrace>

Returns a Backtrace that may be printed.
§

fn iter_chain(&self) -> ChainCompat<'_>where Self: AsErrorSource,

Returns an iterator for traversing the chain of errors, starting with the current error diff --git a/hotshot_query_service/availability/struct.InvalidTransactionIndexSnafu.html b/hotshot_query_service/availability/struct.InvalidTransactionIndexSnafu.html index f595e9d88..3395a5ad5 100644 --- a/hotshot_query_service/availability/struct.InvalidTransactionIndexSnafu.html +++ b/hotshot_query_service/availability/struct.InvalidTransactionIndexSnafu.html @@ -1,17 +1,17 @@ -InvalidTransactionIndexSnafu in hotshot_query_service::availability - Rust
pub struct InvalidTransactionIndexSnafu<__T0, __T1> {
+InvalidTransactionIndexSnafu in hotshot_query_service::availability - Rust
pub struct InvalidTransactionIndexSnafu<__T0, __T1> {
     pub height: __T0,
     pub index: __T1,
 }
Expand description

SNAFU context selector for the Error::InvalidTransactionIndex variant

-

Fields§

§height: __T0§index: __T1

Implementations§

source§

impl<__T0, __T1> InvalidTransactionIndexSnafu<__T0, __T1>

source

pub fn build(self) -> Errorwhere +

Fields§

§height: __T0§index: __T1

Implementations§

source§

impl<__T0, __T1> InvalidTransactionIndexSnafu<__T0, __T1>

source

pub fn build(self) -> Errorwhere __T0: Into<u64>, __T1: Into<u64>,

Consume the selector and return the associated error

-
source

pub fn fail<__T>(self) -> Result<__T, Error>where +

source

pub fn fail<__T>(self) -> Result<__T, Error>where __T0: Into<u64>, __T1: Into<u64>,

Consume the selector and return a Result with the associated error

-

Trait Implementations§

source§

impl<__T0: Clone, __T1: Clone> Clone for InvalidTransactionIndexSnafu<__T0, __T1>

source§

fn clone(&self) -> InvalidTransactionIndexSnafu<__T0, __T1>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<__T0: Debug, __T1: Debug> Debug for InvalidTransactionIndexSnafu<__T0, __T1>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<__T0, __T1> IntoError<Error> for InvalidTransactionIndexSnafu<__T0, __T1>where +

Trait Implementations§

source§

impl<__T0: Clone, __T1: Clone> Clone for InvalidTransactionIndexSnafu<__T0, __T1>

source§

fn clone(&self) -> InvalidTransactionIndexSnafu<__T0, __T1>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<__T0: Debug, __T1: Debug> Debug for InvalidTransactionIndexSnafu<__T0, __T1>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<__T0, __T1> IntoError<Error> for InvalidTransactionIndexSnafu<__T0, __T1>where Error: Error + ErrorCompat, __T0: Into<u64>, - __T1: Into<u64>,

§

type Source = NoneError

The underlying error
source§

fn into_error(self, error: Self::Source) -> Error

Combine the information to produce the error
source§

impl<__T0: Copy, __T1: Copy> Copy for InvalidTransactionIndexSnafu<__T0, __T1>

Auto Trait Implementations§

§

impl<__T0, __T1> RefUnwindSafe for InvalidTransactionIndexSnafu<__T0, __T1>where + __T1: Into<u64>,

§

type Source = NoneError

The underlying error
source§

fn into_error(self, error: Self::Source) -> Error

Combine the information to produce the error
source§

impl<__T0: Copy, __T1: Copy> Copy for InvalidTransactionIndexSnafu<__T0, __T1>

Auto Trait Implementations§

§

impl<__T0, __T1> RefUnwindSafe for InvalidTransactionIndexSnafu<__T0, __T1>where __T0: RefUnwindSafe, __T1: RefUnwindSafe,

§

impl<__T0, __T1> Send for InvalidTransactionIndexSnafu<__T0, __T1>where __T0: Send, diff --git a/hotshot_query_service/availability/struct.Options.html b/hotshot_query_service/availability/struct.Options.html index 24b4128d8..762cd882d 100644 --- a/hotshot_query_service/availability/struct.Options.html +++ b/hotshot_query_service/availability/struct.Options.html @@ -1,15 +1,15 @@ -Options in hotshot_query_service::availability - Rust
pub struct Options {
+Options in hotshot_query_service::availability - Rust
pub struct Options {
     pub api_path: Option<PathBuf>,
     pub extensions: Vec<Value>,
 }

Fields§

§api_path: Option<PathBuf>§extensions: Vec<Value>

Additional API specification files to merge with availability-api-path.

These optional files may contain route definitions for application-specific routes that have been added as extensions to the basic availability API.

-

Trait Implementations§

source§

impl Args for Options

source§

fn group_id() -> Option<Id>

Report the [ArgGroup::id][crate::ArgGroup::id] for this set of arguments
source§

fn augment_args<'b>(__clap_app: Command) -> Command

Append to [Command] so it can instantiate Self. Read more
source§

fn augment_args_for_update<'b>(__clap_app: Command) -> Command

Append to [Command] so it can update self. Read more
source§

impl Default for Options

source§

fn default() -> Options

Returns the “default value” for a type. Read more
source§

impl FromArgMatches for Options

source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
source§

fn from_arg_matches_mut( +

Trait Implementations§

source§

impl Args for Options

source§

fn group_id() -> Option<Id>

Report the [ArgGroup::id][crate::ArgGroup::id] for this set of arguments
source§

fn augment_args<'b>(__clap_app: Command) -> Command

Append to [Command] so it can instantiate Self. Read more
source§

fn augment_args_for_update<'b>(__clap_app: Command) -> Command

Append to [Command] so it can update self. Read more
source§

impl Default for Options

source§

fn default() -> Options

Returns the “default value” for a type. Read more
source§

impl FromArgMatches for Options

source§

fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
source§

fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches -) -> Result<Self, Error>

Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
source§

fn update_from_arg_matches( +) -> Result<Self, Error>

Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
source§

fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches -) -> Result<(), Error>

Assign values from ArgMatches to self.
source§

fn update_from_arg_matches_mut( +) -> Result<(), Error>

Assign values from ArgMatches to self.
source§

fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches ) -> Result<(), Error>

Assign values from ArgMatches to self.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere diff --git a/hotshot_query_service/availability/struct.RequestSnafu.html b/hotshot_query_service/availability/struct.RequestSnafu.html index 06d060297..95e586503 100644 --- a/hotshot_query_service/availability/struct.RequestSnafu.html +++ b/hotshot_query_service/availability/struct.RequestSnafu.html @@ -1,6 +1,6 @@ -RequestSnafu in hotshot_query_service::availability - Rust
pub struct RequestSnafu;
Expand description

SNAFU context selector for the Error::Request variant

-

Trait Implementations§

source§

impl Clone for RequestSnafu

source§

fn clone(&self) -> RequestSnafu

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for RequestSnafu

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl IntoError<Error> for RequestSnafuwhere - Error: Error + ErrorCompat,

§

type Source = RequestError

The underlying error
source§

fn into_error(self, error: Self::Source) -> Error

Combine the information to produce the error
source§

impl Copy for RequestSnafu

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere +RequestSnafu in hotshot_query_service::availability - Rust
pub struct RequestSnafu;
Expand description

SNAFU context selector for the Error::Request variant

+

Trait Implementations§

source§

impl Clone for RequestSnafu

source§

fn clone(&self) -> RequestSnafu

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for RequestSnafu

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl IntoError<Error> for RequestSnafuwhere + Error: Error + ErrorCompat,

§

type Source = RequestError

The underlying error
source§

fn into_error(self, error: Self::Source) -> Error

Combine the information to produce the error
source§

impl Copy for RequestSnafu

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere T: 'a,

§

fn implicit( diff --git a/hotshot_query_service/availability/struct.TransactionQueryData.html b/hotshot_query_service/availability/struct.TransactionQueryData.html index 1bef02806..cc6248470 100644 --- a/hotshot_query_service/availability/struct.TransactionQueryData.html +++ b/hotshot_query_service/availability/struct.TransactionQueryData.html @@ -1,17 +1,17 @@ -TransactionQueryData in hotshot_query_service::availability - Rust
pub struct TransactionQueryData<Types: NodeType>where
-    Payload<Types>: QueryablePayload,{ /* private fields */ }

Implementations§

source§

impl<Types: NodeType> TransactionQueryData<Types>where - Payload<Types>: QueryablePayload,

source

pub fn transaction(&self) -> &Transaction<Types>

source

pub fn height(&self) -> u64

source

pub fn hash(&self) -> TransactionHash<Types>

source

pub fn block_hash(&self) -> BlockHash<Types>

Trait Implementations§

source§

impl<Types: Clone + NodeType> Clone for TransactionQueryData<Types>where - Payload<Types>: QueryablePayload,

source§

fn clone(&self) -> TransactionQueryData<Types>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<Types: Debug + NodeType> Debug for TransactionQueryData<Types>where - Payload<Types>: QueryablePayload,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de, Types: NodeType> Deserialize<'de> for TransactionQueryData<Types>where - Payload<Types>: QueryablePayload,

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where - __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<Types: PartialEq + NodeType> PartialEq for TransactionQueryData<Types>where - Payload<Types>: QueryablePayload,

source§

fn eq(&self, other: &TransactionQueryData<Types>) -> bool

This method tests for self and other values to be equal, and is used +TransactionQueryData in hotshot_query_service::availability - Rust
pub struct TransactionQueryData<Types: NodeType>where
+    Payload<Types>: QueryablePayload,{ /* private fields */ }

Implementations§

source§

impl<Types: NodeType> TransactionQueryData<Types>where + Payload<Types>: QueryablePayload,

source

pub fn transaction(&self) -> &Transaction<Types>

source

pub fn height(&self) -> u64

source

pub fn hash(&self) -> TransactionHash<Types>

source

pub fn block_hash(&self) -> BlockHash<Types>

Trait Implementations§

source§

impl<Types: Clone + NodeType> Clone for TransactionQueryData<Types>where + Payload<Types>: QueryablePayload,

source§

fn clone(&self) -> TransactionQueryData<Types>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<Types: Debug + NodeType> Debug for TransactionQueryData<Types>where + Payload<Types>: QueryablePayload,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<'de, Types: NodeType> Deserialize<'de> for TransactionQueryData<Types>where + Payload<Types>: QueryablePayload,

source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl<Types: PartialEq + NodeType> PartialEq for TransactionQueryData<Types>where + Payload<Types>: QueryablePayload,

source§

fn eq(&self, other: &TransactionQueryData<Types>) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
source§

impl<Types: NodeType> Serialize for TransactionQueryData<Types>where - Payload<Types>: QueryablePayload,

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where - __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<Types: Eq + NodeType> Eq for TransactionQueryData<Types>where - Payload<Types>: QueryablePayload,

source§

impl<Types: NodeType> StructuralEq for TransactionQueryData<Types>where - Payload<Types>: QueryablePayload,

source§

impl<Types: NodeType> StructuralPartialEq for TransactionQueryData<Types>where +sufficient, and should not be overridden without very good reason.

source§

impl<Types: NodeType> Serialize for TransactionQueryData<Types>where + Payload<Types>: QueryablePayload,

source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where + __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl<Types: Eq + NodeType> Eq for TransactionQueryData<Types>where + Payload<Types>: QueryablePayload,

source§

impl<Types: NodeType> StructuralEq for TransactionQueryData<Types>where + Payload<Types>: QueryablePayload,

source§

impl<Types: NodeType> StructuralPartialEq for TransactionQueryData<Types>where Payload<Types>: QueryablePayload,

Auto Trait Implementations§

§

impl<Types> RefUnwindSafe for TransactionQueryData<Types>where <<Types as NodeType>::BlockPayload as QueryablePayload>::InclusionProof: RefUnwindSafe, <Types as NodeType>::Transaction: RefUnwindSafe,

§

impl<Types> Send for TransactionQueryData<Types>where diff --git a/hotshot_query_service/availability/trait.AvailabilityDataSource.html b/hotshot_query_service/availability/trait.AvailabilityDataSource.html index 2903f6fcd..464caafbe 100644 --- a/hotshot_query_service/availability/trait.AvailabilityDataSource.html +++ b/hotshot_query_service/availability/trait.AvailabilityDataSource.html @@ -1,159 +1,140 @@ -AvailabilityDataSource in hotshot_query_service::availability - Rust
pub trait AvailabilityDataSource<Types: NodeType>where
+AvailabilityDataSource in hotshot_query_service::availability - Rust
pub trait AvailabilityDataSource<Types: NodeType>where
     Payload<Types>: QueryablePayload,{
-    type LeafStream: Stream<Item = QueryResult<LeafQueryData<Types>>> + Unpin + Send;
-    type BlockStream: Stream<Item = QueryResult<BlockQueryData<Types>>> + Unpin + Send;
-    type LeafRange<'a, R>: 'a + Stream<Item = QueryResult<LeafQueryData<Types>>> + Unpin
-       where Self: 'a,
-             R: RangeBounds<usize> + Send;
-    type BlockRange<'a, R>: 'a + Stream<Item = QueryResult<BlockQueryData<Types>>> + Unpin
-       where Self: 'a,
-             R: RangeBounds<usize> + Send;
+    type LeafRange<R>: Stream<Item = Fetch<LeafQueryData<Types>>> + Unpin + Send + 'static
+       where R: RangeBounds<usize> + Send;
+    type BlockRange<R>: Stream<Item = Fetch<BlockQueryData<Types>>> + Unpin + Send + 'static
+       where R: RangeBounds<usize> + Send;
 
     // Required methods
     fn get_leaf<'life0, 'async_trait, ID>(
         &'life0 self,
         id: ID
-    ) -> Pin<Box<dyn Future<Output = QueryResult<LeafQueryData<Types>>> + Send + 'async_trait>>
+    ) -> Pin<Box<dyn Future<Output = Fetch<LeafQueryData<Types>>> + Send + 'async_trait>>
        where ID: Into<LeafId<Types>> + Send + Sync + 'async_trait,
              Self: 'async_trait,
              'life0: 'async_trait;
     fn get_block<'life0, 'async_trait, ID>(
         &'life0 self,
         id: ID
-    ) -> Pin<Box<dyn Future<Output = QueryResult<BlockQueryData<Types>>> + Send + 'async_trait>>
+    ) -> Pin<Box<dyn Future<Output = Fetch<BlockQueryData<Types>>> + Send + 'async_trait>>
        where ID: Into<BlockId<Types>> + Send + Sync + 'async_trait,
              Self: 'async_trait,
              'life0: 'async_trait;
     fn get_leaf_range<'life0, 'async_trait, R>(
         &'life0 self,
         range: R
-    ) -> Pin<Box<dyn Future<Output = QueryResult<Self::LeafRange<'_, R>>> + Send + 'async_trait>>
-       where R: RangeBounds<usize> + Send + 'async_trait,
+    ) -> Pin<Box<dyn Future<Output = Self::LeafRange<R>> + Send + 'async_trait>>
+       where R: RangeBounds<usize> + Send + 'static + 'async_trait,
              Self: 'async_trait,
              'life0: 'async_trait;
     fn get_block_range<'life0, 'async_trait, R>(
         &'life0 self,
         range: R
-    ) -> Pin<Box<dyn Future<Output = QueryResult<Self::BlockRange<'_, R>>> + Send + 'async_trait>>
-       where R: RangeBounds<usize> + Send + 'async_trait,
+    ) -> Pin<Box<dyn Future<Output = Self::BlockRange<R>> + Send + 'async_trait>>
+       where R: RangeBounds<usize> + Send + 'static + 'async_trait,
              Self: 'async_trait,
              'life0: 'async_trait;
     fn get_block_with_transaction<'life0, 'async_trait>(
         &'life0 self,
         hash: TransactionHash<Types>
-    ) -> Pin<Box<dyn Future<Output = QueryResult<(BlockQueryData<Types>, TransactionIndex<Types>)>> + Send + 'async_trait>>
+    ) -> Pin<Box<dyn Future<Output = Fetch<(BlockQueryData<Types>, TransactionIndex<Types>)>> + Send + 'async_trait>>
        where Self: 'async_trait,
              'life0: 'async_trait;
-    fn get_proposals<'life0, 'life1, 'async_trait>(
+
+    // Provided methods
+    fn subscribe_blocks<'life0, 'async_trait>(
         &'life0 self,
-        proposer: &'life1 SignatureKey<Types>,
-        limit: Option<usize>
-    ) -> Pin<Box<dyn Future<Output = QueryResult<Vec<LeafQueryData<Types>>>> + Send + 'async_trait>>
-       where Self: 'async_trait,
-             'life0: 'async_trait,
-             'life1: 'async_trait;
-    fn count_proposals<'life0, 'life1, 'async_trait>(
+        from: usize
+    ) -> Pin<Box<dyn Future<Output = BoxStream<'static, BlockQueryData<Types>>> + Send + 'async_trait>>
+       where Self: Sync + 'async_trait,
+             'life0: 'async_trait { ... }
+    fn subscribe_leaves<'life0, 'async_trait>(
         &'life0 self,
-        proposer: &'life1 SignatureKey<Types>
-    ) -> Pin<Box<dyn Future<Output = QueryResult<usize>> + Send + 'async_trait>>
-       where Self: 'async_trait,
-             'life0: 'async_trait,
-             'life1: 'async_trait;
-    fn subscribe_leaves<'life0, 'async_trait>(
-        &'life0 self,
-        height: usize
-    ) -> Pin<Box<dyn Future<Output = QueryResult<Self::LeafStream>> + Send + 'async_trait>>
-       where Self: 'async_trait,
-             'life0: 'async_trait;
-    fn subscribe_blocks<'life0, 'async_trait>(
-        &'life0 self,
-        height: usize
-    ) -> Pin<Box<dyn Future<Output = QueryResult<Self::BlockStream>> + Send + 'async_trait>>
-       where Self: 'async_trait,
-             'life0: 'async_trait;
-}

Required Associated Types§

source

type LeafStream: Stream<Item = QueryResult<LeafQueryData<Types>>> + Unpin + Send

source

type BlockStream: Stream<Item = QueryResult<BlockQueryData<Types>>> + Unpin + Send

source

type LeafRange<'a, R>: 'a + Stream<Item = QueryResult<LeafQueryData<Types>>> + Unpin + from: usize + ) -> Pin<Box<dyn Future<Output = BoxStream<'static, LeafQueryData<Types>>> + Send + 'async_trait>> + where Self: Sync + 'async_trait, + 'life0: 'async_trait { ... } +}

Expand description

An interface for querying a HotShot blockchain.

+

This interface provides expressive queries over all the data which is made available by HotShot +consensus. The data exposed by this interface consists entirely of normative data: data which +every correct HotShot node or light client will agree on, and which is guaranteed by consensus +to be immutable. This immutability has an interesting consequence: all of the methods exposed by +this trait are pure: given equivalent inputs, the same method will always return equivalent +outputs1.

+

This purity property has a further consequence: none of the methods defined here can fail! Even +if you query for a block at a position past the end of the current chain – a block which does +not exist yet – the query will not fail. It will return an in-progress Fetch which, when it +finally does resolve, resolves to the unique block at that position in the chain. All subsequent +queries for the same position will eventually resolve to the same block.

+

In other words, the abstraction is that of an infinitely long chain which exists statically, in +its entirety, at all times. In reality, of course, this chain is being produced incrementally +and has a finite length at any given time. But all this means is that some queries may take a +long time to resolve while others may resolve immediately.

+

  1. The data returned by these methods are wrapped in Fetch, which does not implement +[PartialEq]. So to speak of equivalent outputs, we need to define an equivalence +relation on Fetch<T>. The relation we will use is defined when T: PartialEq, and +defines two fetches f1 and f2 as equivalent when f1.await == f2.await. That is, +depending on when you call a certain method, you may or may not get a response +immediately. But whenever you do get the data you requested, it is unique for that +combination of inputs. 

Required Associated Types§

source

type LeafRange<R>: Stream<Item = Fetch<LeafQueryData<Types>>> + Unpin + Send + 'static where - Self: 'a, - R: RangeBounds<usize> + Send

source

type BlockRange<'a, R>: 'a + Stream<Item = QueryResult<BlockQueryData<Types>>> + Unpin + R: RangeBounds<usize> + Send

source

type BlockRange<R>: Stream<Item = Fetch<BlockQueryData<Types>>> + Unpin + Send + 'static where - Self: 'a, - R: RangeBounds<usize> + Send

Required Methods§

source

fn get_leaf<'life0, 'async_trait, ID>( + R: RangeBounds<usize> + Send

Required Methods§

source

fn get_leaf<'life0, 'async_trait, ID>( &'life0 self, id: ID -) -> Pin<Box<dyn Future<Output = QueryResult<LeafQueryData<Types>>> + Send + 'async_trait>>where +) -> Pin<Box<dyn Future<Output = Fetch<LeafQueryData<Types>>> + Send + 'async_trait>>where ID: Into<LeafId<Types>> + Send + Sync + 'async_trait, Self: 'async_trait, - 'life0: 'async_trait,

source

fn get_block<'life0, 'async_trait, ID>( + 'life0: 'async_trait,

source

fn get_block<'life0, 'async_trait, ID>( &'life0 self, id: ID -) -> Pin<Box<dyn Future<Output = QueryResult<BlockQueryData<Types>>> + Send + 'async_trait>>where +) -> Pin<Box<dyn Future<Output = Fetch<BlockQueryData<Types>>> + Send + 'async_trait>>where ID: Into<BlockId<Types>> + Send + Sync + 'async_trait, Self: 'async_trait, - 'life0: 'async_trait,

source

fn get_leaf_range<'life0, 'async_trait, R>( + 'life0: 'async_trait,

source

fn get_leaf_range<'life0, 'async_trait, R>( &'life0 self, range: R -) -> Pin<Box<dyn Future<Output = QueryResult<Self::LeafRange<'_, R>>> + Send + 'async_trait>>where - R: RangeBounds<usize> + Send + 'async_trait, +) -> Pin<Box<dyn Future<Output = Self::LeafRange<R>> + Send + 'async_trait>>where + R: RangeBounds<usize> + Send + 'static + 'async_trait, Self: 'async_trait, - 'life0: 'async_trait,

source

fn get_block_range<'life0, 'async_trait, R>( + 'life0: 'async_trait,

source

fn get_block_range<'life0, 'async_trait, R>( &'life0 self, range: R -) -> Pin<Box<dyn Future<Output = QueryResult<Self::BlockRange<'_, R>>> + Send + 'async_trait>>where - R: RangeBounds<usize> + Send + 'async_trait, +) -> Pin<Box<dyn Future<Output = Self::BlockRange<R>> + Send + 'async_trait>>where + R: RangeBounds<usize> + Send + 'static + 'async_trait, Self: 'async_trait, - 'life0: 'async_trait,

source

fn get_block_with_transaction<'life0, 'async_trait>( + 'life0: 'async_trait,

source

fn get_block_with_transaction<'life0, 'async_trait>( &'life0 self, hash: TransactionHash<Types> -) -> Pin<Box<dyn Future<Output = QueryResult<(BlockQueryData<Types>, TransactionIndex<Types>)>> + Send + 'async_trait>>where +) -> Pin<Box<dyn Future<Output = Fetch<(BlockQueryData<Types>, TransactionIndex<Types>)>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Returns the block containing a transaction with the given hash and the transaction’s position in the block.

-
source

fn get_proposals<'life0, 'life1, 'async_trait>( +

Provided Methods§

source

fn subscribe_blocks<'life0, 'async_trait>( &'life0 self, - proposer: &'life1 SignatureKey<Types>, - limit: Option<usize> -) -> Pin<Box<dyn Future<Output = QueryResult<Vec<LeafQueryData<Types>>>> + Send + 'async_trait>>where - Self: 'async_trait, - 'life0: 'async_trait, - 'life1: 'async_trait,

source

fn count_proposals<'life0, 'life1, 'async_trait>( - &'life0 self, - proposer: &'life1 SignatureKey<Types> -) -> Pin<Box<dyn Future<Output = QueryResult<usize>> + Send + 'async_trait>>where - Self: 'async_trait, - 'life0: 'async_trait, - 'life1: 'async_trait,

source

fn subscribe_leaves<'life0, 'async_trait>( - &'life0 self, - height: usize -) -> Pin<Box<dyn Future<Output = QueryResult<Self::LeafStream>> + Send + 'async_trait>>where - Self: 'async_trait, - 'life0: 'async_trait,

source

fn subscribe_blocks<'life0, 'async_trait>( + from: usize +) -> Pin<Box<dyn Future<Output = BoxStream<'static, BlockQueryData<Types>>> + Send + 'async_trait>>where + Self: Sync + 'async_trait, + 'life0: 'async_trait,

source

fn subscribe_leaves<'life0, 'async_trait>( &'life0 self, - height: usize -) -> Pin<Box<dyn Future<Output = QueryResult<Self::BlockStream>> + Send + 'async_trait>>where - Self: 'async_trait, - 'life0: 'async_trait,

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<D, U, Types> AvailabilityDataSource<Types> for ExtensibleDataSource<D, U>where + from: usize +) -> Pin<Box<dyn Future<Output = BoxStream<'static, LeafQueryData<Types>>> + Send + 'async_trait>>where + Self: Sync + 'async_trait, + 'life0: 'async_trait,

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<D, U, Types> AvailabilityDataSource<Types> for ExtensibleDataSource<D, U>where D: AvailabilityDataSource<Types> + Send + Sync, U: Send + Sync, Types: NodeType, - Payload<Types>: QueryablePayload,

§

type LeafRange<R> = <D as AvailabilityDataSource<Types>>::LeafRange<R> where - Self: 'a, - R: RangeBounds<usize> + Send

§

type BlockRange<'a, R> = <D as AvailabilityDataSource<Types>>::BlockRange<'a, R> + R: RangeBounds<usize> + Send

§

type BlockRange<R> = <D as AvailabilityDataSource<Types>>::BlockRange<R> where - Self: 'a, - R: RangeBounds<usize> + Send

source§

impl<Types> AvailabilityDataSource<Types> for SqlDataSource<Types>where + R: RangeBounds<usize> + Send

source§

impl<Types, S, P> AvailabilityDataSource<Types> for FetchingDataSource<Types, S, P>where Types: NodeType, - Payload<Types>: QueryablePayload,

§

type LeafStream = Pin<Box<dyn Stream<Item = Result<LeafQueryData<Types>, QueryError>> + Send>>

§

type BlockStream = Pin<Box<dyn Stream<Item = Result<BlockQueryData<Types>, QueryError>> + Send>>

§

type LeafRange<'a, R> = Pin<Box<dyn Stream<Item = Result<LeafQueryData<Types>, QueryError>> + Send>> -where - Self: 'a, - R: RangeBounds<usize> + Send

§

type BlockRange<'a, R> = Pin<Box<dyn Stream<Item = Result<BlockQueryData<Types>, QueryError>> + Send>> -where - Self: 'a, - R: RangeBounds<usize> + Send

source§

impl<Types: NodeType> AvailabilityDataSource<Types> for FileSystemDataSource<Types>where - Payload<Types>: QueryablePayload,

§

type LeafStream = Pin<Box<dyn Stream<Item = Result<LeafQueryData<Types>, QueryError>> + Send>>

§

type BlockStream = Pin<Box<dyn Stream<Item = Result<BlockQueryData<Types>, QueryError>> + Send>>

§

type LeafRange<'a, R> = Pin<Box<dyn Stream<Item = Result<LeafQueryData<Types>, QueryError>> + Send + 'a>> + Payload<Types>: QueryablePayload, + S: AvailabilityStorage<Types> + 'static, + P: Send + Sync + 'static,

§

type LeafRange<R> = Pin<Box<dyn Stream<Item = Fetch<LeafQueryData<Types>>> + Send>> where - Self: 'a, - R: RangeBounds<usize> + Send

§

type BlockRange<'a, R> = Pin<Box<dyn Stream<Item = Result<BlockQueryData<Types>, QueryError>> + Send + 'a>> + R: RangeBounds<usize> + Send

§

type BlockRange<R> = Pin<Box<dyn Stream<Item = Fetch<BlockQueryData<Types>>> + Send>> where - Self: 'a, R: RangeBounds<usize> + Send

\ No newline at end of file diff --git a/hotshot_query_service/availability/trait.UpdateAvailabilityData.html b/hotshot_query_service/availability/trait.UpdateAvailabilityData.html index a248a071d..2b977f4a8 100644 --- a/hotshot_query_service/availability/trait.UpdateAvailabilityData.html +++ b/hotshot_query_service/availability/trait.UpdateAvailabilityData.html @@ -1,4 +1,4 @@ -UpdateAvailabilityData in hotshot_query_service::availability - Rust
pub trait UpdateAvailabilityData<Types: NodeType> {
+UpdateAvailabilityData in hotshot_query_service::availability - Rust
pub trait UpdateAvailabilityData<Types: NodeType> {
     type Error: Error + Debug + Send + Sync + 'static;
 
     // Required methods
@@ -14,20 +14,24 @@
     ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
        where Self: 'async_trait,
              'life0: 'async_trait;
-}

Required Associated Types§

source

type Error: Error + Debug + Send + Sync + 'static

Required Methods§

source

fn insert_leaf<'life0, 'async_trait>( +}

Required Associated Types§

source

type Error: Error + Debug + Send + Sync + 'static

Required Methods§

source

fn insert_leaf<'life0, 'async_trait>( &'life0 mut self, leaf: LeafQueryData<Types> ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where Self: 'async_trait, - 'life0: 'async_trait,

source

fn insert_block<'life0, 'async_trait>( + 'life0: 'async_trait,

source

fn insert_block<'life0, 'async_trait>( &'life0 mut self, block: BlockQueryData<Types> ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where Self: 'async_trait, - 'life0: 'async_trait,

Implementors§

source§

impl<D, U, Types> UpdateAvailabilityData<Types> for ExtensibleDataSource<D, U>where + 'life0: 'async_trait,

Implementors§

source§

impl<D, U, Types> UpdateAvailabilityData<Types> for ExtensibleDataSource<D, U>where D: UpdateAvailabilityData<Types> + Send + Sync, U: Send + Sync, - Types: NodeType,

§

type Error = <D as UpdateAvailabilityData<Types>>::Error

source§

impl<Types> UpdateAvailabilityData<Types> for SqlDataSource<Types>where + Types: NodeType,

§

type Error = <D as UpdateAvailabilityData<Types>>::Error

source§

impl<Types> UpdateAvailabilityData<Types> for SqlStoragewhere Types: NodeType, - Payload<Types>: QueryablePayload,

source§

impl<Types: NodeType> UpdateAvailabilityData<Types> for FileSystemDataSource<Types>where - Payload<Types>: QueryablePayload,

§

type Error = PersistenceError

\ No newline at end of file + Payload<Types>: QueryablePayload,

source§

impl<Types, S, P> UpdateAvailabilityData<Types> for FetchingDataSource<Types, S, P>where + Types: NodeType, + Payload<Types>: QueryablePayload, + S: UpdateAvailabilityData<Types> + Send + Sync, + P: Send + Sync,

§

type Error = <S as UpdateAvailabilityData<Types>>::Error

source§

impl<Types: NodeType> UpdateAvailabilityData<Types> for FileSystemStorage<Types>where + Payload<Types>: QueryablePayload,

§

type Error = PersistenceError

\ No newline at end of file diff --git a/hotshot_query_service/data_source/fs/struct.FileSystemDataSource.html b/hotshot_query_service/data_source/fetching/struct.FetchingDataSource.html similarity index 51% rename from hotshot_query_service/data_source/fs/struct.FileSystemDataSource.html rename to hotshot_query_service/data_source/fetching/struct.FetchingDataSource.html index 79eb942c3..fe08f8ff6 100644 --- a/hotshot_query_service/data_source/fs/struct.FileSystemDataSource.html +++ b/hotshot_query_service/data_source/fetching/struct.FetchingDataSource.html @@ -1,11 +1,11 @@ - + Redirection -

Redirecting to ../../../hotshot_query_service/data_source/struct.FileSystemDataSource.html...

- +

Redirecting to ../../../hotshot_query_service/data_source/struct.FetchingDataSource.html...

+ \ No newline at end of file diff --git a/hotshot_query_service/data_source/fs/type.FileSystemDataSource.html b/hotshot_query_service/data_source/fs/type.FileSystemDataSource.html new file mode 100644 index 000000000..2981ea6c4 --- /dev/null +++ b/hotshot_query_service/data_source/fs/type.FileSystemDataSource.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../hotshot_query_service/data_source/type.FileSystemDataSource.html...

+ + + \ No newline at end of file diff --git a/hotshot_query_service/data_source/index.html b/hotshot_query_service/data_source/index.html index c4fa477dd..f093c0dd1 100644 --- a/hotshot_query_service/data_source/index.html +++ b/hotshot_query_service/data_source/index.html @@ -1,11 +1,11 @@ -hotshot_query_service::data_source - Rust
Expand description

Persistent storage and sources of data consumed by APIs.

-

Naturally, an archival query service such as this is heavily dependent on a persistent storage -implementation. The APIs provided by this query service are generic over the specific type of -the persistence layer, which we call a data source. This module provides the following -concrete persistence implementations:

+hotshot_query_service::data_source - Rust
Expand description

Persistent storage and sources of data consumed by APIs.

+

The APIs provided by this query service are generic over the implementation which actually +retrieves data in answer to queries. We call this implementation a data source. This module +defines a data source and provides several pre-built implementations:

The user can choose which data source to use when initializing the query service.

@@ -13,4 +13,4 @@ -

Re-exports

Modules

Structs

  • Wrapper to add extensibility to an existing data source.
  • A data source for the APIs provided in this crate, backed by the local file system.
  • A minimal data source for the status API provided in this crate, with no persistent storage.

Traits

  • An extension trait for types which implement the update trait for each API module.
  • A data source with an atomic transaction-based synchronization interface.
\ No newline at end of file +

Re-exports

Modules

Structs

Traits

  • An extension trait for types which implement the update trait for each API module.
  • A data source with an atomic transaction-based synchronization interface.

Type Aliases

  • A data source for the APIs provided in this crate, backed by the local file system.
\ No newline at end of file diff --git a/hotshot_query_service/data_source/sidebar-items.js b/hotshot_query_service/data_source/sidebar-items.js index 0c02fb458..98aa40452 100644 --- a/hotshot_query_service/data_source/sidebar-items.js +++ b/hotshot_query_service/data_source/sidebar-items.js @@ -1 +1 @@ -window.SIDEBAR_ITEMS = {"mod":["sql"],"struct":["ExtensibleDataSource","FileSystemDataSource","MetricsDataSource"],"trait":["UpdateDataSource","VersionedDataSource"]}; \ No newline at end of file +window.SIDEBAR_ITEMS = {"mod":["sql","storage"],"struct":["ExtensibleDataSource","FetchingDataSource","MetricsDataSource"],"trait":["UpdateDataSource","VersionedDataSource"],"type":["FileSystemDataSource"]}; \ No newline at end of file diff --git a/hotshot_query_service/data_source/sql/fn.default_migrations.html b/hotshot_query_service/data_source/sql/fn.default_migrations.html deleted file mode 100644 index 14ede6a0c..000000000 --- a/hotshot_query_service/data_source/sql/fn.default_migrations.html +++ /dev/null @@ -1,2 +0,0 @@ -default_migrations in hotshot_query_service::data_source::sql - Rust
pub fn default_migrations() -> Vec<Migration>
Expand description

The migrations requied to build the default schema for this version of SqlDataSource.

-
\ No newline at end of file diff --git a/hotshot_query_service/data_source/sql/index.html b/hotshot_query_service/data_source/sql/index.html index b75525946..afc68c3c4 100644 --- a/hotshot_query_service/data_source/sql/index.html +++ b/hotshot_query_service/data_source/sql/index.html @@ -1,3 +1,3 @@ -hotshot_query_service::data_source::sql - Rust

Re-exports

  • pub use tokio_postgres as postgres;

Macros

Structs

Type Aliases

  • A data source for the APIs provided in this crate, backed by a remote PostgreSQL database.
\ No newline at end of file diff --git a/hotshot_query_service/data_source/sql/macro.include_dir.html b/hotshot_query_service/data_source/sql/macro.include_dir.html deleted file mode 100644 index c6ea52d54..000000000 --- a/hotshot_query_service/data_source/sql/macro.include_dir.html +++ /dev/null @@ -1,2 +0,0 @@ -include_dir in hotshot_query_service::data_source::sql - Rust
include_dir!() { /* proc-macro */ }
Expand description

Embed the contents of a directory in your crate.

-
\ No newline at end of file diff --git a/hotshot_query_service/data_source/sql/macro.include_migrations.html b/hotshot_query_service/data_source/sql/macro.include_migrations.html index bc82aa471..3145d0bb2 100644 --- a/hotshot_query_service/data_source/sql/macro.include_migrations.html +++ b/hotshot_query_service/data_source/sql/macro.include_migrations.html @@ -1,4 +1,4 @@ -include_migrations in hotshot_query_service::data_source::sql - Rust
macro_rules! include_migrations {
+include_migrations in hotshot_query_service::data_source::sql - Rust
macro_rules! include_migrations {
     ($dir:tt) => { ... };
 }
Expand description

Embed migrations from the given directory into the current binary.

The macro invocation include_migrations!(path) evaluates to an expression of type impl Iterator<Item = Migration>. Each migration must be a text file which is an immediate child of @@ -18,10 +18,10 @@ assert_eq!(migrations[0].name(), "init_schema");

Note that a similar macro is available from Refinery: embed_migrations. This -macro differs in that it evaluates to an iterator of migrations, making it an +macro differs in that it evaluates to an iterator of migrations, making it an expression macro, while embed_migrations is a statement macro that defines a module which provides access to the embedded migrations only indirectly via a Runner. The direct access to migrations provided by include_migrations makes this macro easier to use with -Config::migrations, for combining custom migrations with default_migrations.

+Config::migrations, for combining custom migrations with default_migrations.

\ No newline at end of file diff --git a/hotshot_query_service/data_source/sql/sidebar-items.js b/hotshot_query_service/data_source/sql/sidebar-items.js index 2414ac146..a5a90d6e3 100644 --- a/hotshot_query_service/data_source/sql/sidebar-items.js +++ b/hotshot_query_service/data_source/sql/sidebar-items.js @@ -1 +1 @@ -window.SIDEBAR_ITEMS = {"fn":["default_migrations"],"macro":["include_dir","include_migrations"],"struct":["Config","Error","Migration","SqlDataSource","Transaction"],"trait":["Query"]}; \ No newline at end of file +window.SIDEBAR_ITEMS = {"macro":["include_migrations"],"struct":["Error","Migration"],"type":["SqlDataSource"]}; \ No newline at end of file diff --git a/hotshot_query_service/data_source/sql/struct.Error.html b/hotshot_query_service/data_source/sql/struct.Error.html index 4d24c3bc7..5802b914b 100644 --- a/hotshot_query_service/data_source/sql/struct.Error.html +++ b/hotshot_query_service/data_source/sql/struct.Error.html @@ -76,13 +76,13 @@

Display repr fn try_main() -> Result<()> { ... } -

Implementations§

source§

impl Error

source

pub fn new<E>(error: E) -> Errorwhere +

Implementations§

source§

impl Error

source

pub fn new<E>(error: E) -> Errorwhere E: Error + Send + Sync + 'static,

Create a new error object from any error type.

The error type must be threadsafe and 'static, so that the Error will be as well.

If the error type does not provide a backtrace, a backtrace will be created here to ensure that a backtrace exists.

-
source

pub fn msg<M>(message: M) -> Errorwhere +

source

pub fn msg<M>(message: M) -> Errorwhere M: Display + Debug + Send + Sync + 'static,

Create a new error object from a printable error message.

If the argument implements std::error::Error, prefer Error::new instead which preserves the underlying error’s cause chain and @@ -106,7 +106,7 @@

Display repr .try_collect() .await }

-
source

pub fn context<C>(self, context: C) -> Errorwhere +

source

pub fn context<C>(self, context: C) -> Errorwhere C: Display + Send + Sync + 'static,

Wrap the error value with additional context.

For attaching context to a Result as it is propagated, the Context extension trait may be more convenient than @@ -157,14 +157,14 @@

Example
source

pub fn root_cause(&self) -> &(dyn Error + 'static)

The lowest level cause of this error — this error’s cause’s cause’s cause etc.

The root cause is the last error in the iterator produced by -chain().

+chain().

source

pub fn is<E>(&self) -> boolwhere E: Display + Debug + Send + Sync + 'static,

Returns true if E is the type held by this error object.

For errors with context, this method returns true if E matches the type of the context C or the type of the error on which the context has been attached. For details about the interaction between context and downcasting, see here.

-
source

pub fn downcast<E>(self) -> Result<E, Error>where +

source

pub fn downcast<E>(self) -> Result<E, Error>where E: Display + Debug + Send + Sync + 'static,

Attempt to downcast the error object to a concrete type.

source

pub fn downcast_ref<E>(&self) -> Option<&E>where E: Display + Debug + Send + Sync + 'static,

Downcast this error object by reference.

@@ -177,8 +177,8 @@
Example
}
source

pub fn downcast_mut<E>(&mut self) -> Option<&mut E>where E: Display + Debug + Send + Sync + 'static,

Downcast this error object by mutable reference.

-

Trait Implementations§

source§

impl AsRef<dyn Error> for Error

source§

fn as_ref(&self) -> &(dyn Error + 'static)

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl AsRef<dyn Error + Send + Sync> for Error

source§

fn as_ref(&self) -> &(dyn Error + Send + Sync + 'static)

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Debug for Error

source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Deref for Error

§

type Target = dyn Error + Send + Sync

The resulting type after dereferencing.
source§

fn deref(&self) -> &<Error as Deref>::Target

Dereferences the value.
source§

impl DerefMut for Error

source§

fn deref_mut(&mut self) -> &mut <Error as Deref>::Target

Mutably dereferences the value.
source§

impl Display for Error

source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Drop for Error

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl<E> From<E> for Errorwhere - E: Error + Send + Sync + 'static,

source§

fn from(error: E) -> Error

Converts to this type from the input type.

Auto Trait Implementations§

§

impl RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnwindSafe for Error

Blanket Implementations§

source§

impl<T> Any for Twhere +

Trait Implementations§

source§

impl AsRef<dyn Error> for Error

source§

fn as_ref(&self) -> &(dyn Error + 'static)

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl AsRef<dyn Error + Send + Sync> for Error

source§

fn as_ref(&self) -> &(dyn Error + Send + Sync + 'static)

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Debug for Error

source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Deref for Error

§

type Target = dyn Error + Send + Sync

The resulting type after dereferencing.
source§

fn deref(&self) -> &<Error as Deref>::Target

Dereferences the value.
source§

impl DerefMut for Error

source§

fn deref_mut(&mut self) -> &mut <Error as Deref>::Target

Mutably dereferences the value.
source§

impl Display for Error

source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Drop for Error

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl<E> From<E> for Errorwhere + E: Error + Send + Sync + 'static,

source§

fn from(error: E) -> Error

Converts to this type from the input type.

Auto Trait Implementations§

§

impl RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnwindSafe for Error

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere T: 'a,

§

fn implicit( diff --git a/hotshot_query_service/data_source/sql/struct.Migration.html b/hotshot_query_service/data_source/sql/struct.Migration.html index b07ffd952..b5e351af6 100644 --- a/hotshot_query_service/data_source/sql/struct.Migration.html +++ b/hotshot_query_service/data_source/sql/struct.Migration.html @@ -1,7 +1,7 @@ Migration in hotshot_query_service::data_source::sql - Rust
pub struct Migration { /* private fields */ }
Expand description

Represents a schema migration to be run on the database, this struct is used by the embed_migrations! macro to gather migration files and shouldn’t be needed by the user

-

Implementations§

§

impl Migration

pub fn unapplied(input_name: &str, sql: &str) -> Result<Migration, Error>

Create an unapplied migration, name and version are parsed from the input_name, +

Implementations§

§

impl Migration

pub fn unapplied(input_name: &str, sql: &str) -> Result<Migration, Error>

Create an unapplied migration, name and version are parsed from the input_name, which must be named in the format (U|V){1}__{2}.rs where {1} represents the migration version and {2} the name.

pub fn sql(&self) -> Option<&str>

pub fn version(&self) -> u32

Get the Migration version

pub fn prefix(&self) -> &Type

Get the Prefix

@@ -9,14 +9,14 @@

pub fn applied_on(&self) -> Option<&OffsetDateTime>

Get the timestamp from when the Migration was applied. None when unapplied. Migrations returned from Runner::get_migrations() will always have None.

pub fn checksum(&self) -> u64

Get the Migration checksum. Checksum is formed from the name version and sql of the Migration

-

Trait Implementations§

§

impl Clone for Migration

§

fn clone(&self) -> Migration

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for Migration

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Display for Migration

§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Ord for Migration

§

fn cmp(&self, other: &Migration) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere +

Trait Implementations§

§

impl Clone for Migration

§

fn clone(&self) -> Migration

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for Migration

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Display for Migration

§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Ord for Migration

§

fn cmp(&self, other: &Migration) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere - Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
§

impl PartialEq for Migration

§

fn eq(&self, other: &Migration) -> bool

This method tests for self and other values to be equal, and is used + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
§

impl PartialEq for Migration

§

fn eq(&self, other: &Migration) -> bool

This method tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always -sufficient, and should not be overridden without very good reason.
§

impl PartialOrd for Migration

§

fn partial_cmp(&self, other: &Migration) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= +sufficient, and should not be overridden without very good reason.
§

impl PartialOrd for Migration

§

fn partial_cmp(&self, other: &Migration) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= -operator. Read more
§

impl Eq for Migration

Auto Trait Implementations§

§

impl RefUnwindSafe for Migration

§

impl Send for Migration

§

impl Sync for Migration

§

impl Unpin for Migration

§

impl UnwindSafe for Migration

Blanket Implementations§

source§

impl<T> Any for Twhere +operator. Read more

§

impl Eq for Migration

Auto Trait Implementations§

§

impl RefUnwindSafe for Migration

§

impl Send for Migration

§

impl Sync for Migration

§

impl Unpin for Migration

§

impl UnwindSafe for Migration

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere T: 'a,

§

fn implicit( diff --git a/hotshot_query_service/data_source/sql/type.SqlDataSource.html b/hotshot_query_service/data_source/sql/type.SqlDataSource.html new file mode 100644 index 000000000..d05839a58 --- /dev/null +++ b/hotshot_query_service/data_source/sql/type.SqlDataSource.html @@ -0,0 +1,249 @@ +SqlDataSource in hotshot_query_service::data_source::sql - Rust
pub type SqlDataSource<Types> = FetchingDataSource<Types, SqlStorage, ()>;
Expand description

A data source for the APIs provided in this crate, backed by a remote PostgreSQL database.

+

Administration

+

This data source will automatically connect to and perform queries on a remote SQL database. +However, administration of the database, such as initialization, resetting, and backups, is +left out of the scope of this implementation, and is expected to be performed manually using +off-the-shelf DBMS adminstration tools. The one exception is migrations, which are handled +transparently by the SqlDataSource.

+

Schema

+

All the objects created and used by SqlDataSource are grouped under a schema for easy +management. By default, the schema is named hotshot, and is created the first time a +SqlDataSource is constructed. The name of the schema can be configured by setting +Config::schema.

+

Initialization

+

When creating a SqlDataSource, the caller can use Config to specify the host, user, and +database to connect to. As such, SqlDataSource is not very opinionated about how the +Postgres instance is set up. The administrator must simply ensure that there is a database +dedicated to the SqlDataSource and a user with appropriate permissions (all on SCHEMA and +all on DATABASE) over that database.

+

Here is an example of how a sufficient database could be initialized. When using the standard +postgres Docker image, these statements could be placed in +/docker-entrypoint-initdb.d/init.sql to automatically initialize the database upon startup.

+
CREATE DATABASE hotshot_query_service;
+\connect hotshot_query_service;
+CREATE USER hotshot_user WITH PASSWORD 'password';
+GRANT ALL ON SCHEMA public TO hotshot_user;
+GRANT ALL ON DATABASE hotshot_query_service TO hotshot_user WITH GRANT OPTION;
+
+

One could then connect to this database with the following Config:

+ +
Config::default()
+    .host("postgres.database.hostname")
+    .database("hotshot_query_service")
+    .user("hotshot_user")
+    .password("password")
+

Resetting

+

In general, resetting the database when necessary is left up to the administrator. However, for +convenience, we do provide a reset_schema option which can be used to +wipe out existing state and create a fresh instance of the query service. This is particularly +useful for development and staging environments. This function will permanently delete all +tables associated with the schema used by this query service, but will not reset other schemas +or database.

+

Migrations

+

For the SqlDataSource to work, the database must be initialized with the appropriate schema, +and the schema must be kept up to date when deploying a new version of this software which +depends on a different schema. Both of these tasks are accomplished via migrations.

+

Each release of this software is bundled with a sequence of migration files: one migration for +each release that changed the schema, including the latest one. Replaying these SQL files +against a database with an older version of the schema, including a completely empty database, +will bring it up to date with the schema required by this version of the software. Upon creating +an instance of SqlDataSource and connecting to a database, the data source will +automatically fetch the current version from the database and, if it is old, replay the +necessary migration files.

+

Custom Migrations

+

In keeping with the philosophy of this crate, SqlDataSource is designed to be +extensible and composable. When extending the provided APIs with +new, application-specific queries, it will often be desirable to alter the schema of the +database in some way, such as adding additional columns to some of the tables or creating new +indices. When composing the provided APIs with additional API modules, it may also be desirable +to alter the schema, although the changes are more likely to be completely independent of the +schema used by this data source, such as adding entirely new tables.

+

In either case, the default schema can be modified by inserting additional migrations between +the migrations distributed with this crate. The new migrations will then automatically be +replayed as necessary when initializing a SqlDataSource. New custom migrations can be +added with each software update, to keep the custom data up to date as the default schema +changes.

+

Custom migrations can be inserted using Config::migrations. Each custom migration will be +inserted into the overall sequence of migrations in order of version number. The migrations +provided by this crate only use version numbers which are multiples of 10, so the non-multiples +can be used to insert custom migrations between the default migrations. You can also replace a +default migration completely by providing a custom migration with the same version number. This +may be useful when an earlier custom migration has altered the schema in such a way that a later +migration no longer works as-is. However, this technique is error prone and should be used only +when necessary.

+

When using custom migrations, it is the user’s responsibility to ensure that the resulting +schema is compatible with the schema expected by SqlDataSource. Adding things (tables, +columns, indices) should usually be safe. Removing, altering, or renaming things should be done +with extreme caution.

+

It is standard to store custom migrations as SQL files in a sub-directory of the crate. For ease +of release and deploymenet, such directories can be embedded into a Rust binary and parsed into +a list of Migration objects using the include_migrations macro.

+

It is also possible to take complete control over migrating the schema using +Config::no_migrations to prevent the SqlDataSource from running its own migrations. The +database administrator then becomes responsible for manually migrating the database, ensuring the +schema is up to date, and ensuring that the schema is at all times compatible with the schema +expected by the current version of this software. Nevertheless, this may be the best option when +your application-specific schema has diverged significantly from the default schema.

+

Synchronization

+

SqlDataSource implements VersionedDataSource, which means +changes are not applied to the underlying database with every operation. Instead, outstanding +changes are batched and applied all at once, atomically, whenever +commit is called. Outstanding, uncommitted changes can +also be rolled back completely using revert.

+

Internally, the data source maintains an open Transaction whenever there are outstanding +changes, and commits the transaction on commit. The +underlying database transaction can be accessed directly via transaction, +which makes it possible to compose application-specific database updates atomically with updates +made by the SqlDataSource itself. This is useful for extension and +composition.

+

Extension and Composition

+

SqlDataSource is designed to be both extensible (so you can add additional state to the API +modules defined in this crate) and composable (so you can use SqlDataSource as one component +of a larger state type for an application with additional modules).

+

Extension

+

It is possible to add additional, application-specific state to SqlDataSource. If the new +state should live in memory, simply wrap the SqlDataSource in an +ExtensibleDataSource:

+ +
type AppState = &'static str;
+
+let data_source: ExtensibleDataSource<SqlDataSource<AppTypes>, AppState> =
+    ExtensibleDataSource::new(SqlDataSource::connect(config).await?, "app state");
+

The ExtensibleDataSource wrapper implements all the same data +source traits as SqlDataSource, and also provides access to the AppState parameter for use +in API endpoint handlers. This can be used to implement an app-specific data source trait and +add a new API endpoint that uses this app-specific data, as described in the +extension guide.

+

If the new application-specific state should live in the SQL database itself, the implementation +is more involved, but still possible. Follow the steps for +custom migrations to modify the database schema to account for the new +data you want to store. You can then access this data through the SqlDataSource using +query to run a custom read-only SQL query or transaction +to execute a custom atomic mutation of the database. If you use +transaction, be sure to call +commit when you are ready to persist your changes.

+

You will typically use query to read custom data in API endpoint handlers and +transaction to populate custom data in your web server’s update loop.

+

Composition

+

Composing SqlDataSource with other module states is fairly simple – just +create an aggregate struct containing both SqlDataSource and your additional module +states, as described in the composition guide. If the additional modules +have data that should live in the same database as the SqlDataSource data, you can follow +the steps in custom migrations to accomodate this. When modifying that +data, you can use transaction to atomically synchronize updates to the +other modules’ data with updates to the SqlDataSource. If the additional data is completely +independent of HotShot query service data and does not need to be synchronized, you can also +connect to the database directly to make updates.

+

In the following example, we compose HotShot query service modules with other application- +specific modules, synchronizing updates using transaction.

+ +
struct AppState {
+    hotshot_qs: SqlDataSource<AppTypes>,
+    // additional state for other modules
+}
+
+async fn init_server(
+    config: Config,
+    mut hotshot: SystemContextHandle<AppTypes, AppNodeImpl>,
+) -> Result<App<Arc<RwLock<AppState>>, Error>, Error> {
+    let mut hotshot_qs = SqlDataSource::connect(config).await.map_err(Error::internal)?;
+    // Initialize storage for other modules, using `hotshot_qs` to access the database.
+    let tx = hotshot_qs.transaction().await.map_err(Error::internal)?;
+    // ...
+
+    let state = Arc::new(RwLock::new(AppState {
+        hotshot_qs,
+        // additional state for other modules
+    }));
+    let mut app = App::with_state(state.clone());
+    // Register API modules.
+
+    spawn(async move {
+        let mut events = hotshot.get_event_stream(Default::default()).await.0;
+        while let Some(event) = events.next().await {
+            let mut state = state.write().await;
+            UpdateDataSource::<AppTypes>::update(&mut state.hotshot_qs, &event)
+                .await
+                .unwrap();
+            // Update other modules' states based on `event`. Use `hotshot_qs` to include
+            // database updates in the same atomic transaction as `hotshot_qs.update`.
+            let tx = state.hotshot_qs.transaction().await.unwrap();
+
+            // Commit all outstanding changes to the entire state at the same time.
+            state.hotshot_qs.commit().await.unwrap();
+        }
+    });
+
+    Ok(app)
+}
+

Aliased Type§

struct SqlDataSource<Types> { /* private fields */ }

Implementations§

source§

impl<Types> SqlDataSource<Types>where + Types: NodeType, + Payload<Types>: QueryablePayload,

source

pub async fn connect(config: Config) -> Result<Self, Error>

Connect to a remote database.

+
source§

impl<Types> SqlDataSource<Types>where + Types: NodeType,

source

pub async fn transaction(&mut self) -> QueryResult<Transaction<'_>>

Access the transaction which is accumulating all uncommitted changes to the data source.

+

This can be used to manually group database modifications to custom state atomically with +modifications made through the SqlDataSource.

+

If there is no currently open transaction, a new transaction will be opened. No changes +made through the transaction objeect returned by this method will be persisted until +commit is called.

+

Trait Implementations§

source§

impl<Types> Query for SqlDataSource<Types>where + Types: NodeType,

source§

fn client<'life0, 'async_trait>( + &'life0 self +) -> Pin<Box<dyn Future<Output = Cow<'_, Arc<Client>>> + Send + 'async_trait>>where + Self: 'async_trait, + 'life0: 'async_trait,

source§

fn query<'life0, 'life1, 'async_trait, T, P>( + &'life0 self, + query: &'life1 T, + params: P +) -> Pin<Box<dyn Future<Output = QueryResult<BoxStream<'static, QueryResult<Row>>>> + Send + 'async_trait>>where + T: ?Sized + ToStatement + Sync + 'async_trait, + P: IntoIterator + Send + 'async_trait, + P::IntoIter: ExactSizeIterator, + P::Item: BorrowToSql, + Self: Sync + 'async_trait, + 'life0: 'async_trait, + 'life1: 'async_trait,

source§

fn query_static<'life0, 'life1, 'async_trait, T>( + &'life0 self, + query: &'life1 T +) -> Pin<Box<dyn Future<Output = QueryResult<BoxStream<'static, QueryResult<Row>>>> + Send + 'async_trait>>where + T: ?Sized + ToStatement + Sync + 'async_trait, + Self: Sync + 'async_trait, + 'life0: 'async_trait, + 'life1: 'async_trait,

Query the underlying SQL database with no parameters.
source§

fn query_one<'life0, 'life1, 'async_trait, T, P>( + &'life0 self, + query: &'life1 T, + params: P +) -> Pin<Box<dyn Future<Output = QueryResult<Row>> + Send + 'async_trait>>where + T: ?Sized + ToStatement + Sync + 'async_trait, + P: IntoIterator + Send + 'async_trait, + P::IntoIter: ExactSizeIterator, + P::Item: BorrowToSql, + Self: Sync + 'async_trait, + 'life0: 'async_trait, + 'life1: 'async_trait,

Query the underlying SQL database, returning exactly one result or failing.
source§

fn query_one_static<'life0, 'life1, 'async_trait, T>( + &'life0 self, + query: &'life1 T +) -> Pin<Box<dyn Future<Output = QueryResult<Row>> + Send + 'async_trait>>where + T: ?Sized + ToStatement + Sync + 'async_trait, + Self: Sync + 'async_trait, + 'life0: 'async_trait, + 'life1: 'async_trait,

Query the underlying SQL database with no parameters, returning exactly one result or +failing.
source§

fn query_opt<'life0, 'life1, 'async_trait, T, P>( + &'life0 self, + query: &'life1 T, + params: P +) -> Pin<Box<dyn Future<Output = QueryResult<Option<Row>>> + Send + 'async_trait>>where + T: ?Sized + ToStatement + Sync + 'async_trait, + P: IntoIterator + Send + 'async_trait, + P::IntoIter: ExactSizeIterator, + P::Item: BorrowToSql, + Self: Sync + 'async_trait, + 'life0: 'async_trait, + 'life1: 'async_trait,

Query the underlying SQL database, returning zero or one results.
source§

fn query_opt_static<'life0, 'life1, 'async_trait, T>( + &'life0 self, + query: &'life1 T +) -> Pin<Box<dyn Future<Output = QueryResult<Option<Row>>> + Send + 'async_trait>>where + T: ?Sized + ToStatement + Sync + 'async_trait, + Self: Sync + 'async_trait, + 'life0: 'async_trait, + 'life1: 'async_trait,

Query the underlying SQL database with no parameters, returning zero or one results.
\ No newline at end of file diff --git a/hotshot_query_service/data_source/storage/fs/index.html b/hotshot_query_service/data_source/storage/fs/index.html new file mode 100644 index 000000000..251a90877 --- /dev/null +++ b/hotshot_query_service/data_source/storage/fs/index.html @@ -0,0 +1 @@ +hotshot_query_service::data_source::storage::fs - Rust

Structs

  • Storage for the APIs provided in this crate, backed by a remote PostgreSQL database.
\ No newline at end of file diff --git a/hotshot_query_service/data_source/storage/fs/sidebar-items.js b/hotshot_query_service/data_source/storage/fs/sidebar-items.js new file mode 100644 index 000000000..eb264393c --- /dev/null +++ b/hotshot_query_service/data_source/storage/fs/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"struct":["FileSystemStorage"]}; \ No newline at end of file diff --git a/hotshot_query_service/data_source/storage/fs/struct.FileSystemStorage.html b/hotshot_query_service/data_source/storage/fs/struct.FileSystemStorage.html new file mode 100644 index 000000000..6f9b12a76 --- /dev/null +++ b/hotshot_query_service/data_source/storage/fs/struct.FileSystemStorage.html @@ -0,0 +1,256 @@ +FileSystemStorage in hotshot_query_service::data_source::storage::fs - Rust
pub struct FileSystemStorage<Types: NodeType>where
+    Payload<Types>: QueryablePayload,{ /* private fields */ }
Expand description

Storage for the APIs provided in this crate, backed by a remote PostgreSQL database.

+

Implementations§

source§

impl<Types: NodeType> FileSystemStorage<Types>where + Payload<Types>: QueryablePayload,

source

pub async fn create(path: &Path) -> Result<Self, PersistenceError>

Create a new FileSystemStorage with storage at path.

+

If there is already data at path, it will be archived.

+

The FileSystemStorage will manage its own persistence synchronization.

+
source

pub async fn open(path: &Path) -> Result<Self, PersistenceError>

Open an existing FileSystemStorage from storage at path.

+

If there is no data at path, a new store will be created.

+

The FileSystemStorage will manage its own persistence synchronization.

+
source

pub async fn create_with_store( + loader: &mut AtomicStoreLoader +) -> Result<Self, PersistenceError>

Create a new FileSystemStorage using a persistent storage loader.

+

If there is existing data corresponding to the FileSystemStorage data structures, it will +be archived.

+

The FileSystemStorage will register its persistent data structures with loader. The +caller is responsible for creating an [AtomicStore] from loader and managing +synchronization of the store.

+
source

pub async fn open_with_store( + loader: &mut AtomicStoreLoader +) -> Result<Self, PersistenceError>

Open an existing FileSystemStorage using a persistent storage loader.

+

If there is no existing data corresponding to the FileSystemStorage data structures, a new +store will be created.

+

The FileSystemStorage will register its persistent data structures with loader. The +caller is responsible for creating an [AtomicStore] from loader and managing +synchronization of the store.

+
source

pub fn skip_version(&mut self) -> Result<(), PersistenceError>

Advance the version of the persistent store without committing changes to persistent state.

+

Trait Implementations§

source§

impl<Types: NodeType> AvailabilityStorage<Types> for FileSystemStorage<Types>where + Payload<Types>: QueryablePayload,

source§

fn get_leaf<'life0, 'async_trait>( + &'life0 self, + id: LeafId<Types> +) -> Pin<Box<dyn Future<Output = QueryResult<LeafQueryData<Types>>> + Send + 'async_trait>>where + Self: 'async_trait, + 'life0: 'async_trait,

source§

fn get_block<'life0, 'async_trait>( + &'life0 self, + id: BlockId<Types> +) -> Pin<Box<dyn Future<Output = QueryResult<BlockQueryData<Types>>> + Send + 'async_trait>>where + Self: 'async_trait, + 'life0: 'async_trait,

source§

fn get_leaf_range<'life0, 'async_trait, R>( + &'life0 self, + range: R +) -> Pin<Box<dyn Future<Output = QueryResult<Vec<QueryResult<LeafQueryData<Types>>>>> + Send + 'async_trait>>where + R: RangeBounds<usize> + Send + 'async_trait, + Self: 'async_trait, + 'life0: 'async_trait,

source§

fn get_block_range<'life0, 'async_trait, R>( + &'life0 self, + range: R +) -> Pin<Box<dyn Future<Output = QueryResult<Vec<QueryResult<BlockQueryData<Types>>>>> + Send + 'async_trait>>where + R: RangeBounds<usize> + Send + 'async_trait, + Self: 'async_trait, + 'life0: 'async_trait,

source§

fn get_block_with_transaction<'life0, 'async_trait>( + &'life0 self, + hash: TransactionHash<Types> +) -> Pin<Box<dyn Future<Output = QueryResult<(BlockQueryData<Types>, TransactionIndex<Types>)>> + Send + 'async_trait>>where + Self: 'async_trait, + 'life0: 'async_trait,

source§

impl<Types: NodeType> Debug for FileSystemStorage<Types>where + Payload<Types>: QueryablePayload, + HashMap<LeafHash<Types>, u64>: Debug, + HashMap<BlockHash<Types>, u64>: Debug, + HashMap<TransactionHash<Types>, (u64, TransactionIndex<Types>)>: Debug, + HashMap<SignatureKey<Types>, Vec<u64>>: Debug, + LedgerLog<LeafQueryData<Types>>: Debug, + LedgerLog<BlockQueryData<Types>>: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<Types: NodeType> NodeDataSource<Types> for FileSystemStorage<Types>where + Payload<Types>: QueryablePayload,

source§

fn block_height<'life0, 'async_trait>( + &'life0 self +) -> Pin<Box<dyn Future<Output = QueryResult<usize>> + Send + 'async_trait>>where + Self: 'async_trait, + 'life0: 'async_trait,

source§

fn get_proposals<'life0, 'life1, 'async_trait>( + &'life0 self, + id: &'life1 SignatureKey<Types>, + limit: Option<usize> +) -> Pin<Box<dyn Future<Output = QueryResult<Vec<LeafQueryData<Types>>>> + Send + 'async_trait>>where + Self: 'async_trait, + 'life0: 'async_trait, + 'life1: 'async_trait,

source§

fn count_proposals<'life0, 'life1, 'async_trait>( + &'life0 self, + id: &'life1 SignatureKey<Types> +) -> Pin<Box<dyn Future<Output = QueryResult<usize>> + Send + 'async_trait>>where + Self: 'async_trait, + 'life0: 'async_trait, + 'life1: 'async_trait,

source§

impl<Types: NodeType> UpdateAvailabilityData<Types> for FileSystemStorage<Types>where + Payload<Types>: QueryablePayload,

§

type Error = PersistenceError

source§

fn insert_leaf<'life0, 'async_trait>( + &'life0 mut self, + leaf: LeafQueryData<Types> +) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where + Self: 'async_trait, + 'life0: 'async_trait,

source§

fn insert_block<'life0, 'async_trait>( + &'life0 mut self, + block: BlockQueryData<Types> +) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where + Self: 'async_trait, + 'life0: 'async_trait,

source§

impl<Types: NodeType> UpdateNodeData<Types> for FileSystemStorage<Types>where + Payload<Types>: QueryablePayload,

§

type Error = PersistenceError

source§

fn insert_leaf<'life0, 'async_trait>( + &'life0 mut self, + leaf: LeafQueryData<Types> +) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where + Self: 'async_trait, + 'life0: 'async_trait,

source§

impl<Types: NodeType> VersionedDataSource for FileSystemStorage<Types>where + Payload<Types>: QueryablePayload,

§

type Error = PersistenceError

source§

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

Atomically commit to all outstanding modifications to the data. Read more
source§

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

Erase all oustanding modifications to the data. Read more

Auto Trait Implementations§

§

impl<Types> RefUnwindSafe for FileSystemStorage<Types>where + Types: RefUnwindSafe, + <Types as NodeType>::BlockHeader: RefUnwindSafe, + <Types as NodeType>::BlockPayload: RefUnwindSafe, + <<Types as NodeType>::SignatureKey as SignatureKey>::QCType: RefUnwindSafe, + <Types as NodeType>::SignatureKey: RefUnwindSafe, + <Types as NodeType>::Time: RefUnwindSafe, + <Types as NodeType>::Transaction: RefUnwindSafe, + <<Types as NodeType>::BlockPayload as QueryablePayload>::TransactionIndex: RefUnwindSafe,

§

impl<Types> Send for FileSystemStorage<Types>

§

impl<Types> Sync for FileSystemStorage<Types>

§

impl<Types> Unpin for FileSystemStorage<Types>where + Types: Unpin, + <Types as NodeType>::BlockHeader: Unpin, + <Types as NodeType>::BlockPayload: Unpin, + <<Types as NodeType>::SignatureKey as SignatureKey>::QCType: Unpin, + <Types as NodeType>::SignatureKey: Unpin, + <Types as NodeType>::Time: Unpin, + <Types as NodeType>::Transaction: Unpin, + <<Types as NodeType>::BlockPayload as QueryablePayload>::TransactionIndex: Unpin,

§

impl<Types> UnwindSafe for FileSystemStorage<Types>where + Types: UnwindSafe, + <Types as NodeType>::BlockHeader: UnwindSafe, + <Types as NodeType>::BlockPayload: UnwindSafe, + <<Types as NodeType>::SignatureKey as SignatureKey>::QCType: UnwindSafe, + <Types as NodeType>::SignatureKey: UnwindSafe, + <Types as NodeType>::Time: UnwindSafe, + <Types as NodeType>::Transaction: UnwindSafe, + <<Types as NodeType>::BlockPayload as QueryablePayload>::TransactionIndex: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32 +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Conv for T

§

fn conv<T>(self) -> Twhere + Self: Into<T>,

Converts self into T using Into<T>. Read more
§

impl<T> Downcast for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can +then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be +further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot +generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot +generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be +further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
§

impl<T> FmtForward for T

§

fn fmt_binary(self) -> FmtBinary<Self>where + Self: Binary,

Causes self to use its Binary implementation when Debug-formatted.
§

fn fmt_display(self) -> FmtDisplay<Self>where + Self: Display,

Causes self to use its Display implementation when +Debug-formatted.
§

fn fmt_lower_exp(self) -> FmtLowerExp<Self>where + Self: LowerExp,

Causes self to use its LowerExp implementation when +Debug-formatted.
§

fn fmt_lower_hex(self) -> FmtLowerHex<Self>where + Self: LowerHex,

Causes self to use its LowerHex implementation when +Debug-formatted.
§

fn fmt_octal(self) -> FmtOctal<Self>where + Self: Octal,

Causes self to use its Octal implementation when Debug-formatted.
§

fn fmt_pointer(self) -> FmtPointer<Self>where + Self: Pointer,

Causes self to use its Pointer implementation when +Debug-formatted.
§

fn fmt_upper_exp(self) -> FmtUpperExp<Self>where + Self: UpperExp,

Causes self to use its UpperExp implementation when +Debug-formatted.
§

fn fmt_upper_hex(self) -> FmtUpperHex<Self>where + Self: UpperHex,

Causes self to use its UpperHex implementation when +Debug-formatted.
§

fn fmt_list(self) -> FmtList<Self>where + &'a Self: for<'a> IntoIterator,

Formats each item in a sequence. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

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

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

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
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 Twhere + 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.

+
§

impl<D> OwoColorize for D

§

fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where + C: Color,

Set the foreground color generically Read more
§

fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where + C: Color,

Set the background color generically. Read more
§

fn black<'a>(&'a self) -> FgColorDisplay<'a, Black, Self>

Change the foreground color to black
§

fn on_black<'a>(&'a self) -> BgColorDisplay<'a, Black, Self>

Change the background color to black
§

fn red<'a>(&'a self) -> FgColorDisplay<'a, Red, Self>

Change the foreground color to red
§

fn on_red<'a>(&'a self) -> BgColorDisplay<'a, Red, Self>

Change the background color to red
§

fn green<'a>(&'a self) -> FgColorDisplay<'a, Green, Self>

Change the foreground color to green
§

fn on_green<'a>(&'a self) -> BgColorDisplay<'a, Green, Self>

Change the background color to green
§

fn yellow<'a>(&'a self) -> FgColorDisplay<'a, Yellow, Self>

Change the foreground color to yellow
§

fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>

Change the background color to yellow
§

fn blue<'a>(&'a self) -> FgColorDisplay<'a, Blue, Self>

Change the foreground color to blue
§

fn on_blue<'a>(&'a self) -> BgColorDisplay<'a, Blue, Self>

Change the background color to blue
§

fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>

Change the foreground color to magenta
§

fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>

Change the background color to magenta
§

fn purple<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>

Change the foreground color to purple
§

fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>

Change the background color to purple
§

fn cyan<'a>(&'a self) -> FgColorDisplay<'a, Cyan, Self>

Change the foreground color to cyan
§

fn on_cyan<'a>(&'a self) -> BgColorDisplay<'a, Cyan, Self>

Change the background color to cyan
§

fn white<'a>(&'a self) -> FgColorDisplay<'a, White, Self>

Change the foreground color to white
§

fn on_white<'a>(&'a self) -> BgColorDisplay<'a, White, Self>

Change the background color to white
§

fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>

Change the foreground color to the terminal default
§

fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>

Change the background color to the terminal default
§

fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>

Change the foreground color to bright black
§

fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>

Change the background color to bright black
§

fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>

Change the foreground color to bright red
§

fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>

Change the background color to bright red
§

fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>

Change the foreground color to bright green
§

fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>

Change the background color to bright green
§

fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>

Change the foreground color to bright yellow
§

fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>

Change the background color to bright yellow
§

fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>

Change the foreground color to bright blue
§

fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>

Change the background color to bright blue
§

fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>

Change the foreground color to bright magenta
§

fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>

Change the background color to bright magenta
§

fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>

Change the foreground color to bright purple
§

fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>

Change the background color to bright purple
§

fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>

Change the foreground color to bright cyan
§

fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>

Change the background color to bright cyan
§

fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>

Change the foreground color to bright white
§

fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>

Change the background color to bright white
§

fn bold<'a>(&'a self) -> BoldDisplay<'a, Self>

Make the text bold
§

fn dimmed<'a>(&'a self) -> DimDisplay<'a, Self>

Make the text dim
§

fn italic<'a>(&'a self) -> ItalicDisplay<'a, Self>

Make the text italicized
§

fn underline<'a>(&'a self) -> UnderlineDisplay<'a, Self>

Make the text italicized
Make the text blink
Make the text blink (but fast!)
§

fn reversed<'a>(&'a self) -> ReversedDisplay<'a, Self>

Swap the foreground and background colors
§

fn hidden<'a>(&'a self) -> HiddenDisplay<'a, Self>

Hide the text
§

fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>

Cross out the text
§

fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where + Color: DynColor,

Set the foreground color at runtime. Only use if you do not know which color will be used at +compile-time. If the color is constant, use either OwoColorize::fg or +a color-specific method, such as OwoColorize::green, Read more
§

fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where + Color: DynColor,

Set the background color at runtime. Only use if you do not know what color to use at +compile-time. If the color is constant, use either OwoColorize::bg or +a color-specific method, such as OwoColorize::on_yellow, Read more
§

fn fg_rgb<const R: u8, const G: u8, const B: u8>( + &self +) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the foreground color to a specific RGB value.
§

fn bg_rgb<const R: u8, const G: u8, const B: u8>( + &self +) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the background color to a specific RGB value.
§

fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>

Sets the foreground color to an RGB value.
§

fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>

Sets the background color to an RGB value.
§

fn style(&self, style: Style) -> Styled<&Self>

Apply a runtime-determined style
§

impl<T> Pipe for Twhere + T: ?Sized,

§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere + Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere + R: 'a,

Borrows self and passes that borrow into the pipe function. Read more
§

fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere + R: 'a,

Mutably borrows self and passes that borrow into the pipe function. Read more
§

fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> Rwhere + Self: Borrow<B>, + B: 'a + ?Sized, + R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
§

fn pipe_borrow_mut<'a, B, R>( + &'a mut self, + func: impl FnOnce(&'a mut B) -> R +) -> Rwhere + Self: BorrowMut<B>, + B: 'a + ?Sized, + R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe +function. Read more
§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> Rwhere + Self: AsRef<U>, + U: 'a + ?Sized, + R: 'a,

Borrows self, then passes self.as_ref() into the pipe function.
§

fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> Rwhere + Self: AsMut<U>, + U: 'a + ?Sized, + R: 'a,

Mutably borrows self, then passes self.as_mut() into the pipe +function.
§

fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> Rwhere + Self: Deref<Target = T>, + T: 'a + ?Sized, + R: 'a,

Borrows self, then passes self.deref() into the pipe function.
§

fn pipe_deref_mut<'a, T, R>( + &'a mut self, + func: impl FnOnce(&'a mut T) -> R +) -> Rwhere + Self: DerefMut<Target = T> + Deref, + T: 'a + ?Sized, + R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe +function.
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
§

impl<T> Tap for T

§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Selfwhere + Self: Borrow<B>, + B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
§

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere + Self: BorrowMut<B>, + B: ?Sized,

Mutable access to the BorrowMut<B> of a value. Read more
§

fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Selfwhere + Self: AsRef<R>, + R: ?Sized,

Immutable access to the AsRef<R> view of a value. Read more
§

fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere + Self: AsMut<R>, + R: ?Sized,

Mutable access to the AsMut<R> view of a value. Read more
§

fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Selfwhere + Self: Deref<Target = T>, + T: ?Sized,

Immutable access to the Deref::Target of a value. Read more
§

fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Selfwhere + Self: DerefMut<Target = T> + Deref, + T: ?Sized,

Mutable access to the Deref::Target of a value. Read more
§

fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

Calls .tap() only in debug builds, and is erased in release builds.
§

fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

Calls .tap_mut() only in debug builds, and is erased in release +builds.
§

fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Selfwhere + Self: Borrow<B>, + B: ?Sized,

Calls .tap_borrow() only in debug builds, and is erased in release +builds.
§

fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere + Self: BorrowMut<B>, + B: ?Sized,

Calls .tap_borrow_mut() only in debug builds, and is erased in release +builds.
§

fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Selfwhere + Self: AsRef<R>, + R: ?Sized,

Calls .tap_ref() only in debug builds, and is erased in release +builds.
§

fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere + Self: AsMut<R>, + R: ?Sized,

Calls .tap_ref_mut() only in debug builds, and is erased in release +builds.
§

fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Selfwhere + Self: Deref<Target = T>, + T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release +builds.
§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Selfwhere + Self: DerefMut<Target = T> + Deref, + T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release +builds.
§

impl<T> TryConv for T

§

fn try_conv<T>(self) -> Result<T, Self::Error>where + Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

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 Twhere + U: TryFrom<T>,

§

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.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
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
\ No newline at end of file diff --git a/hotshot_query_service/data_source/storage/index.html b/hotshot_query_service/data_source/storage/index.html new file mode 100644 index 000000000..fe1a7a699 --- /dev/null +++ b/hotshot_query_service/data_source/storage/index.html @@ -0,0 +1,12 @@ +hotshot_query_service::data_source::storage - Rust
Expand description

Persistent storage for data sources.

+

Naturally, an archival query service such as this is heavily dependent on a persistent storage +implementation. This module defines the interfaces required of this storage. Any storage layer +implementing the appropriate interfaces can be used as the storage layer when constructing a +FetchingDataSource, which can in turn be used to instantiate the +REST APIs provided by this crate.

+

This module also comes with a few pre-built persistence implementations:

+ +

Re-exports

Modules

Traits

\ No newline at end of file diff --git a/hotshot_query_service/data_source/storage/sidebar-items.js b/hotshot_query_service/data_source/storage/sidebar-items.js new file mode 100644 index 000000000..c973249f4 --- /dev/null +++ b/hotshot_query_service/data_source/storage/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"mod":["fs","sql"],"trait":["AvailabilityStorage"]}; \ No newline at end of file diff --git a/hotshot_query_service/data_source/storage/sql/fn.default_migrations.html b/hotshot_query_service/data_source/storage/sql/fn.default_migrations.html new file mode 100644 index 000000000..ff036658d --- /dev/null +++ b/hotshot_query_service/data_source/storage/sql/fn.default_migrations.html @@ -0,0 +1,2 @@ +default_migrations in hotshot_query_service::data_source::storage::sql - Rust
pub fn default_migrations() -> Vec<Migration>
Expand description

The migrations requied to build the default schema for this version of SqlStorage.

+
\ No newline at end of file diff --git a/hotshot_query_service/data_source/storage/sql/index.html b/hotshot_query_service/data_source/storage/sql/index.html new file mode 100644 index 000000000..41bb91bc2 --- /dev/null +++ b/hotshot_query_service/data_source/storage/sql/index.html @@ -0,0 +1,3 @@ +hotshot_query_service::data_source::storage::sql - Rust

Re-exports

  • pub use tokio_postgres as postgres;

Macros

Structs

  • Postgres client config.
  • The Error type, a wrapper around a dynamic error type.
  • Represents a schema migration to be run on the database, +this struct is used by the embed_migrations! macro to gather migration files +and shouldn’t be needed by the user
  • Storage for the APIs provided in this crate, backed by a remote PostgreSQL database.
  • An atomic SQL transaction.

Traits

Functions

\ No newline at end of file diff --git a/hotshot_query_service/data_source/sql/macro.include_dir!.html b/hotshot_query_service/data_source/storage/sql/macro.include_dir!.html similarity index 100% rename from hotshot_query_service/data_source/sql/macro.include_dir!.html rename to hotshot_query_service/data_source/storage/sql/macro.include_dir!.html diff --git a/hotshot_query_service/data_source/storage/sql/macro.include_dir.html b/hotshot_query_service/data_source/storage/sql/macro.include_dir.html new file mode 100644 index 000000000..6c350d0b8 --- /dev/null +++ b/hotshot_query_service/data_source/storage/sql/macro.include_dir.html @@ -0,0 +1,2 @@ +include_dir in hotshot_query_service::data_source::storage::sql - Rust
include_dir!() { /* proc-macro */ }
Expand description

Embed the contents of a directory in your crate.

+
\ No newline at end of file diff --git a/hotshot_query_service/data_source/storage/sql/macro.include_migrations!.html b/hotshot_query_service/data_source/storage/sql/macro.include_migrations!.html new file mode 100644 index 000000000..43a61e89d --- /dev/null +++ b/hotshot_query_service/data_source/storage/sql/macro.include_migrations!.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to macro.include_migrations.html...

+ + + \ No newline at end of file diff --git a/hotshot_query_service/data_source/storage/sql/macro.include_migrations.html b/hotshot_query_service/data_source/storage/sql/macro.include_migrations.html new file mode 100644 index 000000000..19c9bd996 --- /dev/null +++ b/hotshot_query_service/data_source/storage/sql/macro.include_migrations.html @@ -0,0 +1,27 @@ +include_migrations in hotshot_query_service::data_source::storage::sql - Rust
macro_rules! include_migrations {
+    ($dir:tt) => { ... };
+}
Expand description

Embed migrations from the given directory into the current binary.

+

The macro invocation include_migrations!(path) evaluates to an expression of type impl Iterator<Item = Migration>. Each migration must be a text file which is an immediate child of +path, and there must be no non-migration files in path. The migration files must have names +of the form V${version}__${name}.sql, where version is a positive integer indicating how the +migration is to be ordered relative to other migrations, and name is a descriptive name for +the migration.

+

path should be an absolute path. It is possible to give a path relative to the root of the +invoking crate by using environment variable expansions and the CARGO_MANIFEST_DIR environment +variable.

+

As an example, this is the invocation used to load the default migrations from the +hotshot-query-service crate. The migrations are located in a directory called migrations at +the root of the crate.

+ +
let migrations: Vec<Migration> = include_migrations!("$CARGO_MANIFEST_DIR/migrations").collect();
+assert_eq!(migrations[0].version(), 10);
+assert_eq!(migrations[0].name(), "init_schema");
+

Note that a similar macro is available from Refinery: +embed_migrations. This +macro differs in that it evaluates to an iterator of migrations, making it an +expression macro, while embed_migrations is a statement macro that defines a module which +provides access to the embedded migrations only indirectly via a +Runner. The direct access to +migrations provided by include_migrations makes this macro easier to use with +Config::migrations, for combining custom migrations with default_migrations.

+
\ No newline at end of file diff --git a/hotshot_query_service/data_source/storage/sql/sidebar-items.js b/hotshot_query_service/data_source/storage/sql/sidebar-items.js new file mode 100644 index 000000000..c134d0d34 --- /dev/null +++ b/hotshot_query_service/data_source/storage/sql/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"fn":["default_migrations"],"macro":["include_dir","include_migrations"],"struct":["Config","Error","Migration","SqlStorage","Transaction"],"trait":["Query"]}; \ No newline at end of file diff --git a/hotshot_query_service/data_source/sql/struct.Config.html b/hotshot_query_service/data_source/storage/sql/struct.Config.html similarity index 78% rename from hotshot_query_service/data_source/sql/struct.Config.html rename to hotshot_query_service/data_source/storage/sql/struct.Config.html index e6e5087e8..f681b3e31 100644 --- a/hotshot_query_service/data_source/sql/struct.Config.html +++ b/hotshot_query_service/data_source/storage/sql/struct.Config.html @@ -1,27 +1,28 @@ -Config in hotshot_query_service::data_source::sql - Rust
pub struct Config { /* private fields */ }
Expand description

Postgres client config.

-

Implementations§

source§

impl Config

source

pub fn host(self, host: impl Into<String>) -> Self

Set the hostname of the database server.

+Config in hotshot_query_service::data_source::storage::sql - Rust
pub struct Config { /* private fields */ }
Expand description

Postgres client config.

+

Implementations§

source§

impl Config

source

pub async fn connect<Types>(self) -> Result<SqlDataSource<Types>, Error>where + Types: NodeType, + Payload<Types>: QueryablePayload,

Connect to the database with this config.

+
source§

impl Config

source

pub fn host(self, host: impl Into<String>) -> Self

Set the hostname of the database server.

The default is localhost.

-
source

pub fn port(self, port: u16) -> Self

Set the port on which to connect to the database.

+
source

pub fn port(self, port: u16) -> Self

Set the port on which to connect to the database.

The default is 5432, the default Postgres port.

-
source

pub fn user(self, user: &str) -> Self

Set the DB user to connect as.

-
source

pub fn password(self, password: &str) -> Self

Set a password for connecting to the database.

-
source

pub fn database(self, database: &str) -> Self

Set the name of the database to connect to.

-
source

pub fn schema(self, schema: impl Into<String>) -> Self

Set the name of the schema to use for queries.

+
source

pub fn user(self, user: &str) -> Self

Set the DB user to connect as.

+
source

pub fn password(self, password: &str) -> Self

Set a password for connecting to the database.

+
source

pub fn database(self, database: &str) -> Self

Set the name of the database to connect to.

+
source

pub fn schema(self, schema: impl Into<String>) -> Self

Set the name of the schema to use for queries.

The default schema is named hotshot and is created via the default migrations.

-
source

pub fn reset_schema(self) -> Self

Reset the schema on connection.

-

When this Config is used to connect a SqlDataSource, if this -option is set, the relevant schema will first be dropped and then -recreated, yielding a completely fresh instance of the query service.

+
source

pub fn reset_schema(self) -> Self

Reset the schema on connection.

+

When this Config is used to connect a +SqlDataSource, if this option is set, the relevant +schema will first be dropped and then recreated, yielding a completely +fresh instance of the query service.

This is a particularly useful capability for development and staging environments. Still, it must be used with extreme caution, as using this will irrevocably delete any data pertaining to the query service in the database.

-
source

pub fn migrations(self, migrations: impl IntoIterator<Item = Migration>) -> Self

Add custom migrations to run when connecting to the database.

-
source

pub fn no_migrations(self) -> Self

Skip all migrations when connecting to the database.

-
source

pub fn tls(self) -> Self

Use TLS for an encrypted connection to the database.

-
source

pub async fn connect<Types>(self) -> Result<SqlDataSource<Types>, Error>where - Types: NodeType, - Payload<Types>: QueryablePayload,

Connect to the database with this config.

-

Trait Implementations§

source§

impl Clone for Config

source§

fn clone(&self) -> Config

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Config

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Config

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl From<Config> for Config

source§

fn from(pgcfg: Config) -> Self

Converts to this type from the input type.
source§

impl FromStr for Config

§

type Err = <Config as FromStr>::Err

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere +

source

pub fn migrations(self, migrations: impl IntoIterator<Item = Migration>) -> Self

Add custom migrations to run when connecting to the database.

+
source

pub fn no_migrations(self) -> Self

Skip all migrations when connecting to the database.

+
source

pub fn tls(self) -> Self

Use TLS for an encrypted connection to the database.

+

Trait Implementations§

source§

impl Clone for Config

source§

fn clone(&self) -> Config

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Config

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Default for Config

source§

fn default() -> Self

Returns the “default value” for a type. Read more
source§

impl From<Config> for Config

source§

fn from(pgcfg: Config) -> Self

Converts to this type from the input type.
source§

impl FromStr for Config

§

type Err = <Config as FromStr>::Err

The associated error which can be returned from parsing.
source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere T: 'a,

§

fn implicit( diff --git a/hotshot_query_service/data_source/storage/sql/struct.Error.html b/hotshot_query_service/data_source/storage/sql/struct.Error.html new file mode 100644 index 000000000..7df348980 --- /dev/null +++ b/hotshot_query_service/data_source/storage/sql/struct.Error.html @@ -0,0 +1,310 @@ +Error in hotshot_query_service::data_source::storage::sql - Rust
pub struct Error { /* private fields */ }
Expand description

The Error type, a wrapper around a dynamic error type.

+

Error works a lot like Box<dyn std::error::Error>, but with these +differences:

+
    +
  • Error requires that the error is Send, Sync, and 'static.
  • +
  • Error guarantees that a backtrace is available, even if the underlying +error type does not provide one.
  • +
  • Error is represented as a narrow pointer — exactly one word in +size instead of two.
  • +
+
+

Display representations

+

When you print an error object using “{}” or to_string(), only the outermost +underlying error or context is printed, not any of the lower level causes. +This is exactly as if you had called the Display impl of the error from +which you constructed your anyhow::Error.

+
Failed to read instrs from ./path/to/instrs.json
+
+

To print causes as well using anyhow’s default formatting of causes, use the +alternate selector “{:#}”.

+
Failed to read instrs from ./path/to/instrs.json: No such file or directory (os error 2)
+
+

The Debug format “{:?}” includes your backtrace if one was captured. Note +that this is the representation you get by default if you return an error +from fn main instead of printing it explicitly yourself.

+
Error: Failed to read instrs from ./path/to/instrs.json
+
+Caused by:
+    No such file or directory (os error 2)
+
+

and if there is a backtrace available:

+
Error: Failed to read instrs from ./path/to/instrs.json
+
+Caused by:
+    No such file or directory (os error 2)
+
+Stack backtrace:
+   0: <E as anyhow::context::ext::StdError>::ext_context
+             at /git/anyhow/src/backtrace.rs:26
+   1: core::result::Result<T,E>::map_err
+             at /git/rustc/src/libcore/result.rs:596
+   2: anyhow::context::<impl anyhow::Context<T,E> for core::result::Result<T,E>>::with_context
+             at /git/anyhow/src/context.rs:58
+   3: testing::main
+             at src/main.rs:5
+   4: std::rt::lang_start
+             at /git/rustc/src/libstd/rt.rs:61
+   5: main
+   6: __libc_start_main
+   7: _start
+
+

To see a conventional struct-style Debug representation, use “{:#?}”.

+
Error {
+    context: "Failed to read instrs from ./path/to/instrs.json",
+    source: Os {
+        code: 2,
+        kind: NotFound,
+        message: "No such file or directory",
+    },
+}
+
+

If none of the built-in representations are appropriate and you would prefer +to render the error and its cause chain yourself, it can be done something +like this:

+ +
use anyhow::{Context, Result};
+
+fn main() {
+    if let Err(err) = try_main() {
+        eprintln!("ERROR: {}", err);
+        err.chain().skip(1).for_each(|cause| eprintln!("because: {}", cause));
+        std::process::exit(1);
+    }
+}
+
+fn try_main() -> Result<()> {
+    ...
+}
+

Implementations§

source§

impl Error

source

pub fn new<E>(error: E) -> Errorwhere + E: Error + Send + Sync + 'static,

Create a new error object from any error type.

+

The error type must be threadsafe and 'static, so that the Error +will be as well.

+

If the error type does not provide a backtrace, a backtrace will be +created here to ensure that a backtrace exists.

+
source

pub fn msg<M>(message: M) -> Errorwhere + M: Display + Debug + Send + Sync + 'static,

Create a new error object from a printable error message.

+

If the argument implements std::error::Error, prefer Error::new +instead which preserves the underlying error’s cause chain and +backtrace. If the argument may or may not implement std::error::Error +now or in the future, use anyhow!(err) which handles either way +correctly.

+

Error::msg("...") is equivalent to anyhow!("...") but occasionally +convenient in places where a function is preferable over a macro, such +as iterator or stream combinators:

+ +
use anyhow::{Error, Result};
+use futures::stream::{Stream, StreamExt, TryStreamExt};
+
+async fn demo<S>(stream: S) -> Result<Vec<Output>>
+where
+    S: Stream<Item = Input>,
+{
+    stream
+        .then(ffi::do_some_work) // returns Result<Output, &str>
+        .map_err(Error::msg)
+        .try_collect()
+        .await
+}
+
source

pub fn context<C>(self, context: C) -> Errorwhere + C: Display + Send + Sync + 'static,

Wrap the error value with additional context.

+

For attaching context to a Result as it is propagated, the +Context extension trait may be more convenient than +this function.

+

The primary reason to use error.context(...) instead of +result.context(...) via the Context trait would be if the context +needs to depend on some data held by the underlying error:

+ +
use anyhow::Result;
+use std::fs::File;
+use std::path::Path;
+
+struct ParseError {
+    line: usize,
+    column: usize,
+}
+
+fn parse_impl(file: File) -> Result<T, ParseError> {
+    ...
+}
+
+pub fn parse(path: impl AsRef<Path>) -> Result<T> {
+    let file = File::open(&path)?;
+    parse_impl(file).map_err(|error| {
+        let context = format!(
+            "only the first {} lines of {} are valid",
+            error.line, path.as_ref().display(),
+        );
+        anyhow::Error::new(error).context(context)
+    })
+}
+
source

pub fn chain(&self) -> Chain<'_>

An iterator of the chain of source errors contained by this Error.

+

This iterator will visit every error in the cause chain of this error +object, beginning with the error that this error object was created +from.

+
Example
+
use anyhow::Error;
+use std::io;
+
+pub fn underlying_io_error_kind(error: &Error) -> Option<io::ErrorKind> {
+    for cause in error.chain() {
+        if let Some(io_error) = cause.downcast_ref::<io::Error>() {
+            return Some(io_error.kind());
+        }
+    }
+    None
+}
+
source

pub fn root_cause(&self) -> &(dyn Error + 'static)

The lowest level cause of this error — this error’s cause’s +cause’s cause etc.

+

The root cause is the last error in the iterator produced by +chain().

+
source

pub fn is<E>(&self) -> boolwhere + E: Display + Debug + Send + Sync + 'static,

Returns true if E is the type held by this error object.

+

For errors with context, this method returns true if E matches the +type of the context C or the type of the error on which the +context has been attached. For details about the interaction between +context and downcasting, see here.

+
source

pub fn downcast<E>(self) -> Result<E, Error>where + E: Display + Debug + Send + Sync + 'static,

Attempt to downcast the error object to a concrete type.

+
source

pub fn downcast_ref<E>(&self) -> Option<&E>where + E: Display + Debug + Send + Sync + 'static,

Downcast this error object by reference.

+
Example
+
// If the error was caused by redaction, then return a tombstone instead
+// of the content.
+match root_cause.downcast_ref::<DataStoreError>() {
+    Some(DataStoreError::Censored(_)) => Ok(Poll::Ready(REDACTED_CONTENT)),
+    None => Err(error),
+}
+
source

pub fn downcast_mut<E>(&mut self) -> Option<&mut E>where + E: Display + Debug + Send + Sync + 'static,

Downcast this error object by mutable reference.

+

Trait Implementations§

source§

impl AsRef<dyn Error> for Error

source§

fn as_ref(&self) -> &(dyn Error + 'static)

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl AsRef<dyn Error + Send + Sync> for Error

source§

fn as_ref(&self) -> &(dyn Error + Send + Sync + 'static)

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl Debug for Error

source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Deref for Error

§

type Target = dyn Error + Send + Sync

The resulting type after dereferencing.
source§

fn deref(&self) -> &<Error as Deref>::Target

Dereferences the value.
source§

impl DerefMut for Error

source§

fn deref_mut(&mut self) -> &mut <Error as Deref>::Target

Mutably dereferences the value.
source§

impl Display for Error

source§

fn fmt(&self, formatter: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
source§

impl Drop for Error

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl<E> From<E> for Errorwhere + E: Error + Send + Sync + 'static,

source§

fn from(error: E) -> Error

Converts to this type from the input type.

Auto Trait Implementations§

§

impl RefUnwindSafe for Error

§

impl Send for Error

§

impl Sync for Error

§

impl Unpin for Error

§

impl UnwindSafe for Error

Blanket Implementations§

source§

impl<T> Any for Twhere + T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere + T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere + T: 'a,

§

fn implicit( + self, + class: Class, + constructed: bool, + tag: u32 +) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for Twhere + T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Conv for T

§

fn conv<T>(self) -> Twhere + Self: Into<T>,

Converts self into T using Into<T>. Read more
§

impl<T> Downcast for Twhere + T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can +then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be +further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
§

fn as_any(&self) -> &(dyn Any + 'static)

Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot +generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot +generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSync for Twhere + T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be +further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
§

impl<T> FmtForward for T

§

fn fmt_binary(self) -> FmtBinary<Self>where + Self: Binary,

Causes self to use its Binary implementation when Debug-formatted.
§

fn fmt_display(self) -> FmtDisplay<Self>where + Self: Display,

Causes self to use its Display implementation when +Debug-formatted.
§

fn fmt_lower_exp(self) -> FmtLowerExp<Self>where + Self: LowerExp,

Causes self to use its LowerExp implementation when +Debug-formatted.
§

fn fmt_lower_hex(self) -> FmtLowerHex<Self>where + Self: LowerHex,

Causes self to use its LowerHex implementation when +Debug-formatted.
§

fn fmt_octal(self) -> FmtOctal<Self>where + Self: Octal,

Causes self to use its Octal implementation when Debug-formatted.
§

fn fmt_pointer(self) -> FmtPointer<Self>where + Self: Pointer,

Causes self to use its Pointer implementation when +Debug-formatted.
§

fn fmt_upper_exp(self) -> FmtUpperExp<Self>where + Self: UpperExp,

Causes self to use its UpperExp implementation when +Debug-formatted.
§

fn fmt_upper_hex(self) -> FmtUpperHex<Self>where + Self: UpperHex,

Causes self to use its UpperHex implementation when +Debug-formatted.
§

fn fmt_list(self) -> FmtList<Self>where + &'a Self: for<'a> IntoIterator,

Formats each item in a sequence. Read more
source§

impl<T> From<!> for T

source§

fn from(t: !) -> T

Converts to this type from the input type.
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

+
§

impl<T> Instrument for T

§

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

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

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
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 Twhere + 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.

+
§

impl<D> OwoColorize for D

§

fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where + C: Color,

Set the foreground color generically Read more
§

fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where + C: Color,

Set the background color generically. Read more
§

fn black<'a>(&'a self) -> FgColorDisplay<'a, Black, Self>

Change the foreground color to black
§

fn on_black<'a>(&'a self) -> BgColorDisplay<'a, Black, Self>

Change the background color to black
§

fn red<'a>(&'a self) -> FgColorDisplay<'a, Red, Self>

Change the foreground color to red
§

fn on_red<'a>(&'a self) -> BgColorDisplay<'a, Red, Self>

Change the background color to red
§

fn green<'a>(&'a self) -> FgColorDisplay<'a, Green, Self>

Change the foreground color to green
§

fn on_green<'a>(&'a self) -> BgColorDisplay<'a, Green, Self>

Change the background color to green
§

fn yellow<'a>(&'a self) -> FgColorDisplay<'a, Yellow, Self>

Change the foreground color to yellow
§

fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>

Change the background color to yellow
§

fn blue<'a>(&'a self) -> FgColorDisplay<'a, Blue, Self>

Change the foreground color to blue
§

fn on_blue<'a>(&'a self) -> BgColorDisplay<'a, Blue, Self>

Change the background color to blue
§

fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>

Change the foreground color to magenta
§

fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>

Change the background color to magenta
§

fn purple<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>

Change the foreground color to purple
§

fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>

Change the background color to purple
§

fn cyan<'a>(&'a self) -> FgColorDisplay<'a, Cyan, Self>

Change the foreground color to cyan
§

fn on_cyan<'a>(&'a self) -> BgColorDisplay<'a, Cyan, Self>

Change the background color to cyan
§

fn white<'a>(&'a self) -> FgColorDisplay<'a, White, Self>

Change the foreground color to white
§

fn on_white<'a>(&'a self) -> BgColorDisplay<'a, White, Self>

Change the background color to white
§

fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>

Change the foreground color to the terminal default
§

fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>

Change the background color to the terminal default
§

fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>

Change the foreground color to bright black
§

fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>

Change the background color to bright black
§

fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>

Change the foreground color to bright red
§

fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>

Change the background color to bright red
§

fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>

Change the foreground color to bright green
§

fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>

Change the background color to bright green
§

fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>

Change the foreground color to bright yellow
§

fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>

Change the background color to bright yellow
§

fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>

Change the foreground color to bright blue
§

fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>

Change the background color to bright blue
§

fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>

Change the foreground color to bright magenta
§

fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>

Change the background color to bright magenta
§

fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>

Change the foreground color to bright purple
§

fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>

Change the background color to bright purple
§

fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>

Change the foreground color to bright cyan
§

fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>

Change the background color to bright cyan
§

fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>

Change the foreground color to bright white
§

fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>

Change the background color to bright white
§

fn bold<'a>(&'a self) -> BoldDisplay<'a, Self>

Make the text bold
§

fn dimmed<'a>(&'a self) -> DimDisplay<'a, Self>

Make the text dim
§

fn italic<'a>(&'a self) -> ItalicDisplay<'a, Self>

Make the text italicized
§

fn underline<'a>(&'a self) -> UnderlineDisplay<'a, Self>

Make the text italicized
Make the text blink
Make the text blink (but fast!)
§

fn reversed<'a>(&'a self) -> ReversedDisplay<'a, Self>

Swap the foreground and background colors
§

fn hidden<'a>(&'a self) -> HiddenDisplay<'a, Self>

Hide the text
§

fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>

Cross out the text
§

fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where + Color: DynColor,

Set the foreground color at runtime. Only use if you do not know which color will be used at +compile-time. If the color is constant, use either OwoColorize::fg or +a color-specific method, such as OwoColorize::green, Read more
§

fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where + Color: DynColor,

Set the background color at runtime. Only use if you do not know what color to use at +compile-time. If the color is constant, use either OwoColorize::bg or +a color-specific method, such as OwoColorize::on_yellow, Read more
§

fn fg_rgb<const R: u8, const G: u8, const B: u8>( + &self +) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the foreground color to a specific RGB value.
§

fn bg_rgb<const R: u8, const G: u8, const B: u8>( + &self +) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>

Set the background color to a specific RGB value.
§

fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>

Sets the foreground color to an RGB value.
§

fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>

Sets the background color to an RGB value.
§

fn style(&self, style: Style) -> Styled<&Self>

Apply a runtime-determined style
§

impl<T> Pipe for Twhere + T: ?Sized,

§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere + Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere + R: 'a,

Borrows self and passes that borrow into the pipe function. Read more
§

fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere + R: 'a,

Mutably borrows self and passes that borrow into the pipe function. Read more
§

fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> Rwhere + Self: Borrow<B>, + B: 'a + ?Sized, + R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
§

fn pipe_borrow_mut<'a, B, R>( + &'a mut self, + func: impl FnOnce(&'a mut B) -> R +) -> Rwhere + Self: BorrowMut<B>, + B: 'a + ?Sized, + R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe +function. Read more
§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> Rwhere + Self: AsRef<U>, + U: 'a + ?Sized, + R: 'a,

Borrows self, then passes self.as_ref() into the pipe function.
§

fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> Rwhere + Self: AsMut<U>, + U: 'a + ?Sized, + R: 'a,

Mutably borrows self, then passes self.as_mut() into the pipe +function.
§

fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> Rwhere + Self: Deref<Target = T>, + T: 'a + ?Sized, + R: 'a,

Borrows self, then passes self.deref() into the pipe function.
§

fn pipe_deref_mut<'a, T, R>( + &'a mut self, + func: impl FnOnce(&'a mut T) -> R +) -> Rwhere + Self: DerefMut<Target = T> + Deref, + T: 'a + ?Sized, + R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe +function.
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> SectionExt for Twhere + T: Display + Send + Sync + 'static,

source§

fn header<C>(self, header: C) -> IndentedSection<C, T>where + C: Display + Send + Sync + 'static,

Add a header to a Section and indent the body Read more
§

impl<T> Tap for T

§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Selfwhere + Self: Borrow<B>, + B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
§

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere + Self: BorrowMut<B>, + B: ?Sized,

Mutable access to the BorrowMut<B> of a value. Read more
§

fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Selfwhere + Self: AsRef<R>, + R: ?Sized,

Immutable access to the AsRef<R> view of a value. Read more
§

fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere + Self: AsMut<R>, + R: ?Sized,

Mutable access to the AsMut<R> view of a value. Read more
§

fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Selfwhere + Self: Deref<Target = T>, + T: ?Sized,

Immutable access to the Deref::Target of a value. Read more
§

fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Selfwhere + Self: DerefMut<Target = T> + Deref, + T: ?Sized,

Mutable access to the Deref::Target of a value. Read more
§

fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

Calls .tap() only in debug builds, and is erased in release builds.
§

fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

Calls .tap_mut() only in debug builds, and is erased in release +builds.
§

fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Selfwhere + Self: Borrow<B>, + B: ?Sized,

Calls .tap_borrow() only in debug builds, and is erased in release +builds.
§

fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere + Self: BorrowMut<B>, + B: ?Sized,

Calls .tap_borrow_mut() only in debug builds, and is erased in release +builds.
§

fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Selfwhere + Self: AsRef<R>, + R: ?Sized,

Calls .tap_ref() only in debug builds, and is erased in release +builds.
§

fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere + Self: AsMut<R>, + R: ?Sized,

Calls .tap_ref_mut() only in debug builds, and is erased in release +builds.
§

fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Selfwhere + Self: Deref<Target = T>, + T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release +builds.
§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Selfwhere + Self: DerefMut<Target = T> + Deref, + T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release +builds.
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
§

impl<T> TryConv for T

§

fn try_conv<T>(self) -> Result<T, Self::Error>where + Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. Read more
source§

impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

§

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 Twhere + U: TryFrom<T>,

§

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.
§

impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
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
\ No newline at end of file diff --git a/hotshot_query_service/availability/struct.BlockStreamSnafu.html b/hotshot_query_service/data_source/storage/sql/struct.Migration.html similarity index 67% rename from hotshot_query_service/availability/struct.BlockStreamSnafu.html rename to hotshot_query_service/data_source/storage/sql/struct.Migration.html index e4ad9354e..240364bb9 100644 --- a/hotshot_query_service/availability/struct.BlockStreamSnafu.html +++ b/hotshot_query_service/data_source/storage/sql/struct.Migration.html @@ -1,27 +1,22 @@ -BlockStreamSnafu in hotshot_query_service::availability - Rust
pub struct BlockStreamSnafu<__T0, __T1> {
-    pub height: __T0,
-    pub reason: __T1,
-}
Expand description

SNAFU context selector for the Error::BlockStream variant

-

Fields§

§height: __T0§reason: __T1

Implementations§

source§

impl<__T0, __T1> BlockStreamSnafu<__T0, __T1>

source

pub fn build(self) -> Errorwhere - __T0: Into<usize>, - __T1: Into<String>,

Consume the selector and return the associated error

-
source

pub fn fail<__T>(self) -> Result<__T, Error>where - __T0: Into<usize>, - __T1: Into<String>,

Consume the selector and return a Result with the associated error

-

Trait Implementations§

source§

impl<__T0: Clone, __T1: Clone> Clone for BlockStreamSnafu<__T0, __T1>

source§

fn clone(&self) -> BlockStreamSnafu<__T0, __T1>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<__T0: Debug, __T1: Debug> Debug for BlockStreamSnafu<__T0, __T1>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<__T0, __T1> IntoError<Error> for BlockStreamSnafu<__T0, __T1>where - Error: Error + ErrorCompat, - __T0: Into<usize>, - __T1: Into<String>,

§

type Source = NoneError

The underlying error
source§

fn into_error(self, error: Self::Source) -> Error

Combine the information to produce the error
source§

impl<__T0: Copy, __T1: Copy> Copy for BlockStreamSnafu<__T0, __T1>

Auto Trait Implementations§

§

impl<__T0, __T1> RefUnwindSafe for BlockStreamSnafu<__T0, __T1>where - __T0: RefUnwindSafe, - __T1: RefUnwindSafe,

§

impl<__T0, __T1> Send for BlockStreamSnafu<__T0, __T1>where - __T0: Send, - __T1: Send,

§

impl<__T0, __T1> Sync for BlockStreamSnafu<__T0, __T1>where - __T0: Sync, - __T1: Sync,

§

impl<__T0, __T1> Unpin for BlockStreamSnafu<__T0, __T1>where - __T0: Unpin, - __T1: Unpin,

§

impl<__T0, __T1> UnwindSafe for BlockStreamSnafu<__T0, __T1>where - __T0: UnwindSafe, - __T1: UnwindSafe,

Blanket Implementations§

source§

impl<T> Any for Twhere +Migration in hotshot_query_service::data_source::storage::sql - Rust
pub struct Migration { /* private fields */ }
Expand description

Represents a schema migration to be run on the database, +this struct is used by the embed_migrations! macro to gather migration files +and shouldn’t be needed by the user

+

Implementations§

§

impl Migration

pub fn unapplied(input_name: &str, sql: &str) -> Result<Migration, Error>

Create an unapplied migration, name and version are parsed from the input_name, +which must be named in the format (U|V){1}__{2}.rs where {1} represents the migration version and {2} the name.

+

pub fn sql(&self) -> Option<&str>

pub fn version(&self) -> u32

Get the Migration version

+

pub fn prefix(&self) -> &Type

Get the Prefix

+

pub fn name(&self) -> &str

Get the Migration Name

+

pub fn applied_on(&self) -> Option<&OffsetDateTime>

Get the timestamp from when the Migration was applied. None when unapplied. +Migrations returned from Runner::get_migrations() will always have None.

+

pub fn checksum(&self) -> u64

Get the Migration checksum. Checksum is formed from the name version and sql of the Migration

+

Trait Implementations§

§

impl Clone for Migration

§

fn clone(&self) -> Migration

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
§

impl Debug for Migration

§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Display for Migration

§

fn fmt(&self, fmt: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
§

impl Ord for Migration

§

fn cmp(&self, other: &Migration) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Selfwhere + Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Selfwhere + Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Selfwhere + Self: Sized + PartialOrd,

Restrict a value to a certain interval. Read more
§

impl PartialEq for Migration

§

fn eq(&self, other: &Migration) -> bool

This method tests for self and other values to be equal, and is used +by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

This method tests for !=. The default implementation is almost always +sufficient, and should not be overridden without very good reason.
§

impl PartialOrd for Migration

§

fn partial_cmp(&self, other: &Migration) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

This method tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

This method tests less than or equal to (for self and other) and is used by the <= +operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

This method tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

This method tests greater than or equal to (for self and other) and is used by the >= +operator. Read more
§

impl Eq for Migration

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere T: 'a,

§

fn implicit( @@ -31,7 +26,9 @@ tag: u32 ) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere - T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<T> Conv for T

§

fn conv<T>(self) -> Twhere + T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
§

impl<Q, K> Comparable<K> for Qwhere + Q: Ord + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn compare(&self, key: &K) -> Ordering

Compare self to key and return their ordering.
§

impl<T> Conv for T

§

fn conv<T>(self) -> Twhere Self: Into<T>,

Converts self into T using Into<T>. Read more
§

impl<T> Downcast for Twhere T: Any,

§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
§

fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be @@ -41,7 +38,13 @@ T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
source§

impl<T> DynClone for Twhere T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

source§

impl<T> DynClone for Twhere - T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

§

impl<T> FmtForward for T

§

fn fmt_binary(self) -> FmtBinary<Self>where + T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
§

impl<Q, K> Equivalent<K> for Qwhere + Q: Eq + ?Sized, + K: Borrow<Q> + ?Sized,

§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
§

impl<T> FmtForward for T

§

fn fmt_binary(self) -> FmtBinary<Self>where Self: Binary,

Causes self to use its Binary implementation when Debug-formatted.
§

fn fmt_display(self) -> FmtDisplay<Self>where Self: Display,

Causes self to use its Display implementation when Debug-formatted.
§

fn fmt_lower_exp(self) -> FmtLowerExp<Self>where @@ -108,7 +111,9 @@ Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe -function.
§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
§

impl<T> Tap for T

§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Selfwhere +function.

§

impl<T> Pointable for T

§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same for T

§

type Output = T

Should always be Self
source§

impl<T> SectionExt for Twhere + T: Display + Send + Sync + 'static,

source§

fn header<C>(self, header: C) -> IndentedSection<C, T>where + C: Display + Send + Sync + 'static,

Add a header to a Section and indent the body Read more
§

impl<T> Tap for T

§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Selfwhere Self: Borrow<B>, B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
§

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere Self: BorrowMut<B>, @@ -140,7 +145,8 @@ Self: DerefMut<Target = T> + Deref, T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
source§

impl<T> ToOwned for Twhere - T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

impl<T> TryConv for T

§

fn try_conv<T>(self) -> Result<T, Self::Error>where + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T> ToString for Twhere + T: Display + ?Sized,

source§

default fn to_string(&self) -> String

Converts the given value to a String. Read more
§

impl<T> TryConv for T

§

fn try_conv<T>(self) -> Result<T, Self::Error>where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. Read more
source§

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

§

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 Twhere U: TryFrom<T>,

§

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.
§

impl<V, T> VZip<V> for Twhere diff --git a/hotshot_query_service/data_source/sql/struct.SqlDataSource.html b/hotshot_query_service/data_source/storage/sql/struct.SqlStorage.html similarity index 59% rename from hotshot_query_service/data_source/sql/struct.SqlDataSource.html rename to hotshot_query_service/data_source/storage/sql/struct.SqlStorage.html index bc0ca3b3c..e5e88746b 100644 --- a/hotshot_query_service/data_source/sql/struct.SqlDataSource.html +++ b/hotshot_query_service/data_source/storage/sql/struct.SqlStorage.html @@ -1,358 +1,139 @@ -SqlDataSource in hotshot_query_service::data_source::sql - Rust
pub struct SqlDataSource<Types>where
-    Types: NodeType,{ /* private fields */ }
Expand description

A data source for the APIs provided in this crate, backed by a remote PostgreSQL database.

-

Administration

-

This data source will automatically connect to and perform queries on a remote SQL database. -However, administration of the database, such as initialization, resetting, and backups, is -left out of the scope of this implementation, and is expected to be performed manually using -off-the-shelf DBMS adminstration tools. The one exception is migrations, which are handled -transparently by the SqlDataSource.

-

Schema

-

All the objects created and used by SqlDataSource are grouped under a schema for easy -management. By default, the schema is named hotshot, and is created the first time a -SqlDataSource is constructed. The name of the schema can be configured by setting -Config::schema.

-

Initialization

-

When creating a SqlDataSource, the caller can use Config to specify the host, user, and -database to connect to. As such, SqlDataSource is not very opinionated about how the -Postgres instance is set up. The administrator must simply ensure that there is a database -dedicated to the SqlDataSource and a user with appropriate permissions (all on SCHEMA and -all on DATABASE) over that database.

-

Here is an example of how a sufficient database could be initialized. When using the standard -postgres Docker image, these statements could be placed in -/docker-entrypoint-initdb.d/init.sql to automatically initialize the database upon startup.

-
CREATE DATABASE hotshot_query_service;
-\connect hotshot_query_service;
-CREATE USER hotshot_user WITH PASSWORD 'password';
-GRANT ALL ON SCHEMA public TO hotshot_user;
-GRANT ALL ON DATABASE hotshot_query_service TO hotshot_user WITH GRANT OPTION;
-
-

One could then connect to this database with the following Config:

- -
Config::default()
-    .host("postgres.database.hostname")
-    .database("hotshot_query_service")
-    .user("hotshot_user")
-    .password("password")
-

Resetting

-

In general, resetting the database when necessary is left up to the administrator. However, for -convenience, we do provide a reset_schema option which can be used to -wipe out existing state and create a fresh instance of the query service. This is particularly -useful for development and staging environments. This function will permanently delete all -tables associated with the schema used by this query service, but will not reset other schemas -or database.

-

Migrations

-

For the SqlDataSource to work, the database must be initialized with the appropriate schema, -and the schema must be kept up to date when deploying a new version of this software which -depends on a different schema. Both of these tasks are accomplished via migrations.

-

Each release of this software is bundled with a sequence of migration files: one migration for -each release that changed the schema, including the latest one. Replaying these SQL files -against a database with an older version of the schema, including a completely empty database, -will bring it up to date with the schema required by this version of the software. Upon creating -an instance of SqlDataSource and connecting to a database, the data source will -automatically fetch the current version from the database and, if it is old, replay the -necessary migration files.

-

Custom Migrations

-

In keeping with the philosophy of this crate, SqlDataSource is designed to be -extensible and composable. When extending the provided APIs with -new, application-specific queries, it will often be desirable to alter the schema of the -database in some way, such as adding additional columns to some of the tables or creating new -indices. When composing the provided APIs with additional API modules, it may also be desirable -to alter the schema, although the changes are more likely to be completely independent of the -schema used by this data source, such as adding entirely new tables.

-

In either case, the default schema can be modified by inserting additional migrations between -the migrations distributed with this crate. The new migrations will then automatically be -replayed as necessary when initializing a SqlDataSource. New custom migrations can be -added with each software update, to keep the custom data up to date as the default schema -changes.

-

Custom migrations can be inserted using Config::migrations. Each custom migration will be -inserted into the overall sequence of migrations in order of version number. The migrations -provided by this crate only use version numbers which are multiples of 10, so the non-multiples -can be used to insert custom migrations between the default migrations. You can also replace a -default migration completely by providing a custom migration with the same version number. This -may be useful when an earlier custom migration has altered the schema in such a way that a later -migration no longer works as-is. However, this technique is error prone and should be used only -when necessary.

-

When using custom migrations, it is the user’s responsibility to ensure that the resulting -schema is compatible with the schema expected by SqlDataSource. Adding things (tables, -columns, indices) should usually be safe. Removing, altering, or renaming things should be done -with extreme caution.

-

It is standard to store custom migrations as SQL files in a sub-directory of the crate. For ease -of release and deploymenet, such directories can be embedded into a Rust binary and parsed into -a list of Migration objects using the include_migrations macro.

-

It is also possible to take complete control over migrating the schema using -Config::no_migrations to prevent the SqlDataSource from running its own migrations. The -database administrator then becomes responsible for manually migrating the database, ensuring the -schema is up to date, and ensuring that the schema is at all times compatible with the schema -expected by the current version of this software. Nevertheless, this may be the best option when -your application-specific schema has diverged significantly from the default schema.

-

Synchronization

-

SqlDataSource implements VersionedDataSource, which means changes are not applied to the -underlying database with every operation. Instead, outstanding changes are batched and applied -all at once, atomically, whenever commit is called. Outstanding, uncommitted -changes can also be rolled back completely using revert.

-

Internally, the data source maintains an open Transaction whenever there are outstanding -changes, and commits the transaction on commit. The underlying database -transaction can be accessed directly via transaction, which makes it -possible to compose application-specific database updates atomically with updates made by the -SqlDataSource itself. This is useful for extension and -composition.

-

Extension and Composition

-

SqlDataSource is designed to be both extensible (so you can add additional state to the API -modules defined in this crate) and composable (so you can use SqlDataSource as one component -of a larger state type for an application with additional modules).

-

Extension

-

It is possible to add additional, application-specific state to SqlDataSource. If the new -state should live in memory, simply wrap the SqlDataSource in an -ExtensibleDataSource:

- -
type AppState = &'static str;
-
-let data_source: ExtensibleDataSource<SqlDataSource<AppTypes>, AppState> =
-    ExtensibleDataSource::new(SqlDataSource::connect(config).await?, "app state");
-

The ExtensibleDataSource wrapper implements all the same data -source traits as SqlDataSource, and also provides access to the AppState parameter for use -in API endpoint handlers. This can be used to implement an app-specific data source trait and -add a new API endpoint that uses this app-specific data, as described in the -extension guide.

-

If the new application-specific state should live in the SQL database itself, the implementation -is more involved, but still possible. Follow the steps for -custom migrations to modify the database schema to account for the new -data you want to store. You can then access this data through the SqlDataSource using -query to run a custom read-only SQL query or transaction -to execute a custom atomic mutation of the database. If you use -transaction, be sure to call commit when you are ready -to persist your changes.

-

You will typically use query to read custom data in API endpoint handlers and -transaction to populate custom data in your web server’s update loop.

-

Composition

-

Composing SqlDataSource with other module states is fairly simple – just -create an aggregate struct containing both SqlDataSource and your additional module -states, as described in the composition guide. If the additional modules -have data that should live in the same database as the SqlDataSource data, you can follow -the steps in custom migrations to accomodate this. When modifying that -data, you can use transaction to atomically synchronize updates to the -other modules’ data with updates to the SqlDataSource. If the additional data is completely -independent of HotShot query service data and does not need to be synchronized, you can also -connect to the database directly to make updates.

-

In the following example, we compose HotShot query service modules with other application- -specific modules, synchronizing updates using transaction.

- -
struct AppState {
-    hotshot_qs: SqlDataSource<AppTypes>,
-    // additional state for other modules
-}
-
-async fn init_server(
-    config: Config,
-    mut hotshot: SystemContextHandle<AppTypes, AppNodeImpl>,
-) -> Result<App<Arc<RwLock<AppState>>, Error>, Error> {
-    let mut hotshot_qs = SqlDataSource::connect(config).await.map_err(Error::internal)?;
-    // Initialize storage for other modules, using `hotshot_qs` to access the database.
-    let tx = hotshot_qs.transaction().await.map_err(Error::internal)?;
-    // ...
-
-    let state = Arc::new(RwLock::new(AppState {
-        hotshot_qs,
-        // additional state for other modules
-    }));
-    let mut app = App::with_state(state.clone());
-    // Register API modules.
-
-    spawn(async move {
-        let mut events = hotshot.get_event_stream(Default::default()).await.0;
-        while let Some(event) = events.next().await {
-            let mut state = state.write().await;
-            UpdateDataSource::<AppTypes>::update(&mut state.hotshot_qs, &event)
-                .await
-                .unwrap();
-            // Update other modules' states based on `event`. Use `hotshot_qs` to include
-            // database updates in the same atomic transaction as `hotshot_qs.update`.
-            let tx = state.hotshot_qs.transaction().await.unwrap();
-
-            // Commit all outstanding changes to the entire state at the same time.
-            state.hotshot_qs.commit().await.unwrap();
-        }
-    });
-
-    Ok(app)
-}
-

Implementations§

source§

impl<Types> SqlDataSource<Types>where +SqlStorage in hotshot_query_service::data_source::storage::sql - Rust
pub struct SqlStorage { /* private fields */ }
Expand description

Storage for the APIs provided in this crate, backed by a remote PostgreSQL database.

+

Implementations§

source§

impl SqlStorage

source

pub async fn connect(config: Config) -> Result<Self, Error>

Connect to a remote database.

+
source§

impl SqlStorage

source

pub async fn transaction(&mut self) -> QueryResult<Transaction<'_>>

Access the transaction which is accumulating all uncommitted changes to the data source.

+

Trait Implementations§

source§

impl<Types> AvailabilityStorage<Types> for SqlStoragewhere Types: NodeType, - Payload<Types>: QueryablePayload,

source

pub async fn connect(config: Config) -> Result<Self, Error>

Connect to a remote database.

-
source§

impl<Types> SqlDataSource<Types>where - Types: NodeType,

source

pub async fn transaction(&mut self) -> QueryResult<Transaction<'_>>

Access the transaction which is accumulating all uncommitted changes to the data source.

-

This can be used to manually group database modifications to custom state atomically with -modifications made through the SqlDataSource.

-

If there is no currently open transaction, a new transaction will be opened. No changes -made through the transaction objeect returned by this method will be persisted until -commit is called.

-

Trait Implementations§

source§

impl<Types> AvailabilityDataSource<Types> for SqlDataSource<Types>where - Types: NodeType, - Payload<Types>: QueryablePayload,

§

type LeafStream = Pin<Box<dyn Stream<Item = Result<LeafQueryData<Types>, QueryError>> + Send>>

§

type BlockStream = Pin<Box<dyn Stream<Item = Result<BlockQueryData<Types>, QueryError>> + Send>>

§

type LeafRange<'a, R> = Pin<Box<dyn Stream<Item = Result<LeafQueryData<Types>, QueryError>> + Send>> -where - Self: 'a, - R: RangeBounds<usize> + Send

§

type BlockRange<'a, R> = Pin<Box<dyn Stream<Item = Result<BlockQueryData<Types>, QueryError>> + Send>> -where - Self: 'a, - R: RangeBounds<usize> + Send

source§

fn get_leaf<'life0, 'async_trait, ID>( + Payload<Types>: QueryablePayload,

source§

fn get_leaf<'life0, 'async_trait>( &'life0 self, - id: ID -) -> Pin<Box<dyn Future<Output = QueryResult<LeafQueryData<Types>>> + Send + 'async_trait>>where - ID: Into<LeafId<Types>> + Send + Sync + 'async_trait, + id: LeafId<Types> +) -> Pin<Box<dyn Future<Output = QueryResult<LeafQueryData<Types>>> + Send + 'async_trait>>where Self: 'async_trait, - 'life0: 'async_trait,

source§

fn get_block<'life0, 'async_trait, ID>( + 'life0: 'async_trait,

source§

fn get_block<'life0, 'async_trait>( &'life0 self, - id: ID -) -> Pin<Box<dyn Future<Output = QueryResult<BlockQueryData<Types>>> + Send + 'async_trait>>where - ID: Into<BlockId<Types>> + Send + Sync + 'async_trait, + id: BlockId<Types> +) -> Pin<Box<dyn Future<Output = QueryResult<BlockQueryData<Types>>> + Send + 'async_trait>>where Self: 'async_trait, - 'life0: 'async_trait,

source§

fn get_leaf_range<'life0, 'async_trait, R>( + 'life0: 'async_trait,

source§

fn get_leaf_range<'life0, 'async_trait, R>( &'life0 self, range: R -) -> Pin<Box<dyn Future<Output = QueryResult<Self::LeafRange<'_, R>>> + Send + 'async_trait>>where +) -> Pin<Box<dyn Future<Output = QueryResult<Vec<QueryResult<LeafQueryData<Types>>>>> + Send + 'async_trait>>where R: RangeBounds<usize> + Send + 'async_trait, Self: 'async_trait, - 'life0: 'async_trait,

source§

fn get_block_range<'life0, 'async_trait, R>( + 'life0: 'async_trait,

source§

fn get_block_range<'life0, 'async_trait, R>( &'life0 self, range: R -) -> Pin<Box<dyn Future<Output = QueryResult<Self::BlockRange<'_, R>>> + Send + 'async_trait>>where +) -> Pin<Box<dyn Future<Output = QueryResult<Vec<QueryResult<BlockQueryData<Types>>>>> + Send + 'async_trait>>where R: RangeBounds<usize> + Send + 'async_trait, Self: 'async_trait, - 'life0: 'async_trait,

source§

fn get_block_with_transaction<'life0, 'async_trait>( + 'life0: 'async_trait,

source§

fn get_block_with_transaction<'life0, 'async_trait>( &'life0 self, - hash: TransactionHash<Types> -) -> Pin<Box<dyn Future<Output = QueryResult<(BlockQueryData<Types>, TransactionIndex<Types>)>> + Send + 'async_trait>>where + hash: TransactionHash<Types> +) -> Pin<Box<dyn Future<Output = QueryResult<(BlockQueryData<Types>, TransactionIndex<Types>)>> + Send + 'async_trait>>where + Self: 'async_trait, + 'life0: 'async_trait,

source§

impl Debug for SqlStorage

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl Drop for SqlStorage

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl<Types> NodeDataSource<Types> for SqlStoragewhere + Types: NodeType,

source§

fn block_height<'life0, 'async_trait>( + &'life0 self +) -> Pin<Box<dyn Future<Output = QueryResult<usize>> + Send + 'async_trait>>where Self: 'async_trait, - 'life0: 'async_trait,

Returns the block containing a transaction with the given hash and the transaction’s -position in the block.
source§

fn get_proposals<'life0, 'life1, 'async_trait>( + 'life0: 'async_trait,

source§

fn get_proposals<'life0, 'life1, 'async_trait>( &'life0 self, - proposer: &'life1 SignatureKey<Types>, + proposer: &'life1 SignatureKey<Types>, limit: Option<usize> -) -> Pin<Box<dyn Future<Output = QueryResult<Vec<LeafQueryData<Types>>>> + Send + 'async_trait>>where +) -> Pin<Box<dyn Future<Output = QueryResult<Vec<LeafQueryData<Types>>>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, - 'life1: 'async_trait,

source§

fn count_proposals<'life0, 'life1, 'async_trait>( + 'life1: 'async_trait,

source§

fn count_proposals<'life0, 'life1, 'async_trait>( &'life0 self, - proposer: &'life1 SignatureKey<Types> -) -> Pin<Box<dyn Future<Output = QueryResult<usize>> + Send + 'async_trait>>where + proposer: &'life1 SignatureKey<Types> +) -> Pin<Box<dyn Future<Output = QueryResult<usize>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, - 'life1: 'async_trait,

source§

fn subscribe_leaves<'life0, 'async_trait>( - &'life0 self, - height: usize -) -> Pin<Box<dyn Future<Output = QueryResult<Self::LeafStream>> + Send + 'async_trait>>where - Self: 'async_trait, - 'life0: 'async_trait,

source§

fn subscribe_blocks<'life0, 'async_trait>( - &'life0 self, - height: usize -) -> Pin<Box<dyn Future<Output = QueryResult<Self::BlockStream>> + Send + 'async_trait>>where + 'life1: 'async_trait,

source§

impl Query for SqlStorage

source§

fn client<'life0, 'async_trait>( + &'life0 self +) -> Pin<Box<dyn Future<Output = Cow<'_, Arc<Client>>> + Send + 'async_trait>>where Self: 'async_trait, - 'life0: 'async_trait,

source§

impl<Types> Debug for SqlDataSource<Types>where - Types: NodeType + Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<Types> Drop for SqlDataSource<Types>where - Types: NodeType,

source§

fn drop(&mut self)

Executes the destructor for this type. Read more
source§

impl<Types> Query for SqlDataSource<Types>where - Types: NodeType,

source§

fn client(&self) -> &Client

source§

fn query<'life0, 'life1, 'async_trait, T, P>( + 'life0: 'async_trait,

source§

fn query<'life0, 'life1, 'async_trait, T, P>( &'life0 self, query: &'life1 T, params: P -) -> Pin<Box<dyn Future<Output = QueryResult<BoxStream<'static, QueryResult<Row>>>> + Send + 'async_trait>>where +) -> Pin<Box<dyn Future<Output = QueryResult<BoxStream<'static, QueryResult<Row>>>> + Send + 'async_trait>>where T: ?Sized + ToStatement + Sync + 'async_trait, P: IntoIterator + Send + 'async_trait, P::IntoIter: ExactSizeIterator, P::Item: BorrowToSql, Self: Sync + 'async_trait, 'life0: 'async_trait, - 'life1: 'async_trait,

source§

fn query_static<'life0, 'life1, 'async_trait, T>( + 'life1: 'async_trait,

source§

fn query_static<'life0, 'life1, 'async_trait, T>( &'life0 self, query: &'life1 T -) -> Pin<Box<dyn Future<Output = QueryResult<BoxStream<'static, QueryResult<Row>>>> + Send + 'async_trait>>where +) -> Pin<Box<dyn Future<Output = QueryResult<BoxStream<'static, QueryResult<Row>>>> + Send + 'async_trait>>where T: ?Sized + ToStatement + Sync + 'async_trait, Self: Sync + 'async_trait, 'life0: 'async_trait, - 'life1: 'async_trait,

Query the underlying SQL database with no parameters.
source§

fn query_one<'life0, 'life1, 'async_trait, T, P>( + 'life1: 'async_trait,

Query the underlying SQL database with no parameters.
source§

fn query_one<'life0, 'life1, 'async_trait, T, P>( &'life0 self, query: &'life1 T, params: P -) -> Pin<Box<dyn Future<Output = QueryResult<Row>> + Send + 'async_trait>>where +) -> Pin<Box<dyn Future<Output = QueryResult<Row>> + Send + 'async_trait>>where T: ?Sized + ToStatement + Sync + 'async_trait, P: IntoIterator + Send + 'async_trait, P::IntoIter: ExactSizeIterator, P::Item: BorrowToSql, Self: Sync + 'async_trait, 'life0: 'async_trait, - 'life1: 'async_trait,

Query the underlying SQL database, returning exactly one result or failing.
source§

fn query_one_static<'life0, 'life1, 'async_trait, T>( + 'life1: 'async_trait,

Query the underlying SQL database, returning exactly one result or failing.
source§

fn query_one_static<'life0, 'life1, 'async_trait, T>( &'life0 self, query: &'life1 T -) -> Pin<Box<dyn Future<Output = QueryResult<Row>> + Send + 'async_trait>>where +) -> Pin<Box<dyn Future<Output = QueryResult<Row>> + Send + 'async_trait>>where T: ?Sized + ToStatement + Sync + 'async_trait, Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Query the underlying SQL database with no parameters, returning exactly one result or -failing.
source§

fn query_opt<'life0, 'life1, 'async_trait, T, P>( +failing.

source§

fn query_opt<'life0, 'life1, 'async_trait, T, P>( &'life0 self, query: &'life1 T, params: P -) -> Pin<Box<dyn Future<Output = QueryResult<Option<Row>>> + Send + 'async_trait>>where +) -> Pin<Box<dyn Future<Output = QueryResult<Option<Row>>> + Send + 'async_trait>>where T: ?Sized + ToStatement + Sync + 'async_trait, P: IntoIterator + Send + 'async_trait, P::IntoIter: ExactSizeIterator, P::Item: BorrowToSql, Self: Sync + 'async_trait, 'life0: 'async_trait, - 'life1: 'async_trait,

Query the underlying SQL database, returning zero or one results.
source§

fn query_opt_static<'life0, 'life1, 'async_trait, T>( + 'life1: 'async_trait,

Query the underlying SQL database, returning zero or one results.
source§

fn query_opt_static<'life0, 'life1, 'async_trait, T>( &'life0 self, query: &'life1 T -) -> Pin<Box<dyn Future<Output = QueryResult<Option<Row>>> + Send + 'async_trait>>where +) -> Pin<Box<dyn Future<Output = QueryResult<Option<Row>>> + Send + 'async_trait>>where T: ?Sized + ToStatement + Sync + 'async_trait, Self: Sync + 'async_trait, 'life0: 'async_trait, - 'life1: 'async_trait,

Query the underlying SQL database with no parameters, returning zero or one results.

source§

impl<Types> StatusDataSource for SqlDataSource<Types>where - Types: NodeType,

source§

fn block_height<'life0, 'async_trait>( - &'life0 self -) -> Pin<Box<dyn Future<Output = QueryResult<usize>> + Send + 'async_trait>>where - Self: 'async_trait, - 'life0: 'async_trait,

source§

fn metrics(&self) -> &PrometheusMetrics

source§

fn consensus_metrics(&self) -> QueryResult<PrometheusMetrics>

source§

fn mempool_info<'life0, 'async_trait>( - &'life0 self -) -> Pin<Box<dyn Future<Output = QueryResult<MempoolQueryData>> + Send + 'async_trait>>where - Self: Sync + 'async_trait, - 'life0: 'async_trait,

source§

fn success_rate<'life0, 'async_trait>( - &'life0 self -) -> Pin<Box<dyn Future<Output = QueryResult<f64>> + Send + 'async_trait>>where - Self: Sync + 'async_trait, - 'life0: 'async_trait,

source§

impl<Types> UpdateAvailabilityData<Types> for SqlDataSource<Types>where + 'life1: 'async_trait,

Query the underlying SQL database with no parameters, returning zero or one results.

source§

impl<Types> UpdateAvailabilityData<Types> for SqlStoragewhere Types: NodeType, - Payload<Types>: QueryablePayload,

§

type Error = QueryError

source§

fn insert_leaf<'life0, 'async_trait>( + Payload<Types>: QueryablePayload,

§

type Error = QueryError

source§

fn insert_leaf<'life0, 'async_trait>( &'life0 mut self, - leaf: LeafQueryData<Types> -) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where + leaf: LeafQueryData<Types> +) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where Self: 'async_trait, - 'life0: 'async_trait,

source§

fn insert_block<'life0, 'async_trait>( + 'life0: 'async_trait,

source§

fn insert_block<'life0, 'async_trait>( &'life0 mut self, - block: BlockQueryData<Types> -) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where + block: BlockQueryData<Types> +) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where Self: 'async_trait, - 'life0: 'async_trait,

source§

impl<Types> VersionedDataSource for SqlDataSource<Types>where - Types: NodeType,

source§

fn commit<'life0, 'async_trait>( + 'life0: 'async_trait,

source§

impl<Types> UpdateNodeData<Types> for SqlStoragewhere + Types: NodeType,

§

type Error = QueryError

source§

fn insert_leaf<'life0, 'async_trait>( + &'life0 mut self, + _leaf: LeafQueryData<Types> +) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where + Self: 'async_trait, + 'life0: 'async_trait,

source§

impl VersionedDataSource for SqlStorage

§

type Error = Error

source§

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

Atomically commit to all outstanding modifications to the data.

-

If this method fails, outstanding changes are left unmodified. The caller may opt to retry -or to erase outstanding changes with revert.

-
source§

fn revert<'life0, 'async_trait>( + 'life0: 'async_trait,

Atomically commit to all outstanding modifications to the data. Read more
source§

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

Erase all oustanding modifications to the data.

-

This function must not return if it has failed to revert changes. Inability to revert -changes to the database is considered a fatal error, and this function may panic.

-
§

type Error = Error

Auto Trait Implementations§

§

impl<Types> !RefUnwindSafe for SqlDataSource<Types>

§

impl<Types> Send for SqlDataSource<Types>

§

impl<Types> Sync for SqlDataSource<Types>

§

impl<Types> Unpin for SqlDataSource<Types>where - Types: Unpin, - <Types as NodeType>::BlockHeader: Unpin, - <Types as NodeType>::BlockPayload: Unpin, - <<Types as NodeType>::SignatureKey as SignatureKey>::QCType: Unpin, - <Types as NodeType>::SignatureKey: Unpin, - <Types as NodeType>::Time: Unpin, - <Types as NodeType>::Transaction: Unpin,

§

impl<Types> !UnwindSafe for SqlDataSource<Types>

Blanket Implementations§

source§

impl<T> Any for Twhere + 'life0: 'async_trait,

Erase all oustanding modifications to the data. Read more

Auto Trait Implementations§

§

impl !RefUnwindSafe for SqlStorage

§

impl Send for SqlStorage

§

impl Sync for SqlStorage

§

impl Unpin for SqlStorage

§

impl !UnwindSafe for SqlStorage

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere T: 'a,

§

fn implicit( @@ -470,17 +251,8 @@

Composition

T: ?Sized,
Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
§

impl<T> TryConv for T

§

fn try_conv<T>(self) -> Result<T, Self::Error>where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. Read more
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

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 Twhere - U: TryFrom<T>,

§

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<Types, T> UpdateDataSource<Types> for Twhere - Types: NodeType, - T: UpdateAvailabilityData<Types> + UpdateStatusData + Send,

source§

fn update<'life0, 'life1, 'async_trait>( - &'life0 mut self, - event: &'life1 Event<Types> -) -> Pin<Box<dyn Future<Output = Result<(), <T as UpdateAvailabilityData<Types>>::Error>> + Send + 'async_trait>>where - 'life0: 'async_trait, - 'life1: 'async_trait, - T: 'async_trait,

Update query state based on a new consensus event. Read more
source§

impl<T> UpdateStatusData for Twhere - T: StatusDataSource,

source§

fn populate_metrics(&self) -> Box<dyn Metrics>

§

impl<V, T> VZip<V> for Twhere + U: Into<T>,

§

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 Twhere + U: TryFrom<T>,

§

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.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V

§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a diff --git a/hotshot_query_service/data_source/sql/struct.Transaction.html b/hotshot_query_service/data_source/storage/sql/struct.Transaction.html similarity index 85% rename from hotshot_query_service/data_source/sql/struct.Transaction.html rename to hotshot_query_service/data_source/storage/sql/struct.Transaction.html index 2a2a41f36..a8195a16e 100644 --- a/hotshot_query_service/data_source/sql/struct.Transaction.html +++ b/hotshot_query_service/data_source/storage/sql/struct.Transaction.html @@ -1,80 +1,84 @@ -Transaction in hotshot_query_service::data_source::sql - Rust
pub struct Transaction<'a> { /* private fields */ }
Expand description

An atomic SQL transaction.

-

Implementations§

source§

impl<'a> Transaction<'a>

source

pub async fn execute<T, P>( +Transaction in hotshot_query_service::data_source::storage::sql - Rust
pub struct Transaction<'a> { /* private fields */ }
Expand description

An atomic SQL transaction.

+

Implementations§

source§

impl<'a> Transaction<'a>

source

pub async fn execute<T, P>( &mut self, statement: &T, params: P -) -> QueryResult<()>where +) -> QueryResult<()>where T: ?Sized + ToStatement, P: IntoIterator, P::IntoIter: ExactSizeIterator, P::Item: BorrowToSql,

Execute a statement against the underlying database.

The results of the statement will be reflected immediately in future statements made within this transaction, but will not be reflected in the underlying database until the transaction -is committed with SqlDataSource::commit.

-
source

pub async fn execute_many<S, T, P>(&mut self, statements: S) -> QueryResult<()>where +is committed with commit.

+

source

pub async fn execute_many<S, T, P>(&mut self, statements: S) -> QueryResult<()>where S: IntoIterator<Item = (T, P)>, T: ToStatement, P: IntoIterator, P::IntoIter: ExactSizeIterator, - P::Item: BorrowToSql,

Trait Implementations§

source§

impl<'a> Query for Transaction<'a>

Query the underlying SQL database.

+ P::Item: BorrowToSql,

Trait Implementations§

source§

impl<'a> Query for Transaction<'a>

Query the underlying SQL database.

The results will reflect the state after the statements thus far added to this transaction have been applied, even though those effects have not been committed to the database yet.

-
source§

fn client(&self) -> &Client

source§

fn query<'life0, 'life1, 'async_trait, T, P>( +

source§

fn client<'life0, 'async_trait>( + &'life0 self +) -> Pin<Box<dyn Future<Output = Cow<'_, Arc<Client>>> + Send + 'async_trait>>where + Self: 'async_trait, + 'life0: 'async_trait,

source§

fn query<'life0, 'life1, 'async_trait, T, P>( &'life0 self, query: &'life1 T, params: P -) -> Pin<Box<dyn Future<Output = QueryResult<BoxStream<'static, QueryResult<Row>>>> + Send + 'async_trait>>where +) -> Pin<Box<dyn Future<Output = QueryResult<BoxStream<'static, QueryResult<Row>>>> + Send + 'async_trait>>where T: ?Sized + ToStatement + Sync + 'async_trait, P: IntoIterator + Send + 'async_trait, P::IntoIter: ExactSizeIterator, P::Item: BorrowToSql, Self: Sync + 'async_trait, 'life0: 'async_trait, - 'life1: 'async_trait,

source§

fn query_static<'life0, 'life1, 'async_trait, T>( + 'life1: 'async_trait,

source§

fn query_static<'life0, 'life1, 'async_trait, T>( &'life0 self, query: &'life1 T -) -> Pin<Box<dyn Future<Output = QueryResult<BoxStream<'static, QueryResult<Row>>>> + Send + 'async_trait>>where +) -> Pin<Box<dyn Future<Output = QueryResult<BoxStream<'static, QueryResult<Row>>>> + Send + 'async_trait>>where T: ?Sized + ToStatement + Sync + 'async_trait, Self: Sync + 'async_trait, 'life0: 'async_trait, - 'life1: 'async_trait,

Query the underlying SQL database with no parameters.
source§

fn query_one<'life0, 'life1, 'async_trait, T, P>( + 'life1: 'async_trait,

Query the underlying SQL database with no parameters.
source§

fn query_one<'life0, 'life1, 'async_trait, T, P>( &'life0 self, query: &'life1 T, params: P -) -> Pin<Box<dyn Future<Output = QueryResult<Row>> + Send + 'async_trait>>where +) -> Pin<Box<dyn Future<Output = QueryResult<Row>> + Send + 'async_trait>>where T: ?Sized + ToStatement + Sync + 'async_trait, P: IntoIterator + Send + 'async_trait, P::IntoIter: ExactSizeIterator, P::Item: BorrowToSql, Self: Sync + 'async_trait, 'life0: 'async_trait, - 'life1: 'async_trait,

Query the underlying SQL database, returning exactly one result or failing.
source§

fn query_one_static<'life0, 'life1, 'async_trait, T>( + 'life1: 'async_trait,

Query the underlying SQL database, returning exactly one result or failing.
source§

fn query_one_static<'life0, 'life1, 'async_trait, T>( &'life0 self, query: &'life1 T -) -> Pin<Box<dyn Future<Output = QueryResult<Row>> + Send + 'async_trait>>where +) -> Pin<Box<dyn Future<Output = QueryResult<Row>> + Send + 'async_trait>>where T: ?Sized + ToStatement + Sync + 'async_trait, Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Query the underlying SQL database with no parameters, returning exactly one result or -failing.
source§

fn query_opt<'life0, 'life1, 'async_trait, T, P>( +failing.

source§

fn query_opt<'life0, 'life1, 'async_trait, T, P>( &'life0 self, query: &'life1 T, params: P -) -> Pin<Box<dyn Future<Output = QueryResult<Option<Row>>> + Send + 'async_trait>>where +) -> Pin<Box<dyn Future<Output = QueryResult<Option<Row>>> + Send + 'async_trait>>where T: ?Sized + ToStatement + Sync + 'async_trait, P: IntoIterator + Send + 'async_trait, P::IntoIter: ExactSizeIterator, P::Item: BorrowToSql, Self: Sync + 'async_trait, 'life0: 'async_trait, - 'life1: 'async_trait,

Query the underlying SQL database, returning zero or one results.
source§

fn query_opt_static<'life0, 'life1, 'async_trait, T>( + 'life1: 'async_trait,

Query the underlying SQL database, returning zero or one results.
source§

fn query_opt_static<'life0, 'life1, 'async_trait, T>( &'life0 self, query: &'life1 T -) -> Pin<Box<dyn Future<Output = QueryResult<Option<Row>>> + Send + 'async_trait>>where +) -> Pin<Box<dyn Future<Output = QueryResult<Option<Row>>> + Send + 'async_trait>>where T: ?Sized + ToStatement + Sync + 'async_trait, Self: Sync + 'async_trait, 'life0: 'async_trait, - 'life1: 'async_trait,

Query the underlying SQL database with no parameters, returning zero or one results.

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for Transaction<'a>

§

impl<'a> Send for Transaction<'a>

§

impl<'a> Sync for Transaction<'a>

§

impl<'a> Unpin for Transaction<'a>

§

impl<'a> !UnwindSafe for Transaction<'a>

Blanket Implementations§

source§

impl<T> Any for Twhere + 'life1: 'async_trait,

Query the underlying SQL database with no parameters, returning zero or one results.

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for Transaction<'a>

§

impl<'a> Send for Transaction<'a>

§

impl<'a> Sync for Transaction<'a>

§

impl<'a> Unpin for Transaction<'a>

§

impl<'a> !UnwindSafe for Transaction<'a>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere T: 'a,

§

fn implicit( diff --git a/hotshot_query_service/data_source/sql/trait.Query.html b/hotshot_query_service/data_source/storage/sql/trait.Query.html similarity index 60% rename from hotshot_query_service/data_source/sql/trait.Query.html rename to hotshot_query_service/data_source/storage/sql/trait.Query.html index 775d317cd..cf00e9978 100644 --- a/hotshot_query_service/data_source/sql/trait.Query.html +++ b/hotshot_query_service/data_source/storage/sql/trait.Query.html @@ -1,13 +1,17 @@ -Query in hotshot_query_service::data_source::sql - Rust
pub trait Query {
+Query in hotshot_query_service::data_source::storage::sql - Rust
pub trait Query {
     // Required method
-    fn client(&self) -> &Client;
+    fn client<'life0, 'async_trait>(
+        &'life0 self
+    ) -> Pin<Box<dyn Future<Output = Cow<'_, Arc<Client>>> + Send + 'async_trait>>
+       where Self: 'async_trait,
+             'life0: 'async_trait;
 
     // Provided methods
     fn query<'life0, 'life1, 'async_trait, T, P>(
         &'life0 self,
         query: &'life1 T,
         params: P
-    ) -> Pin<Box<dyn Future<Output = QueryResult<BoxStream<'static, QueryResult<Row>>>> + Send + 'async_trait>>
+    ) -> Pin<Box<dyn Future<Output = QueryResult<BoxStream<'static, QueryResult<Row>>>> + Send + 'async_trait>>
        where T: ?Sized + ToStatement + Sync + 'async_trait,
              P: IntoIterator + Send + 'async_trait,
              P::IntoIter: ExactSizeIterator,
@@ -18,7 +22,7 @@
     fn query_static<'life0, 'life1, 'async_trait, T>(
         &'life0 self,
         query: &'life1 T
-    ) -> Pin<Box<dyn Future<Output = QueryResult<BoxStream<'static, QueryResult<Row>>>> + Send + 'async_trait>>
+    ) -> Pin<Box<dyn Future<Output = QueryResult<BoxStream<'static, QueryResult<Row>>>> + Send + 'async_trait>>
        where T: ?Sized + ToStatement + Sync + 'async_trait,
              Self: Sync + 'async_trait,
              'life0: 'async_trait,
@@ -27,7 +31,7 @@
         &'life0 self,
         query: &'life1 T,
         params: P
-    ) -> Pin<Box<dyn Future<Output = QueryResult<Row>> + Send + 'async_trait>>
+    ) -> Pin<Box<dyn Future<Output = QueryResult<Row>> + Send + 'async_trait>>
        where T: ?Sized + ToStatement + Sync + 'async_trait,
              P: IntoIterator + Send + 'async_trait,
              P::IntoIter: ExactSizeIterator,
@@ -38,7 +42,7 @@
     fn query_one_static<'life0, 'life1, 'async_trait, T>(
         &'life0 self,
         query: &'life1 T
-    ) -> Pin<Box<dyn Future<Output = QueryResult<Row>> + Send + 'async_trait>>
+    ) -> Pin<Box<dyn Future<Output = QueryResult<Row>> + Send + 'async_trait>>
        where T: ?Sized + ToStatement + Sync + 'async_trait,
              Self: Sync + 'async_trait,
              'life0: 'async_trait,
@@ -47,7 +51,7 @@
         &'life0 self,
         query: &'life1 T,
         params: P
-    ) -> Pin<Box<dyn Future<Output = QueryResult<Option<Row>>> + Send + 'async_trait>>
+    ) -> Pin<Box<dyn Future<Output = QueryResult<Option<Row>>> + Send + 'async_trait>>
        where T: ?Sized + ToStatement + Sync + 'async_trait,
              P: IntoIterator + Send + 'async_trait,
              P::IntoIter: ExactSizeIterator,
@@ -58,35 +62,39 @@
     fn query_opt_static<'life0, 'life1, 'async_trait, T>(
         &'life0 self,
         query: &'life1 T
-    ) -> Pin<Box<dyn Future<Output = QueryResult<Option<Row>>> + Send + 'async_trait>>
+    ) -> Pin<Box<dyn Future<Output = QueryResult<Option<Row>>> + Send + 'async_trait>>
        where T: ?Sized + ToStatement + Sync + 'async_trait,
              Self: Sync + 'async_trait,
              'life0: 'async_trait,
              'life1: 'async_trait { ... }
-}

Required Methods§

source

fn client(&self) -> &Client

Provided Methods§

source

fn query<'life0, 'life1, 'async_trait, T, P>( +}

Required Methods§

source

fn client<'life0, 'async_trait>( + &'life0 self +) -> Pin<Box<dyn Future<Output = Cow<'_, Arc<Client>>> + Send + 'async_trait>>where + Self: 'async_trait, + 'life0: 'async_trait,

Provided Methods§

source

fn query<'life0, 'life1, 'async_trait, T, P>( &'life0 self, query: &'life1 T, params: P -) -> Pin<Box<dyn Future<Output = QueryResult<BoxStream<'static, QueryResult<Row>>>> + Send + 'async_trait>>where +) -> Pin<Box<dyn Future<Output = QueryResult<BoxStream<'static, QueryResult<Row>>>> + Send + 'async_trait>>where T: ?Sized + ToStatement + Sync + 'async_trait, P: IntoIterator + Send + 'async_trait, P::IntoIter: ExactSizeIterator, P::Item: BorrowToSql, Self: Sync + 'async_trait, 'life0: 'async_trait, - 'life1: 'async_trait,

source

fn query_static<'life0, 'life1, 'async_trait, T>( + 'life1: 'async_trait,

source

fn query_static<'life0, 'life1, 'async_trait, T>( &'life0 self, query: &'life1 T -) -> Pin<Box<dyn Future<Output = QueryResult<BoxStream<'static, QueryResult<Row>>>> + Send + 'async_trait>>where +) -> Pin<Box<dyn Future<Output = QueryResult<BoxStream<'static, QueryResult<Row>>>> + Send + 'async_trait>>where T: ?Sized + ToStatement + Sync + 'async_trait, Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Query the underlying SQL database with no parameters.

-
source

fn query_one<'life0, 'life1, 'async_trait, T, P>( +

source

fn query_one<'life0, 'life1, 'async_trait, T, P>( &'life0 self, query: &'life1 T, params: P -) -> Pin<Box<dyn Future<Output = QueryResult<Row>> + Send + 'async_trait>>where +) -> Pin<Box<dyn Future<Output = QueryResult<Row>> + Send + 'async_trait>>where T: ?Sized + ToStatement + Sync + 'async_trait, P: IntoIterator + Send + 'async_trait, P::IntoIter: ExactSizeIterator, @@ -94,20 +102,20 @@ Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Query the underlying SQL database, returning exactly one result or failing.

-
source

fn query_one_static<'life0, 'life1, 'async_trait, T>( +

source

fn query_one_static<'life0, 'life1, 'async_trait, T>( &'life0 self, query: &'life1 T -) -> Pin<Box<dyn Future<Output = QueryResult<Row>> + Send + 'async_trait>>where +) -> Pin<Box<dyn Future<Output = QueryResult<Row>> + Send + 'async_trait>>where T: ?Sized + ToStatement + Sync + 'async_trait, Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Query the underlying SQL database with no parameters, returning exactly one result or failing.

-
source

fn query_opt<'life0, 'life1, 'async_trait, T, P>( +

source

fn query_opt<'life0, 'life1, 'async_trait, T, P>( &'life0 self, query: &'life1 T, params: P -) -> Pin<Box<dyn Future<Output = QueryResult<Option<Row>>> + Send + 'async_trait>>where +) -> Pin<Box<dyn Future<Output = QueryResult<Option<Row>>> + Send + 'async_trait>>where T: ?Sized + ToStatement + Sync + 'async_trait, P: IntoIterator + Send + 'async_trait, P::IntoIter: ExactSizeIterator, @@ -115,16 +123,16 @@ Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Query the underlying SQL database, returning zero or one results.

-
source

fn query_opt_static<'life0, 'life1, 'async_trait, T>( +

source

fn query_opt_static<'life0, 'life1, 'async_trait, T>( &'life0 self, query: &'life1 T -) -> Pin<Box<dyn Future<Output = QueryResult<Option<Row>>> + Send + 'async_trait>>where +) -> Pin<Box<dyn Future<Output = QueryResult<Option<Row>>> + Send + 'async_trait>>where T: ?Sized + ToStatement + Sync + 'async_trait, Self: Sync + 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

Query the underlying SQL database with no parameters, returning zero or one results.

-

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<'a> Query for Transaction<'a>

Query the underlying SQL database.

+

Object Safety§

This trait is not object safe.

Implementors§

source§

impl Query for SqlStorage

source§

impl<'a> Query for Transaction<'a>

Query the underlying SQL database.

The results will reflect the state after the statements thus far added to this transaction have been applied, even though those effects have not been committed to the database yet.

-
source§

impl<Types> Query for SqlDataSource<Types>where - Types: NodeType,

\ No newline at end of file +
source§

impl<Types> Query for SqlDataSource<Types>where + Types: NodeType,

\ No newline at end of file diff --git a/hotshot_query_service/data_source/storage/trait.AvailabilityStorage.html b/hotshot_query_service/data_source/storage/trait.AvailabilityStorage.html new file mode 100644 index 000000000..670f67b8a --- /dev/null +++ b/hotshot_query_service/data_source/storage/trait.AvailabilityStorage.html @@ -0,0 +1,79 @@ +AvailabilityStorage in hotshot_query_service::data_source::storage - Rust
pub trait AvailabilityStorage<Types>: UpdateAvailabilityData<Types> + Send + Syncwhere
+    Types: NodeType,
+    Payload<Types>: QueryablePayload,{
+    // Required methods
+    fn get_leaf<'life0, 'async_trait>(
+        &'life0 self,
+        id: LeafId<Types>
+    ) -> Pin<Box<dyn Future<Output = QueryResult<LeafQueryData<Types>>> + Send + 'async_trait>>
+       where Self: 'async_trait,
+             'life0: 'async_trait;
+    fn get_block<'life0, 'async_trait>(
+        &'life0 self,
+        id: BlockId<Types>
+    ) -> Pin<Box<dyn Future<Output = QueryResult<BlockQueryData<Types>>> + Send + 'async_trait>>
+       where Self: 'async_trait,
+             'life0: 'async_trait;
+    fn get_leaf_range<'life0, 'async_trait, R>(
+        &'life0 self,
+        range: R
+    ) -> Pin<Box<dyn Future<Output = QueryResult<Vec<QueryResult<LeafQueryData<Types>>>>> + Send + 'async_trait>>
+       where R: RangeBounds<usize> + Send + 'static + 'async_trait,
+             Self: 'async_trait,
+             'life0: 'async_trait;
+    fn get_block_range<'life0, 'async_trait, R>(
+        &'life0 self,
+        range: R
+    ) -> Pin<Box<dyn Future<Output = QueryResult<Vec<QueryResult<BlockQueryData<Types>>>>> + Send + 'async_trait>>
+       where R: RangeBounds<usize> + Send + 'static + 'async_trait,
+             Self: 'async_trait,
+             'life0: 'async_trait;
+    fn get_block_with_transaction<'life0, 'async_trait>(
+        &'life0 self,
+        hash: TransactionHash<Types>
+    ) -> Pin<Box<dyn Future<Output = QueryResult<(BlockQueryData<Types>, TransactionIndex<Types>)>> + Send + 'async_trait>>
+       where Self: 'async_trait,
+             'life0: 'async_trait;
+}
Expand description

Persistent storage for a HotShot blockchain.

+

This trait defines the interface which must be provided by the storage layer in order to +implement an availability data source. It is very similar to +AvailabilityDataSource with every occurrence of +Fetch replaced by QueryResult. This is not a coincidence. +The purpose of the storage layer is to provide all of the functionality of the data source +layer, but independent of an external fetcher for missing data. Thus, when the storage layer +encounters missing, corrupt, or inaccessible data, it simply gives up and replaces the missing +data with Err, rather than creating an asynchronous fetch request to retrieve the missing +data.

+

Rust gives us ways to abstract and deduplicate these two similar APIs, but they do not lead to a +better interface.

+

Required Methods§

source

fn get_leaf<'life0, 'async_trait>( + &'life0 self, + id: LeafId<Types> +) -> Pin<Box<dyn Future<Output = QueryResult<LeafQueryData<Types>>> + Send + 'async_trait>>where + Self: 'async_trait, + 'life0: 'async_trait,

source

fn get_block<'life0, 'async_trait>( + &'life0 self, + id: BlockId<Types> +) -> Pin<Box<dyn Future<Output = QueryResult<BlockQueryData<Types>>> + Send + 'async_trait>>where + Self: 'async_trait, + 'life0: 'async_trait,

source

fn get_leaf_range<'life0, 'async_trait, R>( + &'life0 self, + range: R +) -> Pin<Box<dyn Future<Output = QueryResult<Vec<QueryResult<LeafQueryData<Types>>>>> + Send + 'async_trait>>where + R: RangeBounds<usize> + Send + 'static + 'async_trait, + Self: 'async_trait, + 'life0: 'async_trait,

source

fn get_block_range<'life0, 'async_trait, R>( + &'life0 self, + range: R +) -> Pin<Box<dyn Future<Output = QueryResult<Vec<QueryResult<BlockQueryData<Types>>>>> + Send + 'async_trait>>where + R: RangeBounds<usize> + Send + 'static + 'async_trait, + Self: 'async_trait, + 'life0: 'async_trait,

source

fn get_block_with_transaction<'life0, 'async_trait>( + &'life0 self, + hash: TransactionHash<Types> +) -> Pin<Box<dyn Future<Output = QueryResult<(BlockQueryData<Types>, TransactionIndex<Types>)>> + Send + 'async_trait>>where + Self: 'async_trait, + 'life0: 'async_trait,

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<Types> AvailabilityStorage<Types> for SqlStoragewhere + Types: NodeType, + Payload<Types>: QueryablePayload,

source§

impl<Types: NodeType> AvailabilityStorage<Types> for FileSystemStorage<Types>where + Payload<Types>: QueryablePayload,

\ No newline at end of file diff --git a/hotshot_query_service/data_source/struct.ExtensibleDataSource.html b/hotshot_query_service/data_source/struct.ExtensibleDataSource.html index 3b0501296..697b9c3f2 100644 --- a/hotshot_query_service/data_source/struct.ExtensibleDataSource.html +++ b/hotshot_query_service/data_source/struct.ExtensibleDataSource.html @@ -1,4 +1,4 @@ -ExtensibleDataSource in hotshot_query_service::data_source - Rust
pub struct ExtensibleDataSource<D, U> { /* private fields */ }
Expand description

Wrapper to add extensibility to an existing data source.

+ExtensibleDataSource in hotshot_query_service::data_source - Rust
pub struct ExtensibleDataSource<D, U> { /* private fields */ }
Expand description

Wrapper to add extensibility to an existing data source.

ExtensibleDataSource adds app-specific data to any existing data source. It implements all the data source traits defined in this crate as long as the underlying data source does so, which means it can be used as state for instantiating the APIs defined in this crate. At the @@ -21,84 +21,89 @@ self.as_ref().get(&utxo).cloned() } }

-

Implementations§

source§

impl<D, U> ExtensibleDataSource<D, U>

source

pub fn new(data_source: D, user_data: U) -> Self

source

pub fn inner(&self) -> &D

Access the underlying data source.

+

Implementations§

source§

impl<D, U> ExtensibleDataSource<D, U>

source

pub fn new(data_source: D, user_data: U) -> Self

source

pub fn inner(&self) -> &D

Access the underlying data source.

This functionality is provided as an inherent method rather than an implementation of the AsRef trait so that self.as_ref() unambiguously returns &U, helping with type inference.

-
source

pub fn inner_mut(&mut self) -> &mut D

Mutably access the underlying data source.

+
source

pub fn inner_mut(&mut self) -> &mut D

Mutably access the underlying data source.

This functionality is provided as an inherent method rather than an implementation of the AsMut trait so that self.as_mut() unambiguously returns &U, helping with type inference.

-

Trait Implementations§

source§

impl<D, U> AsMut<U> for ExtensibleDataSource<D, U>

source§

fn as_mut(&mut self) -> &mut U

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<D, U> AsRef<U> for ExtensibleDataSource<D, U>

source§

fn as_ref(&self) -> &U

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<D, U, Types> AvailabilityDataSource<Types> for ExtensibleDataSource<D, U>where +

Trait Implementations§

source§

impl<D, U> AsMut<U> for ExtensibleDataSource<D, U>

source§

fn as_mut(&mut self) -> &mut U

Converts this type into a mutable reference of the (usually inferred) input type.
source§

impl<D, U> AsRef<U> for ExtensibleDataSource<D, U>

source§

fn as_ref(&self) -> &U

Converts this type into a shared reference of the (usually inferred) input type.
source§

impl<D, U, Types> AvailabilityDataSource<Types> for ExtensibleDataSource<D, U>where D: AvailabilityDataSource<Types> + Send + Sync, U: Send + Sync, Types: NodeType, - Payload<Types>: QueryablePayload,

§

type LeafStream = <D as AvailabilityDataSource<Types>>::LeafStream

§

type BlockStream = <D as AvailabilityDataSource<Types>>::BlockStream

§

type LeafRange<'a, R> = <D as AvailabilityDataSource<Types>>::LeafRange<'a, R> + Payload<Types>: QueryablePayload,

§

type LeafRange<R> = <D as AvailabilityDataSource<Types>>::LeafRange<R> where - Self: 'a, - R: RangeBounds<usize> + Send

§

type BlockRange<'a, R> = <D as AvailabilityDataSource<Types>>::BlockRange<'a, R> + R: RangeBounds<usize> + Send

§

type BlockRange<R> = <D as AvailabilityDataSource<Types>>::BlockRange<R> where - Self: 'a, - R: RangeBounds<usize> + Send

source§

fn get_leaf<'life0, 'async_trait, ID>( + R: RangeBounds<usize> + Send

source§

fn get_leaf<'life0, 'async_trait, ID>( &'life0 self, id: ID -) -> Pin<Box<dyn Future<Output = QueryResult<LeafQueryData<Types>>> + Send + 'async_trait>>where +) -> Pin<Box<dyn Future<Output = Fetch<LeafQueryData<Types>>> + Send + 'async_trait>>where ID: Into<LeafId<Types>> + Send + Sync + 'async_trait, Self: 'async_trait, - 'life0: 'async_trait,

source§

fn get_block<'life0, 'async_trait, ID>( + 'life0: 'async_trait,

source§

fn get_block<'life0, 'async_trait, ID>( &'life0 self, id: ID -) -> Pin<Box<dyn Future<Output = QueryResult<BlockQueryData<Types>>> + Send + 'async_trait>>where +) -> Pin<Box<dyn Future<Output = Fetch<BlockQueryData<Types>>> + Send + 'async_trait>>where ID: Into<BlockId<Types>> + Send + Sync + 'async_trait, Self: 'async_trait, - 'life0: 'async_trait,

source§

fn get_leaf_range<'life0, 'async_trait, R>( + 'life0: 'async_trait,

source§

fn get_leaf_range<'life0, 'async_trait, R>( &'life0 self, range: R -) -> Pin<Box<dyn Future<Output = QueryResult<Self::LeafRange<'_, R>>> + Send + 'async_trait>>where - R: RangeBounds<usize> + Send + 'async_trait, +) -> Pin<Box<dyn Future<Output = Self::LeafRange<R>> + Send + 'async_trait>>where + R: RangeBounds<usize> + Send + 'static + 'async_trait, Self: 'async_trait, - 'life0: 'async_trait,

source§

fn get_block_range<'life0, 'async_trait, R>( + 'life0: 'async_trait,

source§

fn get_block_range<'life0, 'async_trait, R>( &'life0 self, range: R -) -> Pin<Box<dyn Future<Output = QueryResult<Self::BlockRange<'_, R>>> + Send + 'async_trait>>where - R: RangeBounds<usize> + Send + 'async_trait, +) -> Pin<Box<dyn Future<Output = Self::BlockRange<R>> + Send + 'async_trait>>where + R: RangeBounds<usize> + Send + 'static + 'async_trait, Self: 'async_trait, - 'life0: 'async_trait,

source§

fn get_block_with_transaction<'life0, 'async_trait>( + 'life0: 'async_trait,

source§

fn get_block_with_transaction<'life0, 'async_trait>( &'life0 self, hash: TransactionHash<Types> -) -> Pin<Box<dyn Future<Output = QueryResult<(BlockQueryData<Types>, TransactionIndex<Types>)>> + Send + 'async_trait>>where +) -> Pin<Box<dyn Future<Output = Fetch<(BlockQueryData<Types>, TransactionIndex<Types>)>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Returns the block containing a transaction with the given hash and the transaction’s -position in the block.
source§

fn get_proposals<'life0, 'life1, 'async_trait>( +position in the block.

source§

fn subscribe_blocks<'life0, 'async_trait>( + &'life0 self, + from: usize +) -> Pin<Box<dyn Future<Output = BoxStream<'static, BlockQueryData<Types>>> + Send + 'async_trait>>where + Self: Sync + 'async_trait, + 'life0: 'async_trait,

source§

fn subscribe_leaves<'life0, 'async_trait>( + &'life0 self, + from: usize +) -> Pin<Box<dyn Future<Output = BoxStream<'static, LeafQueryData<Types>>> + Send + 'async_trait>>where + Self: Sync + 'async_trait, + 'life0: 'async_trait,

source§

impl<D: Clone, U: Clone> Clone for ExtensibleDataSource<D, U>

source§

fn clone(&self) -> ExtensibleDataSource<D, U>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<D: Debug, U: Debug> Debug for ExtensibleDataSource<D, U>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<D, U, Types> NodeDataSource<Types> for ExtensibleDataSource<D, U>where + D: NodeDataSource<Types> + Send + Sync, + U: Send + Sync, + Types: NodeType,

source§

fn block_height<'life0, 'async_trait>( + &'life0 self +) -> Pin<Box<dyn Future<Output = QueryResult<usize>> + Send + 'async_trait>>where + Self: 'async_trait, + 'life0: 'async_trait,

source§

fn get_proposals<'life0, 'life1, 'async_trait>( &'life0 self, proposer: &'life1 SignatureKey<Types>, limit: Option<usize> ) -> Pin<Box<dyn Future<Output = QueryResult<Vec<LeafQueryData<Types>>>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, - 'life1: 'async_trait,

source§

fn count_proposals<'life0, 'life1, 'async_trait>( + 'life1: 'async_trait,

source§

fn count_proposals<'life0, 'life1, 'async_trait>( &'life0 self, proposer: &'life1 SignatureKey<Types> ) -> Pin<Box<dyn Future<Output = QueryResult<usize>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, - 'life1: 'async_trait,

source§

fn subscribe_leaves<'life0, 'async_trait>( - &'life0 self, - height: usize -) -> Pin<Box<dyn Future<Output = QueryResult<Self::LeafStream>> + Send + 'async_trait>>where - Self: 'async_trait, - 'life0: 'async_trait,

source§

fn subscribe_blocks<'life0, 'async_trait>( - &'life0 self, - height: usize -) -> Pin<Box<dyn Future<Output = QueryResult<Self::BlockStream>> + Send + 'async_trait>>where - Self: 'async_trait, - 'life0: 'async_trait,

source§

impl<D: Clone, U: Clone> Clone for ExtensibleDataSource<D, U>

source§

fn clone(&self) -> ExtensibleDataSource<D, U>

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<D: Debug, U: Debug> Debug for ExtensibleDataSource<D, U>

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<D, U> StatusDataSource for ExtensibleDataSource<D, U>where + 'life1: 'async_trait,

source§

impl<D, U> StatusDataSource for ExtensibleDataSource<D, U>where D: StatusDataSource + Send + Sync, - U: Send + Sync,

source§

fn block_height<'life0, 'async_trait>( + U: Send + Sync,

source§

fn block_height<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = QueryResult<usize>> + Send + 'async_trait>>where Self: 'async_trait, - 'life0: 'async_trait,

source§

fn metrics(&self) -> &PrometheusMetrics

source§

fn consensus_metrics(&self) -> QueryResult<PrometheusMetrics>

source§

fn mempool_info<'life0, 'async_trait>( + 'life0: 'async_trait,

source§

fn metrics(&self) -> &PrometheusMetrics

source§

fn consensus_metrics(&self) -> QueryResult<PrometheusMetrics>

source§

fn mempool_info<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = QueryResult<MempoolQueryData>> + Send + 'async_trait>>where Self: Sync + 'async_trait, @@ -106,30 +111,38 @@ &'life0 self ) -> Pin<Box<dyn Future<Output = QueryResult<f64>> + Send + 'async_trait>>where Self: Sync + 'async_trait, - 'life0: 'async_trait,

source§

impl<D, U, Types> UpdateAvailabilityData<Types> for ExtensibleDataSource<D, U>where + 'life0: 'async_trait,

source§

impl<D, U, Types> UpdateAvailabilityData<Types> for ExtensibleDataSource<D, U>where D: UpdateAvailabilityData<Types> + Send + Sync, U: Send + Sync, - Types: NodeType,

§

type Error = <D as UpdateAvailabilityData<Types>>::Error

source§

fn insert_leaf<'life0, 'async_trait>( + Types: NodeType,

§

type Error = <D as UpdateAvailabilityData<Types>>::Error

source§

fn insert_leaf<'life0, 'async_trait>( &'life0 mut self, leaf: LeafQueryData<Types> ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where Self: 'async_trait, - 'life0: 'async_trait,

source§

fn insert_block<'life0, 'async_trait>( + 'life0: 'async_trait,

source§

fn insert_block<'life0, 'async_trait>( &'life0 mut self, block: BlockQueryData<Types> ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where Self: 'async_trait, - 'life0: 'async_trait,

source§

impl<D, U> VersionedDataSource for ExtensibleDataSource<D, U>where + 'life0: 'async_trait,

source§

impl<D, U, Types> UpdateNodeData<Types> for ExtensibleDataSource<D, U>where + D: UpdateNodeData<Types> + Send + Sync, + U: Send + Sync, + Types: NodeType,

§

type Error = <D as UpdateNodeData<Types>>::Error

source§

fn insert_leaf<'life0, 'async_trait>( + &'life0 mut self, + leaf: LeafQueryData<Types> +) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where + Self: 'async_trait, + 'life0: 'async_trait,

source§

impl<D, U> VersionedDataSource for ExtensibleDataSource<D, U>where D: VersionedDataSource + Send, - U: Send,

§

type Error = <D as VersionedDataSource>::Error

source§

fn commit<'life0, 'async_trait>( + U: Send,

§

type Error = <D as VersionedDataSource>::Error

source§

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

Atomically commit to all outstanding modifications to the data. Read more
source§

fn revert<'life0, 'async_trait>( + 'life0: 'async_trait,

Atomically commit to all outstanding modifications to the data. Read more
source§

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

Erase all oustanding modifications to the data. Read more
source§

impl<D: Copy, U: Copy> Copy for ExtensibleDataSource<D, U>

Auto Trait Implementations§

§

impl<D, U> RefUnwindSafe for ExtensibleDataSource<D, U>where + 'life0: 'async_trait,

Erase all oustanding modifications to the data. Read more
source§

impl<D: Copy, U: Copy> Copy for ExtensibleDataSource<D, U>

Auto Trait Implementations§

§

impl<D, U> RefUnwindSafe for ExtensibleDataSource<D, U>where D: RefUnwindSafe, U: RefUnwindSafe,

§

impl<D, U> Send for ExtensibleDataSource<D, U>where D: Send, @@ -275,10 +288,10 @@ letters are used (e.g. F9B4CA)

source§

impl<T> ToOwned for Twhere T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

impl<T> TryConv for T

§

fn try_conv<T>(self) -> Result<T, Self::Error>where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. Read more
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

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 Twhere - U: TryFrom<T>,

§

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<Types, T> UpdateDataSource<Types> for Twhere + U: Into<T>,

§

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 Twhere + U: TryFrom<T>,

§

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<Types, T> UpdateDataSource<Types> for Twhere Types: NodeType, - T: UpdateAvailabilityData<Types> + UpdateStatusData + Send,

source§

fn update<'life0, 'life1, 'async_trait>( + T: UpdateAvailabilityData<Types> + UpdateNodeData<Types, Error = <T as UpdateAvailabilityData<Types>>::Error> + UpdateStatusData + Send,

source§

fn update<'life0, 'life1, 'async_trait>( &'life0 mut self, event: &'life1 Event<Types> ) -> Pin<Box<dyn Future<Output = Result<(), <T as UpdateAvailabilityData<Types>>::Error>> + Send + 'async_trait>>where diff --git a/hotshot_query_service/data_source/struct.FileSystemDataSource.html b/hotshot_query_service/data_source/struct.FetchingDataSource.html similarity index 62% rename from hotshot_query_service/data_source/struct.FileSystemDataSource.html rename to hotshot_query_service/data_source/struct.FetchingDataSource.html index 761c91a1b..e3b3d31c3 100644 --- a/hotshot_query_service/data_source/struct.FileSystemDataSource.html +++ b/hotshot_query_service/data_source/struct.FetchingDataSource.html @@ -1,192 +1,144 @@ -FileSystemDataSource in hotshot_query_service::data_source - Rust
pub struct FileSystemDataSource<Types: NodeType>where
-    Payload<Types>: QueryablePayload,{ /* private fields */ }
Expand description

A data source for the APIs provided in this crate, backed by the local file system.

-

Synchronization and atomicity of persisted data structures are provided via [atomic_store]. -The methods commit, revert, and -skip_version of this type can be used to control synchronization in the -underlying [AtomicStore].

-

Extension and Composition

-

FileSystemDataSource is designed to be both extensible (so you can add additional state to -the API modules defined in this crate) and composable (so you can use FileSystemDataSource -as one component of a larger state type for an application with additional modules).

-

Extension

-

Adding additional, application-specific state to FileSystemDataSource is possible by -wrapping it in ExtensibleDataSource:

- -
type AppState = &'static str;
-
-let data_source: ExtensibleDataSource<FileSystemDataSource<AppTypes>, AppState> =
-    ExtensibleDataSource::new(FileSystemDataSource::create(storage_path).await?, "app state");
-

The ExtensibleDataSource wrapper implements all the same data -source traits as FileSystemDataSource, and also provides access to the AppState parameter -for use in API endpoint handlers. This can be used to implement an app-specific data source -trait and add a new API endpoint that uses this app-specific data, as described in the -extension guide.

-

Composition

-

Composing FileSystemDataSource with other module states is in principle simple – just -create an aggregate struct containing both FileSystemDataSource and your additional module -states. A complication arises from how persistent storage is managed: if other modules have -their own persistent state, should the storage of FileSystemDataSource and the other modules -be completely independent, or synchronized under the control of a single [AtomicStore]? -FileSystemDataSource supports both patterns: when you create it with -create or open, it will open its own [AtomicStore] and -manage the synchronization of its own storage, independent of any other persistent data it might -be composed with. But when you create it with create_with_store or -open_with_store, you may ask it to register its persistent data -structures with an existing [AtomicStoreLoader]. If you register other modules’ persistent -data structures with the same loader, you can create one [AtomicStore] that synchronizes all -the persistent data. Note, though, that when you choose to use -create_with_store or open_with_store, -you become responsible for ensuring that calls to [AtomicStore::commit_version] alternate with -calls to FileSystemDataSource::commit or FileSystemDataSource::revert.

-

In the following example, we compose HotShot query service modules with other application- -specific modules, using a single top-level [AtomicStore] to synchronize all persistent -storage.

- -
struct AppState {
-    // Top-level storage coordinator
-    store: AtomicStore,
-    hotshot_qs: FileSystemDataSource<AppTypes>,
-    // additional state for other modules
-}
-
-async fn init_server(
-    storage_path: &Path,
-    mut hotshot: SystemContextHandle<AppTypes, AppNodeImpl>,
-) -> Result<App<Arc<RwLock<AppState>>, Error>, Error> {
-    let mut loader = AtomicStoreLoader::create(storage_path, "my_app") // or `open`
-        .map_err(Error::internal)?;
-    let hotshot_qs = FileSystemDataSource::create_with_store(&mut loader)
-        .await
-        .map_err(Error::internal)?;
-    // Initialize storage for other modules using the same loader.
-
-    let store = AtomicStore::open(loader).map_err(Error::internal)?;
-    let state = Arc::new(RwLock::new(AppState {
-        store,
-        hotshot_qs,
-        // additional state for other modules
-    }));
-    let mut app = App::with_state(state.clone());
-    // Register API modules.
-
-    spawn(async move {
-        let mut events = hotshot.get_event_stream(Default::default()).await.0;
-        while let Some(event) = events.next().await {
-            let mut state = state.write().await;
-            state.hotshot_qs.update(&event).await.unwrap();
-            // Update other modules' states based on `event`.
-
-            state.hotshot_qs.commit().await.unwrap();
-            // Commit or skip versions for other modules' storage.
-            state.store.commit_version().unwrap();
-        }
-    });
-
-    Ok(app)
-}
-

Implementations§

source§

impl<Types: NodeType> FileSystemDataSource<Types>where - Payload<Types>: QueryablePayload,

source

pub async fn create(path: &Path) -> Result<Self, PersistenceError>

Create a new FileSystemDataSource with storage at path.

+FetchingDataSource in hotshot_query_service::data_source - Rust
pub struct FetchingDataSource<Types, S, P>where
+    Types: NodeType,{ /* private fields */ }
Expand description

The most basic kind of data source.

+

A data source is constructed modularly by combining a storage implementation +with a fetcher. The former allows the query service to store the data it has +persistently in an easily accessible storage medium, such as the local file system or a +database. This allows it to answer queries efficiently and to maintain its state across +restarts. The latter allows the query service to fetch data that is missing from its storage +from an external data availability provider, such as the Tiramisu DA network or another instance +of the query service.

+

These two components of a data source are combined in FetchingDataSource, which is the +lowest level kind of data source available. It simply uses the storage implementation to fetch +data when available, and fills in everything else using the fetcher. Various kinds of data +sources can be constructed out of FetchingDataSource by changing the storage and fetcher +implementations used, and more complex data sources can be built on top using data source +combinators.

+

Implementations§

source§

impl<Types, S, P> FetchingDataSource<Types, S, P>where + Types: NodeType, + Payload<Types>: QueryablePayload, + S: NodeDataSource<Types> + UpdateNodeData<Types> + AvailabilityStorage<Types> + VersionedDataSource, + P: Send + Sync,

source

pub async fn new(storage: S, provider: P) -> Result<Self>

Create a data source with local storage and a remote data availability provider.

+
source§

impl<Types, S, P> FetchingDataSource<Types, S, P>where + Types: NodeType,

source

pub async fn storage(&self) -> StorageReadGuard<'_, Types, S>

Obtain direct, read-only access to the underlying local storage.

+
source

pub async fn storage_mut(&self) -> StorageWriteGuard<'_, Types, S>

Obtain direct, mutable access the underlying local storage.

+
source§

impl<Types: NodeType> FetchingDataSource<Types, FileSystemStorage<Types>, ()>where + Payload<Types>: QueryablePayload,

source

pub async fn create(path: &Path) -> Result<Self>

Create a new FileSystemDataSource with storage at path.

If there is already data at path, it will be archived.

-

The FileSystemDataSource will manage its own persistence synchronization.

-
source

pub async fn open(path: &Path) -> Result<Self, PersistenceError>

Open an existing FileSystemDataSource from storage at path.

+

The FileSystemDataSource will manage its own persistence synchronization.

+
source

pub async fn open(path: &Path) -> Result<Self>

Open an existing FileSystemDataSource from storage at path.

If there is no data at path, a new store will be created.

-

The FileSystemDataSource will manage its own persistence synchronization.

-
source

pub async fn create_with_store( - loader: &mut AtomicStoreLoader -) -> Result<Self, PersistenceError>

Create a new FileSystemDataSource using a persistent storage loader.

-

If there is existing data corresponding to the FileSystemDataSource data structures, it +

The FileSystemDataSource will manage its own persistence synchronization.

+
source

pub async fn create_with_store(loader: &mut AtomicStoreLoader) -> Result<Self>

Create a new FileSystemDataSource using a persistent storage loader.

+

If there is existing data corresponding to the FileSystemDataSource data structures, it will be archived.

-

The FileSystemDataSource will register its persistent data structures with loader. The -caller is responsible for creating an [AtomicStore] from loader and managing -synchronization of the store.

-
source

pub async fn open_with_store( - loader: &mut AtomicStoreLoader -) -> Result<Self, PersistenceError>

Open an existing FileSystemDataSource using a persistent storage loader.

-

If there is no existing data corresponding to the FileSystemDataSource data structures, a +

The FileSystemDataSource will register its persistent data structures with loader. The +caller is responsible for creating an AtomicStore from loader +and managing synchronization of the store.

+
source

pub async fn open_with_store(loader: &mut AtomicStoreLoader) -> Result<Self>

Open an existing FileSystemDataSource using a persistent storage loader.

+

If there is no existing data corresponding to the FileSystemDataSource data structures, a new store will be created.

-

The FileSystemDataSource will register its persistent data structures with loader. The -caller is responsible for creating an [AtomicStore] from loader and managing -synchronization of the store.

-
source

pub fn skip_version(&mut self) -> Result<(), PersistenceError>

Advance the version of the persistent store without committing changes to persistent state.

-

This function is useful when the [AtomicStore] synchronizing storage for this -FileSystemDataSource is being managed by the caller. The caller may want to persist some -changes to other modules whose state is managed by the same [AtomicStore]. In order to call -[AtomicStore::commit_version], the version of this FileSystemDataSource must be advanced, -either by commit or, if there are no outstanding changes, -skip_version.

-

Trait Implementations§

source§

impl<Types: NodeType> AvailabilityDataSource<Types> for FileSystemDataSource<Types>where - Payload<Types>: QueryablePayload,

§

type LeafStream = Pin<Box<dyn Stream<Item = Result<LeafQueryData<Types>, QueryError>> + Send>>

§

type BlockStream = Pin<Box<dyn Stream<Item = Result<BlockQueryData<Types>, QueryError>> + Send>>

§

type LeafRange<'a, R> = Pin<Box<dyn Stream<Item = Result<LeafQueryData<Types>, QueryError>> + Send + 'a>> +

The FileSystemDataSource will register its persistent data structures with loader. The +caller is responsible for creating an AtomicStore from loader +and managing synchronization of the store.

+

source

pub async fn skip_version(&mut self) -> Result<()>

Advance the version of the persistent store without committing changes to persistent state.

+

This function is useful when the AtomicStore synchronizing +storage for this FileSystemDataSource is being managed by the caller. The caller may want +to persist some changes to other modules whose state is managed by the same +AtomicStore. In order to call +AtomicStore::commit_version, the version of +this FileSystemDataSource must be advanced, either by +commit or, if there are no outstanding changes, +skip_version.

+
source§

impl<Types> FetchingDataSource<Types, SqlStorage, ()>where + Types: NodeType, + Payload<Types>: QueryablePayload,

source

pub async fn connect(config: Config) -> Result<Self, Error>

Connect to a remote database.

+
source§

impl<Types> FetchingDataSource<Types, SqlStorage, ()>where + Types: NodeType,

source

pub async fn transaction(&mut self) -> QueryResult<Transaction<'_>>

Access the transaction which is accumulating all uncommitted changes to the data source.

+

This can be used to manually group database modifications to custom state atomically with +modifications made through the SqlDataSource.

+

If there is no currently open transaction, a new transaction will be opened. No changes +made through the transaction objeect returned by this method will be persisted until +commit is called.

+

Trait Implementations§

source§

impl<Types, S, P> AvailabilityDataSource<Types> for FetchingDataSource<Types, S, P>where + Types: NodeType, + Payload<Types>: QueryablePayload, + S: AvailabilityStorage<Types> + 'static, + P: Send + Sync + 'static,

§

type LeafRange<R> = Pin<Box<dyn Stream<Item = Fetch<LeafQueryData<Types>>> + Send>> where - Self: 'a, - R: RangeBounds<usize> + Send

§

type BlockRange<'a, R> = Pin<Box<dyn Stream<Item = Result<BlockQueryData<Types>, QueryError>> + Send + 'a>> + R: RangeBounds<usize> + Send

§

type BlockRange<R> = Pin<Box<dyn Stream<Item = Fetch<BlockQueryData<Types>>> + Send>> where - Self: 'a, - R: RangeBounds<usize> + Send

source§

fn get_leaf<'life0, 'async_trait, ID>( + R: RangeBounds<usize> + Send

source§

fn get_leaf<'life0, 'async_trait, ID>( &'life0 self, id: ID -) -> Pin<Box<dyn Future<Output = QueryResult<LeafQueryData<Types>>> + Send + 'async_trait>>where +) -> Pin<Box<dyn Future<Output = Fetch<LeafQueryData<Types>>> + Send + 'async_trait>>where ID: Into<LeafId<Types>> + Send + Sync + 'async_trait, Self: 'async_trait, - 'life0: 'async_trait,

source§

fn get_block<'life0, 'async_trait, ID>( + 'life0: 'async_trait,

source§

fn get_block<'life0, 'async_trait, ID>( &'life0 self, id: ID -) -> Pin<Box<dyn Future<Output = QueryResult<BlockQueryData<Types>>> + Send + 'async_trait>>where +) -> Pin<Box<dyn Future<Output = Fetch<BlockQueryData<Types>>> + Send + 'async_trait>>where ID: Into<BlockId<Types>> + Send + Sync + 'async_trait, Self: 'async_trait, - 'life0: 'async_trait,

source§

fn get_leaf_range<'life0, 'async_trait, R>( + 'life0: 'async_trait,

source§

fn get_leaf_range<'life0, 'async_trait, R>( &'life0 self, range: R -) -> Pin<Box<dyn Future<Output = QueryResult<Self::LeafRange<'_, R>>> + Send + 'async_trait>>where - R: RangeBounds<usize> + Send + 'async_trait, +) -> Pin<Box<dyn Future<Output = Self::LeafRange<R>> + Send + 'async_trait>>where + R: RangeBounds<usize> + Send + 'static + 'async_trait, Self: 'async_trait, - 'life0: 'async_trait,

source§

fn get_block_range<'life0, 'async_trait, R>( + 'life0: 'async_trait,

source§

fn get_block_range<'life0, 'async_trait, R>( &'life0 self, range: R -) -> Pin<Box<dyn Future<Output = QueryResult<Self::BlockRange<'_, R>>> + Send + 'async_trait>>where - R: RangeBounds<usize> + Send + 'async_trait, +) -> Pin<Box<dyn Future<Output = Self::BlockRange<R>> + Send + 'async_trait>>where + R: RangeBounds<usize> + Send + 'static + 'async_trait, Self: 'async_trait, - 'life0: 'async_trait,

source§

fn get_block_with_transaction<'life0, 'async_trait>( + 'life0: 'async_trait,

source§

fn get_block_with_transaction<'life0, 'async_trait>( &'life0 self, hash: TransactionHash<Types> -) -> Pin<Box<dyn Future<Output = QueryResult<(BlockQueryData<Types>, TransactionIndex<Types>)>> + Send + 'async_trait>>where +) -> Pin<Box<dyn Future<Output = Fetch<(BlockQueryData<Types>, TransactionIndex<Types>)>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait,

Returns the block containing a transaction with the given hash and the transaction’s -position in the block.
source§

fn get_proposals<'life0, 'life1, 'async_trait>( +position in the block.

source§

fn subscribe_blocks<'life0, 'async_trait>( + &'life0 self, + from: usize +) -> Pin<Box<dyn Future<Output = BoxStream<'static, BlockQueryData<Types>>> + Send + 'async_trait>>where + Self: Sync + 'async_trait, + 'life0: 'async_trait,

source§

fn subscribe_leaves<'life0, 'async_trait>( + &'life0 self, + from: usize +) -> Pin<Box<dyn Future<Output = BoxStream<'static, LeafQueryData<Types>>> + Send + 'async_trait>>where + Self: Sync + 'async_trait, + 'life0: 'async_trait,

source§

impl<Types, S, P> Clone for FetchingDataSource<Types, S, P>where + Types: NodeType,

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<Types, S, P> Debug for FetchingDataSource<Types, S, P>where + Types: NodeType, + S: Debug, + P: Debug,

source§

fn fmt(&self, __f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<Types, S, P> NodeDataSource<Types> for FetchingDataSource<Types, S, P>where + Types: NodeType, + S: NodeDataSource<Types> + Send + Sync, + P: Send + Sync,

source§

fn block_height<'life0, 'async_trait>( + &'life0 self +) -> Pin<Box<dyn Future<Output = QueryResult<usize>> + Send + 'async_trait>>where + Self: 'async_trait, + 'life0: 'async_trait,

source§

fn get_proposals<'life0, 'life1, 'async_trait>( &'life0 self, - id: &'life1 SignatureKey<Types>, + proposer: &'life1 SignatureKey<Types>, limit: Option<usize> ) -> Pin<Box<dyn Future<Output = QueryResult<Vec<LeafQueryData<Types>>>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, - 'life1: 'async_trait,

source§

fn count_proposals<'life0, 'life1, 'async_trait>( + 'life1: 'async_trait,

source§

fn count_proposals<'life0, 'life1, 'async_trait>( &'life0 self, - id: &'life1 SignatureKey<Types> + proposer: &'life1 SignatureKey<Types> ) -> Pin<Box<dyn Future<Output = QueryResult<usize>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, - 'life1: 'async_trait,

source§

fn subscribe_leaves<'life0, 'async_trait>( - &'life0 self, - height: usize -) -> Pin<Box<dyn Future<Output = QueryResult<Self::LeafStream>> + Send + 'async_trait>>where - Self: 'async_trait, - 'life0: 'async_trait,

source§

fn subscribe_blocks<'life0, 'async_trait>( - &'life0 self, - height: usize -) -> Pin<Box<dyn Future<Output = QueryResult<Self::BlockStream>> + Send + 'async_trait>>where - Self: 'async_trait, - 'life0: 'async_trait,

source§

impl<Types: NodeType> Debug for FileSystemDataSource<Types>where - Payload<Types>: QueryablePayload, - HashMap<LeafHash<Types>, u64>: Debug, - HashMap<BlockHash<Types>, u64>: Debug, - HashMap<TransactionHash<Types>, (u64, TransactionIndex<Types>)>: Debug, - HashMap<SignatureKey<Types>, Vec<u64>>: Debug, - LedgerLog<LeafQueryData<Types>>: Debug, - LedgerLog<BlockQueryData<Types>>: Debug,

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl<Types: NodeType> StatusDataSource for FileSystemDataSource<Types>where - Payload<Types>: QueryablePayload,

source§

fn block_height<'life0, 'async_trait>( + 'life1: 'async_trait,

source§

impl<Types, S, P> StatusDataSource for FetchingDataSource<Types, S, P>where + Types: NodeType, + S: NodeDataSource<Types> + Send + Sync, + P: Send + Sync,

source§

fn block_height<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = QueryResult<usize>> + Send + 'async_trait>>where Self: 'async_trait, - 'life0: 'async_trait,

source§

fn metrics(&self) -> &PrometheusMetrics

source§

fn consensus_metrics(&self) -> QueryResult<PrometheusMetrics>

source§

fn mempool_info<'life0, 'async_trait>( + 'life0: 'async_trait,

source§

fn metrics(&self) -> &PrometheusMetrics

source§

fn consensus_metrics(&self) -> QueryResult<PrometheusMetrics>

source§

fn mempool_info<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = QueryResult<MempoolQueryData>> + Send + 'async_trait>>where Self: Sync + 'async_trait, @@ -194,42 +146,44 @@

Composition

&'life0 self ) -> Pin<Box<dyn Future<Output = QueryResult<f64>> + Send + 'async_trait>>where Self: Sync + 'async_trait, - 'life0: 'async_trait,

source§

impl<Types: NodeType> UpdateAvailabilityData<Types> for FileSystemDataSource<Types>where - Payload<Types>: QueryablePayload,

§

type Error = PersistenceError

source§

fn insert_leaf<'life0, 'async_trait>( + 'life0: 'async_trait,

source§

impl<Types, S, P> UpdateAvailabilityData<Types> for FetchingDataSource<Types, S, P>where + Types: NodeType, + Payload<Types>: QueryablePayload, + S: UpdateAvailabilityData<Types> + Send + Sync, + P: Send + Sync,

§

type Error = <S as UpdateAvailabilityData<Types>>::Error

source§

fn insert_leaf<'life0, 'async_trait>( &'life0 mut self, leaf: LeafQueryData<Types> ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where Self: 'async_trait, - 'life0: 'async_trait,

source§

fn insert_block<'life0, 'async_trait>( + 'life0: 'async_trait,

source§

fn insert_block<'life0, 'async_trait>( &'life0 mut self, block: BlockQueryData<Types> ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where Self: 'async_trait, - 'life0: 'async_trait,

source§

impl<Types: NodeType> VersionedDataSource for FileSystemDataSource<Types>where - Payload<Types>: QueryablePayload,

source§

fn commit<'life0, 'async_trait>( + 'life0: 'async_trait,

source§

impl<Types, S, P> UpdateNodeData<Types> for FetchingDataSource<Types, S, P>where + Types: NodeType, + S: UpdateNodeData<Types> + Send + Sync, + P: Send + Sync,

§

type Error = <S as UpdateNodeData<Types>>::Error

source§

fn insert_leaf<'life0, 'async_trait>( + &'life0 mut self, + leaf: LeafQueryData<Types> +) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where + Self: 'async_trait, + 'life0: 'async_trait,

source§

impl<Types, S, P> VersionedDataSource for FetchingDataSource<Types, S, P>where + Types: NodeType, + S: VersionedDataSource + Send + Sync, + P: Send + Sync,

§

type Error = <S as VersionedDataSource>::Error

source§

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

Commit the current state to persistent storage.

-

If the FileSystemDataSource is managing its own [AtomicStore] (i.e. it was created with -create or open) it will update the global version as well. -Otherwise, the caller is responsible for calling [AtomicStore::commit_version] after calling -this function.

-
source§

fn revert<'life0, 'async_trait>( + 'life0: 'async_trait,

Atomically commit to all outstanding modifications to the data. Read more
source§

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

Revert changes made to persistent storage since the last call to -commit.

-
§

type Error = PersistenceError

Auto Trait Implementations§

§

impl<Types> !RefUnwindSafe for FileSystemDataSource<Types>

§

impl<Types> Send for FileSystemDataSource<Types>

§

impl<Types> Sync for FileSystemDataSource<Types>

§

impl<Types> Unpin for FileSystemDataSource<Types>where - Types: Unpin, - <Types as NodeType>::BlockHeader: Unpin, - <Types as NodeType>::BlockPayload: Unpin, - <<Types as NodeType>::SignatureKey as SignatureKey>::QCType: Unpin, - <Types as NodeType>::SignatureKey: Unpin, - <Types as NodeType>::Time: Unpin, - <Types as NodeType>::Transaction: Unpin, - <<Types as NodeType>::BlockPayload as QueryablePayload>::TransactionIndex: Unpin,

§

impl<Types> !UnwindSafe for FileSystemDataSource<Types>

Blanket Implementations§

source§

impl<T> Any for Twhere + 'life0: 'async_trait,

Erase all oustanding modifications to the data. Read more

Auto Trait Implementations§

§

impl<Types, S, P> !RefUnwindSafe for FetchingDataSource<Types, S, P>

§

impl<Types, S, P> Send for FetchingDataSource<Types, S, P>where + P: Send + Sync, + S: Send + Sync,

§

impl<Types, S, P> Sync for FetchingDataSource<Types, S, P>where + P: Send + Sync, + S: Send + Sync,

§

impl<Types, S, P> Unpin for FetchingDataSource<Types, S, P>

§

impl<Types, S, P> !UnwindSafe for FetchingDataSource<Types, S, P>

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere T: 'a,

§

fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

§

impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere T: 'a,

§

fn implicit( @@ -247,7 +201,9 @@

Composition

generate &Any’s vtable from &Trait’s.
§

fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot generate &mut Any’s vtable from &mut Trait’s.
§

impl<T> DowncastSync for Twhere T: Any + Send + Sync,

§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be -further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
§

impl<T> FmtForward for T

§

fn fmt_binary(self) -> FmtBinary<Self>where +further downcast into Arc<ConcreteType> where ConcreteType implements Trait.

source§

impl<T> DynClone for Twhere + T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

source§

impl<T> DynClone for Twhere + T: Clone,

source§

fn __clone_box(&self, _: Private) -> *mut ()

§

impl<T> FmtForward for T

§

fn fmt_binary(self) -> FmtBinary<Self>where Self: Binary,

Causes self to use its Binary implementation when Debug-formatted.
§

fn fmt_display(self) -> FmtDisplay<Self>where Self: Display,

Causes self to use its Display implementation when Debug-formatted.
§

fn fmt_lower_exp(self) -> FmtLowerExp<Self>where @@ -345,12 +301,13 @@

Composition

builds.

§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Selfwhere Self: DerefMut<Target = T> + Deref, T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release -builds.
§

impl<T> TryConv for T

§

fn try_conv<T>(self) -> Result<T, Self::Error>where +builds.

source§

impl<T> ToOwned for Twhere + T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
§

impl<T> TryConv for T

§

fn try_conv<T>(self) -> Result<T, Self::Error>where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. Read more
source§

impl<T, U> TryFrom<U> for Twhere - U: Into<T>,

§

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 Twhere - U: TryFrom<T>,

§

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<Types, T> UpdateDataSource<Types> for Twhere + U: Into<T>,

§

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 Twhere + U: TryFrom<T>,

§

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<Types, T> UpdateDataSource<Types> for Twhere Types: NodeType, - T: UpdateAvailabilityData<Types> + UpdateStatusData + Send,

source§

fn update<'life0, 'life1, 'async_trait>( + T: UpdateAvailabilityData<Types> + UpdateNodeData<Types, Error = <T as UpdateAvailabilityData<Types>>::Error> + UpdateStatusData + Send,

source§

fn update<'life0, 'life1, 'async_trait>( &'life0 mut self, event: &'life1 Event<Types> ) -> Pin<Box<dyn Future<Output = Result<(), <T as UpdateAvailabilityData<Types>>::Error>> + Send + 'async_trait>>where @@ -364,4 +321,5 @@

Composition

[WithDispatch] wrapper. Read more

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
\ No newline at end of file +WithDispatch wrapper. Read more
§

impl<T> PassType for Twhere + T: Clone + Debug + Sync + Send + 'static,

\ No newline at end of file diff --git a/hotshot_query_service/data_source/struct.MetricsDataSource.html b/hotshot_query_service/data_source/struct.MetricsDataSource.html index cc094cc7c..33154c18f 100644 --- a/hotshot_query_service/data_source/struct.MetricsDataSource.html +++ b/hotshot_query_service/data_source/struct.MetricsDataSource.html @@ -6,7 +6,7 @@ availability API.

Since all the state required by MetricsDataSource is updated automatically by HotShot, there is no need to spawn an update loop to update the data source with new events, as is required -with full archival data sources like SqlDataSource. Instead, +with full archival data sources like SqlDataSource. Instead, MetricsDataSource will be populated with useful data as long as its populate_metrics is used to initialize HotShot:

diff --git a/hotshot_query_service/data_source/trait.UpdateDataSource.html b/hotshot_query_service/data_source/trait.UpdateDataSource.html index 83ef1e318..291de01ce 100644 --- a/hotshot_query_service/data_source/trait.UpdateDataSource.html +++ b/hotshot_query_service/data_source/trait.UpdateDataSource.html @@ -1,9 +1,9 @@ -UpdateDataSource in hotshot_query_service::data_source - Rust
pub trait UpdateDataSource<Types: NodeType>: UpdateAvailabilityData<Types> + UpdateStatusData {
+UpdateDataSource in hotshot_query_service::data_source - Rust
pub trait UpdateDataSource<Types: NodeType>: UpdateAvailabilityData<Types> + UpdateNodeData<Types, Error = <Self as UpdateAvailabilityData<Types>>::Error> + UpdateStatusData {
     // Required method
     fn update<'life0, 'life1, 'async_trait>(
         &'life0 mut self,
         event: &'life1 Event<Types>
-    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
+    ) -> Pin<Box<dyn Future<Output = Result<(), <Self as UpdateAvailabilityData<Types>>::Error>> + Send + 'async_trait>>
        where Self: 'async_trait,
              'life0: 'async_trait,
              'life1: 'async_trait;
@@ -16,10 +16,10 @@
 SystemContextHandle
 
  • update, to update the query state when a new HotShot event is emitted
  • -

    Required Methods§

    source

    fn update<'life0, 'life1, 'async_trait>( +

    Required Methods§

    source

    fn update<'life0, 'life1, 'async_trait>( &'life0 mut self, event: &'life1 Event<Types> -) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where +) -> Pin<Box<dyn Future<Output = Result<(), <Self as UpdateAvailabilityData<Types>>::Error>> + Send + 'async_trait>>where Self: 'async_trait, 'life0: 'async_trait, 'life1: 'async_trait,

    Update query state based on a new consensus event.

    @@ -31,4 +31,5 @@ trusted.

    If you want to update the data source with an untrusted event, for example one received from a peer over the network, you must authenticate it first.

    -

    Implementors§

    source§

    impl<Types: NodeType, T: UpdateAvailabilityData<Types> + UpdateStatusData + Send> UpdateDataSource<Types> for T

    \ No newline at end of file +

    Implementors§

    source§

    impl<Types: NodeType, T> UpdateDataSource<Types> for Twhere + T: UpdateAvailabilityData<Types> + UpdateNodeData<Types, Error = <Self as UpdateAvailabilityData<Types>>::Error> + UpdateStatusData + Send,

    \ No newline at end of file diff --git a/hotshot_query_service/data_source/trait.VersionedDataSource.html b/hotshot_query_service/data_source/trait.VersionedDataSource.html index 5f072386b..52febf3d7 100644 --- a/hotshot_query_service/data_source/trait.VersionedDataSource.html +++ b/hotshot_query_service/data_source/trait.VersionedDataSource.html @@ -1,4 +1,4 @@ -VersionedDataSource in hotshot_query_service::data_source - Rust
    pub trait VersionedDataSource {
    +VersionedDataSource in hotshot_query_service::data_source - Rust
    pub trait VersionedDataSource {
         type Error: Error + Debug + Send + Sync + 'static;
     
         // Required methods
    @@ -23,22 +23,24 @@
     underlying storage, and are saved if the process restarts. It also allows pending changes to be
     rolled back (revert) so that they are never written back to storage and are no
     longer reflected even through the data source object which was used to make the changes.

    -

    Required Associated Types§

    source

    type Error: Error + Debug + Send + Sync + 'static

    Required Methods§

    source

    fn commit<'life0, 'async_trait>( +

    Required Associated Types§

    source

    type Error: Error + Debug + Send + Sync + 'static

    Required Methods§

    source

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

    Atomically commit to all outstanding modifications to the data.

    If this method fails, outstanding changes are left unmodified. The caller may opt to retry or to erase outstanding changes with revert.

    -
    source

    fn revert<'life0, 'async_trait>( +

    source

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

    Erase all oustanding modifications to the data.

    This function must not return if it has failed to revert changes. Inability to revert changes to the database is considered a fatal error, and this function may panic.

    -

    Implementors§

    Implementors§

    source§

    impl VersionedDataSource for SqlStorage

    §

    type Error = Error

    source§

    impl<D, U> VersionedDataSource for ExtensibleDataSource<D, U>where D: VersionedDataSource + Send, - U: Send,

    source§

    impl<Types> VersionedDataSource for SqlDataSource<Types>where - Types: NodeType,

    §

    type Error = Error

    source§

    impl<Types: NodeType> VersionedDataSource for FileSystemDataSource<Types>where - Payload<Types>: QueryablePayload,

    §

    type Error = PersistenceError

    \ No newline at end of file + U: Send,
    source§

    impl<Types, S, P> VersionedDataSource for FetchingDataSource<Types, S, P>where + Types: NodeType, + S: VersionedDataSource + Send + Sync, + P: Send + Sync,

    source§

    impl<Types: NodeType> VersionedDataSource for FileSystemStorage<Types>where + Payload<Types>: QueryablePayload,

    §

    type Error = PersistenceError

    \ No newline at end of file diff --git a/hotshot_query_service/data_source/type.FileSystemDataSource.html b/hotshot_query_service/data_source/type.FileSystemDataSource.html new file mode 100644 index 000000000..9d7d5b711 --- /dev/null +++ b/hotshot_query_service/data_source/type.FileSystemDataSource.html @@ -0,0 +1,118 @@ +FileSystemDataSource in hotshot_query_service::data_source - Rust
    pub type FileSystemDataSource<Types> = FetchingDataSource<Types, FileSystemStorage<Types>, ()>;
    Expand description

    A data source for the APIs provided in this crate, backed by the local file system.

    +

    Synchronization and atomicity of persisted data structures are provided via [atomic_store]. +The methods commit, +revert, and skip_version of this +type can be used to control synchronization in the underlying +AtomicStore.

    +

    Extension and Composition

    +

    FileSystemDataSource is designed to be both extensible (so you can add additional state to +the API modules defined in this crate) and composable (so you can use FileSystemDataSource +as one component of a larger state type for an application with additional modules).

    +

    Extension

    +

    Adding additional, application-specific state to FileSystemDataSource is possible by +wrapping it in ExtensibleDataSource:

    + +
    type AppState = &'static str;
    +
    +let data_source: ExtensibleDataSource<FileSystemDataSource<AppTypes>, AppState> =
    +    ExtensibleDataSource::new(FileSystemDataSource::create(storage_path).await?, "app state");
    +

    The ExtensibleDataSource wrapper implements all the same data +source traits as FileSystemDataSource, and also provides access to the AppState parameter +for use in API endpoint handlers. This can be used to implement an app-specific data source +trait and add a new API endpoint that uses this app-specific data, as described in the +extension guide.

    +

    Composition

    +

    Composing FileSystemDataSource with other module states is in principle simple – just +create an aggregate struct containing both FileSystemDataSource and your additional module +states. A complication arises from how persistent storage is managed: if other modules have +their own persistent state, should the storage of FileSystemDataSource and the other modules +be completely independent, or synchronized under the control of a single +AtomicStore? FileSystemDataSource supports both patterns: +when you create it with create or open, it will open its own +AtomicStore and manage the synchronization of its own storage, +independent of any other persistent data it might be composed with. But when you create it with +create_with_store or open_with_store, +you may ask it to register its persistent data structures with an existing +[AtomicStoreLoader]. If you register other modules’ persistent data structures with the same +loader, you can create one AtomicStore that synchronizes all the +persistent data. Note, though, that when you choose to use +create_with_store or open_with_store, +you become responsible for ensuring that calls to +AtomicStore::commit_version alternate with calls +to commit or +revert.

    +

    In the following example, we compose HotShot query service modules with other application- +specific modules, using a single top-level AtomicStore to +synchronize all persistent storage.

    + +
    struct AppState {
    +    // Top-level storage coordinator
    +    store: AtomicStore,
    +    hotshot_qs: FileSystemDataSource<AppTypes>,
    +    // additional state for other modules
    +}
    +
    +async fn init_server(
    +    storage_path: &Path,
    +    mut hotshot: SystemContextHandle<AppTypes, AppNodeImpl>,
    +) -> Result<App<Arc<RwLock<AppState>>, Error>, Error> {
    +    let mut loader = AtomicStoreLoader::create(storage_path, "my_app") // or `open`
    +        .map_err(Error::internal)?;
    +    let hotshot_qs = FileSystemDataSource::create_with_store(&mut loader)
    +        .await
    +        .map_err(Error::internal)?;
    +    // Initialize storage for other modules using the same loader.
    +
    +    let store = AtomicStore::open(loader).map_err(Error::internal)?;
    +    let state = Arc::new(RwLock::new(AppState {
    +        store,
    +        hotshot_qs,
    +        // additional state for other modules
    +    }));
    +    let mut app = App::with_state(state.clone());
    +    // Register API modules.
    +
    +    spawn(async move {
    +        let mut events = hotshot.get_event_stream(Default::default()).await.0;
    +        while let Some(event) = events.next().await {
    +            let mut state = state.write().await;
    +            state.hotshot_qs.update(&event).await.unwrap();
    +            // Update other modules' states based on `event`.
    +
    +            state.hotshot_qs.commit().await.unwrap();
    +            // Commit or skip versions for other modules' storage.
    +            state.store.commit_version().unwrap();
    +        }
    +    });
    +
    +    Ok(app)
    +}
    +

    Aliased Type§

    struct FileSystemDataSource<Types> { /* private fields */ }

    Implementations§

    source§

    impl<Types: NodeType> FileSystemDataSource<Types>where + Payload<Types>: QueryablePayload,

    source

    pub async fn create(path: &Path) -> Result<Self>

    Create a new FileSystemDataSource with storage at path.

    +

    If there is already data at path, it will be archived.

    +

    The FileSystemDataSource will manage its own persistence synchronization.

    +
    source

    pub async fn open(path: &Path) -> Result<Self>

    Open an existing FileSystemDataSource from storage at path.

    +

    If there is no data at path, a new store will be created.

    +

    The FileSystemDataSource will manage its own persistence synchronization.

    +
    source

    pub async fn create_with_store(loader: &mut AtomicStoreLoader) -> Result<Self>

    Create a new FileSystemDataSource using a persistent storage loader.

    +

    If there is existing data corresponding to the FileSystemDataSource data structures, it +will be archived.

    +

    The FileSystemDataSource will register its persistent data structures with loader. The +caller is responsible for creating an AtomicStore from loader +and managing synchronization of the store.

    +
    source

    pub async fn open_with_store(loader: &mut AtomicStoreLoader) -> Result<Self>

    Open an existing FileSystemDataSource using a persistent storage loader.

    +

    If there is no existing data corresponding to the FileSystemDataSource data structures, a +new store will be created.

    +

    The FileSystemDataSource will register its persistent data structures with loader. The +caller is responsible for creating an AtomicStore from loader +and managing synchronization of the store.

    +
    source

    pub async fn skip_version(&mut self) -> Result<()>

    Advance the version of the persistent store without committing changes to persistent state.

    +

    This function is useful when the AtomicStore synchronizing +storage for this FileSystemDataSource is being managed by the caller. The caller may want +to persist some changes to other modules whose state is managed by the same +AtomicStore. In order to call +AtomicStore::commit_version, the version of +this FileSystemDataSource must be advanced, either by +commit or, if there are no outstanding changes, +skip_version.

    +
    \ No newline at end of file diff --git a/hotshot_query_service/enum.Error.html b/hotshot_query_service/enum.Error.html index 249fa452e..42d28de9b 100644 --- a/hotshot_query_service/enum.Error.html +++ b/hotshot_query_service/enum.Error.html @@ -1,7 +1,10 @@ -Error in hotshot_query_service - Rust
    pub enum Error {
    +Error in hotshot_query_service - Rust
    pub enum Error {
         Availability {
             source: Error,
         },
    +    Node {
    +        source: Error,
    +    },
         Status {
             source: Error,
         },
    @@ -9,14 +12,14 @@
             message: String,
             status: StatusCode,
         },
    -}

    Variants§

    §

    Availability

    Fields

    §source: Error
    §

    Status

    Fields

    §source: Error
    §

    Custom

    Fields

    §message: String
    §status: StatusCode

    Implementations§

    source§

    impl Error

    source

    pub fn internal<M: Display>(message: M) -> Self

    Trait Implementations§

    source§

    impl Clone for Error

    source§

    fn clone(&self) -> Error

    Returns a copy of the value. Read more
    1.0.0 · source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    source§

    impl Debug for Error

    source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    source§

    impl<'de> Deserialize<'de> for Error

    source§

    fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where +}

    Variants§

    §

    Availability

    Fields

    §source: Error
    §

    Node

    Fields

    §source: Error
    §

    Status

    Fields

    §source: Error
    §

    Custom

    Fields

    §message: String
    §status: StatusCode

    Implementations§

    source§

    impl Error

    source

    pub fn internal<M: Display>(message: M) -> Self

    Trait Implementations§

    source§

    impl Clone for Error

    source§

    fn clone(&self) -> Error

    Returns a copy of the value. Read more
    1.0.0 · source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    source§

    impl Debug for Error

    source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    source§

    impl<'de> Deserialize<'de> for Error

    source§

    fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,

    Deserialize this value from the given Serde deserializer. Read more
    source§

    impl Display for Error

    source§

    fn fmt(&self, __snafu_display_formatter: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    source§

    impl Error for Errorwhere - Self: Debug + Display,

    source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    source§

    fn source(&self) -> Option<&(dyn Error + 'static)>

    The lower-level source of this error, if any. Read more
    source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type based access to context intended for error reports. Read more
    source§

    impl Error for Error

    source§

    fn catch_all(status: StatusCode, message: String) -> Self

    source§

    fn status(&self) -> StatusCode

    §

    fn from_io_error(source: Error) -> Self

    §

    fn from_config_error(source: ConfigError) -> Self

    §

    fn from_route_error<E>(source: RouteError<E>) -> Selfwhere + Self: Debug + Display,

    source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    source§

    fn source(&self) -> Option<&(dyn Error + 'static)>

    The lower-level source of this error, if any. Read more
    source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type based access to context intended for error reports. Read more
    source§

    impl Error for Error

    source§

    fn catch_all(status: StatusCode, message: String) -> Self

    source§

    fn status(&self) -> StatusCode

    §

    fn from_io_error(source: Error) -> Self

    §

    fn from_config_error(source: ConfigError) -> Self

    §

    fn from_route_error<E>(source: RouteError<E>) -> Selfwhere E: Display,

    §

    fn from_request_error(source: RequestError) -> Self

    §

    fn from_socket_error<E>(source: SocketError<E>) -> Selfwhere E: Display,

    §

    fn into_tide_error(self) -> Error

    §

    fn from_server_error(source: Error) -> Self

    source§

    impl ErrorCompat for Error

    source§

    fn backtrace(&self) -> Option<&Backtrace>

    Returns a Backtrace that may be printed.
    §

    fn iter_chain(&self) -> ChainCompat<'_>where Self: AsErrorSource,

    Returns an iterator for traversing the chain of errors, starting with the current error -and continuing with recursive calls to Error::source. Read more
    source§

    impl From<(String, StatusCode)> for Error

    source§

    fn from(original: (String, StatusCode)) -> Error

    Converts to this type from the input type.
    source§

    impl From<Error> for Error

    source§

    fn from(original: Error) -> Error

    Converts to this type from the input type.
    source§

    impl From<Error> for Error

    source§

    fn from(original: Error) -> Error

    Converts to this type from the input type.
    source§

    impl Serialize for Error

    source§

    fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where +and continuing with recursive calls to Error::source. Read more

    source§

    impl From<(String, StatusCode)> for Error

    source§

    fn from(original: (String, StatusCode)) -> Error

    Converts to this type from the input type.
    source§

    impl From<Error> for Error

    source§

    fn from(original: Error) -> Error

    Converts to this type from the input type.
    source§

    impl From<Error> for Error

    source§

    fn from(original: Error) -> Error

    Converts to this type from the input type.
    source§

    impl From<Error> for Error

    source§

    fn from(original: Error) -> Error

    Converts to this type from the input type.
    source§

    impl Serialize for Error

    source§

    fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

    Serialize this value into the given Serde serializer. Read more

    Auto Trait Implementations§

    §

    impl RefUnwindSafe for Error

    §

    impl Send for Error

    §

    impl Sync for Error

    §

    impl Unpin for Error

    §

    impl UnwindSafe for Error

    Blanket Implementations§

    source§

    impl<T> Any for Twhere T: 'static + ?Sized,

    source§

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    §

    impl<T> AsErrorSource for Twhere T: Error + 'static,

    §

    fn as_error_source(&self) -> &(dyn Error + 'static)

    For maximum effectiveness, this needs to be called as a method @@ -55,7 +58,7 @@ Debug-formatted.
    §

    fn fmt_upper_hex(self) -> FmtUpperHex<Self>where Self: UpperHex,

    Causes self to use its UpperHex implementation when Debug-formatted.
    §

    fn fmt_list(self) -> FmtList<Self>where - &'a Self: for<'a> IntoIterator,

    Formats each item in a sequence. Read more
    source§

    impl<T> From<T> for T

    source§

    fn from(t: T) -> T

    Returns the argument unchanged.

    + &'a Self: for<'a> IntoIterator,
    Formats each item in a sequence. Read more
    source§

    impl<T> From<T> for T

    source§

    fn from(t: T) -> T

    Returns the argument unchanged.

    §

    impl<T> Instrument for T

    §

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

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

    fn in_current_span(self) -> Instrumented<Self>

    Instruments this type with the current Span, returning an Instrumented wrapper. Read more
    source§

    impl<T> Instrument for T

    source§

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

    Instruments this type with the provided Span, returning an diff --git a/hotshot_query_service/enum.QueryError.html b/hotshot_query_service/enum.QueryError.html index e0d5a7832..52e77e499 100644 --- a/hotshot_query_service/enum.QueryError.html +++ b/hotshot_query_service/enum.QueryError.html @@ -1,4 +1,4 @@ -QueryError in hotshot_query_service - Rust

    Implementations§

    source§

    impl QueryError

    source

    pub fn status(&self) -> StatusCode

    Trait Implementations§

    source§

    impl Clone for QueryError

    source§

    fn clone(&self) -> QueryError

    Returns a copy of the value. Read more
    1.0.0 · source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    source§

    impl Debug for QueryError

    source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    source§

    impl<'de> Deserialize<'de> for QueryError

    source§

    fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where - __D: Deserializer<'de>,

    Deserialize this value from the given Serde deserializer. Read more
    source§

    impl Display for QueryError

    source§

    fn fmt(&self, __snafu_display_formatter: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    source§

    impl Error for QueryErrorwhere - Self: Debug + Display,

    source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    source§

    fn source(&self) -> Option<&(dyn Error + 'static)>

    The lower-level source of this error, if any. Read more
    source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type based access to context intended for error reports. Read more
    source§

    impl ErrorCompat for QueryError

    source§

    fn backtrace(&self) -> Option<&Backtrace>

    Returns a Backtrace that may be printed.
    §

    fn iter_chain(&self) -> ChainCompat<'_>where +

    Implementations§

    source§

    impl QueryError

    source

    pub fn status(&self) -> StatusCode

    Trait Implementations§

    source§

    impl Clone for QueryError

    source§

    fn clone(&self) -> QueryError

    Returns a copy of the value. Read more
    1.0.0 · source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    source§

    impl Debug for QueryError

    source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    source§

    impl<'de> Deserialize<'de> for QueryError

    source§

    fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where + __D: Deserializer<'de>,

    Deserialize this value from the given Serde deserializer. Read more
    source§

    impl Display for QueryError

    source§

    fn fmt(&self, __snafu_display_formatter: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    source§

    impl Error for QueryErrorwhere + Self: Debug + Display,

    source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    source§

    fn source(&self) -> Option<&(dyn Error + 'static)>

    The lower-level source of this error, if any. Read more
    source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type based access to context intended for error reports. Read more
    source§

    impl ErrorCompat for QueryError

    source§

    fn backtrace(&self) -> Option<&Backtrace>

    Returns a Backtrace that may be printed.
    §

    fn iter_chain(&self) -> ChainCompat<'_>where Self: AsErrorSource,

    Returns an iterator for traversing the chain of errors, starting with the current error -and continuing with recursive calls to Error::source. Read more
    source§

    impl IntoError<QueryError> for MissingSnafuwhere - QueryError: Error + ErrorCompat,

    §

    type Source = NoneError

    The underlying error
    source§

    fn into_error(self, error: Self::Source) -> QueryError

    Combine the information to produce the error
    source§

    impl IntoError<QueryError> for NotFoundSnafuwhere - QueryError: Error + ErrorCompat,

    §

    type Source = NoneError

    The underlying error
    source§

    fn into_error(self, error: Self::Source) -> QueryError

    Combine the information to produce the error
    source§

    impl<__T0> IntoError<QueryError> for Snafu<__T0>where +and continuing with recursive calls to Error::source. Read more

    source§

    impl IntoError<QueryError> for MissingSnafuwhere + QueryError: Error + ErrorCompat,

    §

    type Source = NoneError

    The underlying error
    source§

    fn into_error(self, error: Self::Source) -> QueryError

    Combine the information to produce the error
    source§

    impl IntoError<QueryError> for NotFoundSnafuwhere + QueryError: Error + ErrorCompat,

    §

    type Source = NoneError

    The underlying error
    source§

    fn into_error(self, error: Self::Source) -> QueryError

    Combine the information to produce the error
    source§

    impl<__T0> IntoError<QueryError> for Snafu<__T0>where QueryError: Error + ErrorCompat, - __T0: Into<String>,

    §

    type Source = NoneError

    The underlying error
    source§

    fn into_error(self, error: Self::Source) -> QueryError

    Combine the information to produce the error
    source§

    impl Serialize for QueryError

    source§

    fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where + __T0: Into<String>,

    §

    type Source = NoneError

    The underlying error
    source§

    fn into_error(self, error: Self::Source) -> QueryError

    Combine the information to produce the error
    source§

    impl Serialize for QueryError

    source§

    fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

    Serialize this value into the given Serde serializer. Read more

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for Twhere T: 'static + ?Sized,

    source§

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    §

    impl<T> AsErrorSource for Twhere T: Error + 'static,

    §

    fn as_error_source(&self) -> &(dyn Error + 'static)

    For maximum effectiveness, this needs to be called as a method diff --git a/hotshot_query_service/fn.run_standalone_service.html b/hotshot_query_service/fn.run_standalone_service.html index 7e598675c..b286169bf 100644 --- a/hotshot_query_service/fn.run_standalone_service.html +++ b/hotshot_query_service/fn.run_standalone_service.html @@ -1,8 +1,8 @@ -run_standalone_service in hotshot_query_service - Rust
    pub async fn run_standalone_service<Types: NodeType, I: NodeImplementation<Types>, D>(
    +run_standalone_service in hotshot_query_service - Rust
    pub async fn run_standalone_service<Types: NodeType, I: NodeImplementation<Types>, D>(
         options: Options,
         data_source: D,
         hotshot: SystemContextHandle<Types, I>
     ) -> Result<(), Error>where
         Payload<Types>: QueryablePayload,
    -    D: AvailabilityDataSource<Types> + StatusDataSource + UpdateDataSource<Types> + VersionedDataSource + Send + Sync + 'static,
    Expand description

    Run an instance of the HotShot Query service with no customization.

    + D: AvailabilityDataSource<Types> + NodeDataSource<Types> + StatusDataSource + UpdateDataSource<Types> + VersionedDataSource + Send + Sync + 'static,
    Expand description

    Run an instance of the HotShot Query service with no customization.

    \ No newline at end of file diff --git a/hotshot_query_service/index.html b/hotshot_query_service/index.html index 9876b9c8d..7b79668cf 100644 --- a/hotshot_query_service/index.html +++ b/hotshot_query_service/index.html @@ -1,5 +1,5 @@ hotshot_query_service - Rust
    Expand description

    The HotShot Query Service is a minimal, generic query service that can be integrated into any +

  • All Items
  • Expand description

    The HotShot Query Service is a minimal, generic query service that can be integrated into any decentralized application running on the [hotshot] consensus layer. It provides all the features that HotShot itself expects of a query service (such as providing consensus-related data for catchup and synchronization) as well as some application-level features that deal only with @@ -9,6 +9,7 @@

    Basic usage

    use hotshot_query_service::{
         availability,
         data_source::{FileSystemDataSource, UpdateDataSource, VersionedDataSource},
    +    node,
         status::UpdateStatusData,
         status, Error
     };
    @@ -32,6 +33,8 @@ 

    Basic usage

    // Create API modules. let availability_api = availability::define_api(&Default::default()) .map_err(Error::internal)?; +let node_api = node::define_api(&Default::default()) + .map_err(Error::internal)?; let status_api = status::define_api(&Default::default()) .map_err(Error::internal)?; @@ -41,6 +44,8 @@

    Basic usage

    app .register_module("availability", availability_api) .map_err(Error::internal)? + .register_module("node", node_api) + .map_err(Error::internal)? .register_module("status", status_api) .map_err(Error::internal)?; @@ -135,7 +140,7 @@

    Extension

    let block = state .get_block(block_index) .await - .context(QueryBlockSnafu { resource: block_index.to_string() })?; + .context(FetchBlockSnafu { resource: block_index.to_string() })?; let txn = block.transaction(&txn_index).unwrap(); let utxo = // Application-specific logic to extract a UTXO from a transaction. Ok(utxo) @@ -165,15 +170,15 @@

    Composition

    Composing the modules provided by this crate with other, unrelated modules to create a unified service is fairly simple, as most of the complexity is handled by [tide_disco], which already provides a mechanism for composing several modules into a single application. In principle, all -you need to do is register the availability and status APIs provided by this crate with a -[tide_disco::App], and then register your own API modules with the same app.

    +you need to do is register the availability, node, and status APIs provided by this crate +with a [tide_disco::App], and then register your own API modules with the same app.

    The one wrinkle is that all modules within a [tide_disco] app must share the same state type. It -is for this reason that the modules provided by this crate are generic on the state type – both -availability::define_api and status::define_api can work with any state type, provided that -type implements the corresponding data source traits. The data sources provided by this crate -implement both of these traits, but if you want to use a custom state type that includes state -for other modules, you will need to implement these traits for your custom type. The basic -pattern looks like this:

    +is for this reason that the modules provided by this crate are generic on the state type – +availability::define_api, node::define_api, and status::define_api can all work with any +state type, provided that type implements the corresponding data source traits. The data sources +provided by this crate implement these traits, but if you want to use a custom state type that +includes state for other modules, you will need to implement these traits for your custom type. +The basic pattern looks like this:

    // Our AppState takes an underlying data source `D` which already implements the relevant
     // traits, and adds some state for use with other modules.
    @@ -187,19 +192,14 @@ 

    Composition

    impl<D: AvailabilityDataSource<AppTypes> + Send + Sync> AvailabilityDataSource<AppTypes> for AppState<D> { - type LeafRange<'a, R> = D::LeafRange<'a, R> + type LeafRange<R> = D::LeafRange<R> where - Self: 'a, - R: RangeBounds<usize> + Send; - type BlockRange<'a, R> = D::BlockRange<'a, R> + R: RangeBounds<usize> + Send; + type BlockRange<R> = D::BlockRange<R> where - Self: 'a, - R: RangeBounds<usize> + Send; + R: RangeBounds<usize> + Send; - type LeafStream = D::LeafStream; - type BlockStream = D::BlockStream; - - async fn get_leaf<ID>(&self, id: ID) -> QueryResult<LeafQueryData<AppTypes>> + async fn get_leaf<ID>(&self, id: ID) -> Fetch<LeafQueryData<AppTypes>> where ID: Into<LeafId<AppTypes>> + Send + Sync, { @@ -209,6 +209,26 @@

    Composition

    // etc } +// Implement data source trait for node API by delegating to the underlying data source. +#[async_trait] +impl<D: NodeDataSource<AppTypes> + Send + Sync> NodeDataSource<AppTypes> for AppState<D> { + async fn block_height(&self) -> QueryResult<usize> { + self.hotshot_qs.block_height().await + } + + async fn get_proposals( + &self, + id: &SignatureKey<AppTypes>, + limit: Option<usize>, + ) -> QueryResult<Vec<LeafQueryData<AppTypes>>> { + self.hotshot_qs.get_proposals(id, limit).await + } + + async fn count_proposals(&self, id: &SignatureKey<AppTypes>) -> QueryResult<usize> { + self.hotshot_qs.count_proposals(id).await + } +} + // Implement data source trait for status API by delegating to the underlying data source. #[async_trait] impl<D: StatusDataSource + Send + Sync> StatusDataSource for AppState<D> { @@ -223,19 +243,21 @@

    Composition

    // Implement data source traits for other modules, using additional state from AppState.

    In the future, we may provide derive macros for -AvailabilityDataSource and -StatusDataSource to eliminate the boilerplate of implementing them -for a custom type that has an existing implementation as one of its fields.

    +AvailabilityDataSource, +NodeDataSource, and StatusDataSource to +eliminate the boilerplate of implementing them for a custom type that has an existing +implementation as one of its fields.

    Once you have created your AppState type aggregating the state for each API module, you can initialize the state as normal, instantiating D with a concrete implementation of a data source and initializing hotshot_qs as you normally would that data source.

    -

    However, this only works if you want the persistent storage for the availability and status +

    However, this only works if you want the persistent storage for the availability and node modules (managed by hotshot_qs) to be independent of the persistent storage for other modules. You may well want to synchronize the storage for all modules together, so that updates to the entire application state can be done atomically. This is particularly relevant if one of your application-specific modules updates its storage based on a stream of HotShot leaves. Since the -availability module also updates with each new leaf, you probably want these two modules to stay -in sync. The data source implementations provided by this crate provide means by which you can -add additional data to the same persistent store and synchronize the entire store together. -Refer to the documentation for you specific data source for information on how to achieve this.

    -

    Modules

    Macros

    Structs

    • SNAFU context selector for the QueryError::Missing variant
    • SNAFU context selector for the QueryError::NotFound variant
    • SNAFU context selector for the QueryError::Error variant

    Enums

    Traits

    • A reference to a T which can be resolved into a whole T.

    Functions

    Type Aliases

    \ No newline at end of file +availability and node modules also update with each new leaf, you probably want all of these +modules to stay in sync. The data source implementations provided by this crate provide means by +which you can add additional data to the same persistent store and synchronize the entire store +together. Refer to the documentation for you specific data source for information on how to +achieve this.

    +

    Modules

    • Queries for HotShot chain state.
    • Persistent storage and sources of data consumed by APIs.
    • A node’s view of a HotShot chain
    • Queries for node-specific state and uncommitted data.

    Macros

    Structs

    • SNAFU context selector for the QueryError::Missing variant
    • SNAFU context selector for the QueryError::NotFound variant
    • SNAFU context selector for the QueryError::Error variant

    Enums

    Traits

    • A reference to a T which can be resolved into a whole T.

    Functions

    Type Aliases

    \ No newline at end of file diff --git a/hotshot_query_service/macro.include_migrations.html b/hotshot_query_service/macro.include_migrations.html index efa5a1a2c..602012f31 100644 --- a/hotshot_query_service/macro.include_migrations.html +++ b/hotshot_query_service/macro.include_migrations.html @@ -1,4 +1,4 @@ -include_migrations in hotshot_query_service - Rust
    macro_rules! include_migrations {
    +include_migrations in hotshot_query_service - Rust
    macro_rules! include_migrations {
         ($dir:tt) => { ... };
     }
    Expand description

    Embed migrations from the given directory into the current binary.

    The macro invocation include_migrations!(path) evaluates to an expression of type impl Iterator<Item = Migration>. Each migration must be a text file which is an immediate child of @@ -18,10 +18,10 @@ assert_eq!(migrations[0].name(), "init_schema");

    Note that a similar macro is available from Refinery: embed_migrations. This -macro differs in that it evaluates to an iterator of migrations, making it an +macro differs in that it evaluates to an iterator of migrations, making it an expression macro, while embed_migrations is a statement macro that defines a module which provides access to the embedded migrations only indirectly via a Runner. The direct access to migrations provided by include_migrations makes this macro easier to use with -Config::migrations, for combining custom migrations with default_migrations.

    +Config::migrations, for combining custom migrations with default_migrations.

    \ No newline at end of file diff --git a/hotshot_query_service/macro.instantiate_data_source_tests.html b/hotshot_query_service/macro.instantiate_data_source_tests.html index 1fa7514c0..9ed6f4ace 100644 --- a/hotshot_query_service/macro.instantiate_data_source_tests.html +++ b/hotshot_query_service/macro.instantiate_data_source_tests.html @@ -1,3 +1,3 @@ -instantiate_data_source_tests in hotshot_query_service - Rust
    macro_rules! instantiate_data_source_tests {
    +instantiate_data_source_tests in hotshot_query_service - Rust
    macro_rules! instantiate_data_source_tests {
         ($t:ty) => { ... };
     }
    \ No newline at end of file diff --git a/hotshot_query_service/node/data_source/trait.NodeDataSource.html b/hotshot_query_service/node/data_source/trait.NodeDataSource.html new file mode 100644 index 000000000..9a752a22c --- /dev/null +++ b/hotshot_query_service/node/data_source/trait.NodeDataSource.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

    Redirecting to ../../../hotshot_query_service/node/trait.NodeDataSource.html...

    + + + \ No newline at end of file diff --git a/hotshot_query_service/node/data_source/trait.UpdateNodeData.html b/hotshot_query_service/node/data_source/trait.UpdateNodeData.html new file mode 100644 index 000000000..1c709b56a --- /dev/null +++ b/hotshot_query_service/node/data_source/trait.UpdateNodeData.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

    Redirecting to ../../../hotshot_query_service/node/trait.UpdateNodeData.html...

    + + + \ No newline at end of file diff --git a/hotshot_query_service/node/enum.Error.html b/hotshot_query_service/node/enum.Error.html new file mode 100644 index 000000000..d394ac0c9 --- /dev/null +++ b/hotshot_query_service/node/enum.Error.html @@ -0,0 +1,170 @@ +Error in hotshot_query_service::node - Rust
    pub enum Error {
    +    Request {
    +        source: RequestError,
    +    },
    +    Query {
    +        source: QueryError,
    +    },
    +    QueryProposals {
    +        source: QueryError,
    +        proposer: EncodedPublicKey,
    +    },
    +    InvalidSignatureKey,
    +    Custom {
    +        message: String,
    +        status: StatusCode,
    +    },
    +}

    Variants§

    §

    Request

    Fields

    §source: RequestError
    §

    Query

    Fields

    §source: QueryError
    §

    QueryProposals

    Fields

    §source: QueryError
    §proposer: EncodedPublicKey
    §

    InvalidSignatureKey

    §

    Custom

    Fields

    §message: String
    §status: StatusCode

    Implementations§

    source§

    impl Error

    source

    pub fn internal<M: Display>(message: M) -> Self

    source

    pub fn status(&self) -> StatusCode

    Trait Implementations§

    source§

    impl Clone for Error

    source§

    fn clone(&self) -> Error

    Returns a copy of the value. Read more
    1.0.0 · source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    source§

    impl Debug for Error

    source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    source§

    impl<'de> Deserialize<'de> for Error

    source§

    fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where + __D: Deserializer<'de>,

    Deserialize this value from the given Serde deserializer. Read more
    source§

    impl Display for Error

    source§

    fn fmt(&self, __snafu_display_formatter: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    source§

    impl Error for Errorwhere + Self: Debug + Display,

    source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    source§

    fn source(&self) -> Option<&(dyn Error + 'static)>

    The lower-level source of this error, if any. Read more
    source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type based access to context intended for error reports. Read more
    source§

    impl ErrorCompat for Error

    source§

    fn backtrace(&self) -> Option<&Backtrace>

    Returns a Backtrace that may be printed.
    §

    fn iter_chain(&self) -> ChainCompat<'_>where + Self: AsErrorSource,

    Returns an iterator for traversing the chain of errors, +starting with the current error +and continuing with recursive calls to Error::source. Read more
    source§

    impl From<(String, StatusCode)> for Error

    source§

    fn from(original: (String, StatusCode)) -> Error

    Converts to this type from the input type.
    source§

    impl From<Error> for Error

    source§

    fn from(original: Error) -> Error

    Converts to this type from the input type.
    source§

    impl From<RequestError> for Error

    source§

    fn from(original: RequestError) -> Error

    Converts to this type from the input type.
    source§

    impl<__T0, __T1> IntoError<Error> for CustomSnafu<__T0, __T1>where + Error: Error + ErrorCompat, + __T0: Into<String>, + __T1: Into<StatusCode>,

    §

    type Source = NoneError

    The underlying error
    source§

    fn into_error(self, error: Self::Source) -> Error

    Combine the information to produce the error
    source§

    impl IntoError<Error> for InvalidSignatureKeySnafuwhere + Error: Error + ErrorCompat,

    §

    type Source = NoneError

    The underlying error
    source§

    fn into_error(self, error: Self::Source) -> Error

    Combine the information to produce the error
    source§

    impl<__T0> IntoError<Error> for QueryProposalsSnafu<__T0>where + Error: Error + ErrorCompat, + __T0: Into<EncodedPublicKey>,

    §

    type Source = QueryError

    The underlying error
    source§

    fn into_error(self, error: Self::Source) -> Error

    Combine the information to produce the error
    source§

    impl IntoError<Error> for QuerySnafuwhere + Error: Error + ErrorCompat,

    §

    type Source = QueryError

    The underlying error
    source§

    fn into_error(self, error: Self::Source) -> Error

    Combine the information to produce the error
    source§

    impl IntoError<Error> for RequestSnafuwhere + Error: Error + ErrorCompat,

    §

    type Source = RequestError

    The underlying error
    source§

    fn into_error(self, error: Self::Source) -> Error

    Combine the information to produce the error
    source§

    impl Serialize for Error

    source§

    fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where + __S: Serializer,

    Serialize this value into the given Serde serializer. Read more

    Auto Trait Implementations§

    §

    impl RefUnwindSafe for Error

    §

    impl Send for Error

    §

    impl Sync for Error

    §

    impl Unpin for Error

    §

    impl UnwindSafe for Error

    Blanket Implementations§

    source§

    impl<T> Any for Twhere + T: 'static + ?Sized,

    source§

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    §

    impl<T> AsErrorSource for Twhere + T: Error + 'static,

    §

    fn as_error_source(&self) -> &(dyn Error + 'static)

    For maximum effectiveness, this needs to be called as a method +to benefit from Rust’s automatic dereferencing of method +receivers.
    §

    impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere + T: 'a,

    §

    fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

    §

    impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere + T: 'a,

    §

    fn implicit( + self, + class: Class, + constructed: bool, + tag: u32 +) -> TaggedParser<'a, Implicit, Self, E>

    source§

    impl<T> Borrow<T> for Twhere + T: ?Sized,

    source§

    fn borrow(&self) -> &T

    Immutably borrows from an owned value. Read more
    source§

    impl<T> BorrowMut<T> for Twhere + T: ?Sized,

    source§

    fn borrow_mut(&mut self) -> &mut T

    Mutably borrows from an owned value. Read more
    §

    impl<T> Conv for T

    §

    fn conv<T>(self) -> Twhere + Self: Into<T>,

    Converts self into T using Into<T>. Read more
    §

    impl<T> Downcast for Twhere + T: Any,

    §

    fn into_any(self: Box<T>) -> Box<dyn Any>

    Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can +then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
    §

    fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

    Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be +further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
    §

    fn as_any(&self) -> &(dyn Any + 'static)

    Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot +generate &Any’s vtable from &Trait’s.
    §

    fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

    Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot +generate &mut Any’s vtable from &mut Trait’s.
    §

    impl<T> DowncastSync for Twhere + T: Any + Send + Sync,

    §

    fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

    Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be +further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
    source§

    impl<T> DynClone for Twhere + T: Clone,

    source§

    fn __clone_box(&self, _: Private) -> *mut ()

    source§

    impl<T> DynClone for Twhere + T: Clone,

    source§

    fn __clone_box(&self, _: Private) -> *mut ()

    §

    impl<T> FmtForward for T

    §

    fn fmt_binary(self) -> FmtBinary<Self>where + Self: Binary,

    Causes self to use its Binary implementation when Debug-formatted.
    §

    fn fmt_display(self) -> FmtDisplay<Self>where + Self: Display,

    Causes self to use its Display implementation when +Debug-formatted.
    §

    fn fmt_lower_exp(self) -> FmtLowerExp<Self>where + Self: LowerExp,

    Causes self to use its LowerExp implementation when +Debug-formatted.
    §

    fn fmt_lower_hex(self) -> FmtLowerHex<Self>where + Self: LowerHex,

    Causes self to use its LowerHex implementation when +Debug-formatted.
    §

    fn fmt_octal(self) -> FmtOctal<Self>where + Self: Octal,

    Causes self to use its Octal implementation when Debug-formatted.
    §

    fn fmt_pointer(self) -> FmtPointer<Self>where + Self: Pointer,

    Causes self to use its Pointer implementation when +Debug-formatted.
    §

    fn fmt_upper_exp(self) -> FmtUpperExp<Self>where + Self: UpperExp,

    Causes self to use its UpperExp implementation when +Debug-formatted.
    §

    fn fmt_upper_hex(self) -> FmtUpperHex<Self>where + Self: UpperHex,

    Causes self to use its UpperHex implementation when +Debug-formatted.
    §

    fn fmt_list(self) -> FmtList<Self>where + &'a Self: for<'a> IntoIterator,

    Formats each item in a sequence. Read more
    source§

    impl<T> From<T> for T

    source§

    fn from(t: T) -> T

    Returns the argument unchanged.

    +
    §

    impl<T> Instrument for T

    §

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

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

    fn in_current_span(self) -> Instrumented<Self>

    Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
    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<E> InstrumentError for Ewhere + TracedError<E>: From<E>,

    §

    type Instrumented = TracedError<E>

    The type of the wrapped error after instrumentation
    source§

    fn in_current_span(self) -> <E as InstrumentError>::Instrumented

    Instrument an Error by bundling it with a SpanTrace Read more
    source§

    impl<T, U> Into<U> for Twhere + 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.

    +
    §

    impl<D> OwoColorize for D

    §

    fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where + C: Color,

    Set the foreground color generically Read more
    §

    fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where + C: Color,

    Set the background color generically. Read more
    §

    fn black<'a>(&'a self) -> FgColorDisplay<'a, Black, Self>

    Change the foreground color to black
    §

    fn on_black<'a>(&'a self) -> BgColorDisplay<'a, Black, Self>

    Change the background color to black
    §

    fn red<'a>(&'a self) -> FgColorDisplay<'a, Red, Self>

    Change the foreground color to red
    §

    fn on_red<'a>(&'a self) -> BgColorDisplay<'a, Red, Self>

    Change the background color to red
    §

    fn green<'a>(&'a self) -> FgColorDisplay<'a, Green, Self>

    Change the foreground color to green
    §

    fn on_green<'a>(&'a self) -> BgColorDisplay<'a, Green, Self>

    Change the background color to green
    §

    fn yellow<'a>(&'a self) -> FgColorDisplay<'a, Yellow, Self>

    Change the foreground color to yellow
    §

    fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>

    Change the background color to yellow
    §

    fn blue<'a>(&'a self) -> FgColorDisplay<'a, Blue, Self>

    Change the foreground color to blue
    §

    fn on_blue<'a>(&'a self) -> BgColorDisplay<'a, Blue, Self>

    Change the background color to blue
    §

    fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>

    Change the foreground color to magenta
    §

    fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>

    Change the background color to magenta
    §

    fn purple<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>

    Change the foreground color to purple
    §

    fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>

    Change the background color to purple
    §

    fn cyan<'a>(&'a self) -> FgColorDisplay<'a, Cyan, Self>

    Change the foreground color to cyan
    §

    fn on_cyan<'a>(&'a self) -> BgColorDisplay<'a, Cyan, Self>

    Change the background color to cyan
    §

    fn white<'a>(&'a self) -> FgColorDisplay<'a, White, Self>

    Change the foreground color to white
    §

    fn on_white<'a>(&'a self) -> BgColorDisplay<'a, White, Self>

    Change the background color to white
    §

    fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>

    Change the foreground color to the terminal default
    §

    fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>

    Change the background color to the terminal default
    §

    fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>

    Change the foreground color to bright black
    §

    fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>

    Change the background color to bright black
    §

    fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>

    Change the foreground color to bright red
    §

    fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>

    Change the background color to bright red
    §

    fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>

    Change the foreground color to bright green
    §

    fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>

    Change the background color to bright green
    §

    fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>

    Change the foreground color to bright yellow
    §

    fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>

    Change the background color to bright yellow
    §

    fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>

    Change the foreground color to bright blue
    §

    fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>

    Change the background color to bright blue
    §

    fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>

    Change the foreground color to bright magenta
    §

    fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>

    Change the background color to bright magenta
    §

    fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>

    Change the foreground color to bright purple
    §

    fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>

    Change the background color to bright purple
    §

    fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>

    Change the foreground color to bright cyan
    §

    fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>

    Change the background color to bright cyan
    §

    fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>

    Change the foreground color to bright white
    §

    fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>

    Change the background color to bright white
    §

    fn bold<'a>(&'a self) -> BoldDisplay<'a, Self>

    Make the text bold
    §

    fn dimmed<'a>(&'a self) -> DimDisplay<'a, Self>

    Make the text dim
    §

    fn italic<'a>(&'a self) -> ItalicDisplay<'a, Self>

    Make the text italicized
    §

    fn underline<'a>(&'a self) -> UnderlineDisplay<'a, Self>

    Make the text italicized
    Make the text blink
    Make the text blink (but fast!)
    §

    fn reversed<'a>(&'a self) -> ReversedDisplay<'a, Self>

    Swap the foreground and background colors
    §

    fn hidden<'a>(&'a self) -> HiddenDisplay<'a, Self>

    Hide the text
    §

    fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>

    Cross out the text
    §

    fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where + Color: DynColor,

    Set the foreground color at runtime. Only use if you do not know which color will be used at +compile-time. If the color is constant, use either OwoColorize::fg or +a color-specific method, such as OwoColorize::green, Read more
    §

    fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where + Color: DynColor,

    Set the background color at runtime. Only use if you do not know what color to use at +compile-time. If the color is constant, use either OwoColorize::bg or +a color-specific method, such as OwoColorize::on_yellow, Read more
    §

    fn fg_rgb<const R: u8, const G: u8, const B: u8>( + &self +) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>

    Set the foreground color to a specific RGB value.
    §

    fn bg_rgb<const R: u8, const G: u8, const B: u8>( + &self +) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>

    Set the background color to a specific RGB value.
    §

    fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>

    Sets the foreground color to an RGB value.
    §

    fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>

    Sets the background color to an RGB value.
    §

    fn style(&self, style: Style) -> Styled<&Self>

    Apply a runtime-determined style
    §

    impl<T> Pipe for Twhere + T: ?Sized,

    §

    fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere + Self: Sized,

    Pipes by value. This is generally the method you want to use. Read more
    §

    fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere + R: 'a,

    Borrows self and passes that borrow into the pipe function. Read more
    §

    fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere + R: 'a,

    Mutably borrows self and passes that borrow into the pipe function. Read more
    §

    fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> Rwhere + Self: Borrow<B>, + B: 'a + ?Sized, + R: 'a,

    Borrows self, then passes self.borrow() into the pipe function. Read more
    §

    fn pipe_borrow_mut<'a, B, R>( + &'a mut self, + func: impl FnOnce(&'a mut B) -> R +) -> Rwhere + Self: BorrowMut<B>, + B: 'a + ?Sized, + R: 'a,

    Mutably borrows self, then passes self.borrow_mut() into the pipe +function. Read more
    §

    fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> Rwhere + Self: AsRef<U>, + U: 'a + ?Sized, + R: 'a,

    Borrows self, then passes self.as_ref() into the pipe function.
    §

    fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> Rwhere + Self: AsMut<U>, + U: 'a + ?Sized, + R: 'a,

    Mutably borrows self, then passes self.as_mut() into the pipe +function.
    §

    fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> Rwhere + Self: Deref<Target = T>, + T: 'a + ?Sized, + R: 'a,

    Borrows self, then passes self.deref() into the pipe function.
    §

    fn pipe_deref_mut<'a, T, R>( + &'a mut self, + func: impl FnOnce(&'a mut T) -> R +) -> Rwhere + Self: DerefMut<Target = T> + Deref, + T: 'a + ?Sized, + R: 'a,

    Mutably borrows self, then passes self.deref_mut() into the pipe +function.
    §

    impl<T> Pointable for T

    §

    const ALIGN: usize = _

    The alignment of pointer.
    §

    type Init = T

    The type for initializers.
    §

    unsafe fn init(init: <T as Pointable>::Init) -> usize

    Initializes a with the given initializer. Read more
    §

    unsafe fn deref<'a>(ptr: usize) -> &'a T

    Dereferences the given pointer. Read more
    §

    unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

    Mutably dereferences the given pointer. Read more
    §

    unsafe fn drop(ptr: usize)

    Drops the object pointed to by the given pointer. Read more
    source§

    impl<T> Same for T

    §

    type Output = T

    Should always be Self
    source§

    impl<T> SectionExt for Twhere + T: Display + Send + Sync + 'static,

    source§

    fn header<C>(self, header: C) -> IndentedSection<C, T>where + C: Display + Send + Sync + 'static,

    Add a header to a Section and indent the body Read more
    §

    impl<T> Tap for T

    §

    fn tap(self, func: impl FnOnce(&Self)) -> Self

    Immutable access to a value. Read more
    §

    fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

    Mutable access to a value. Read more
    §

    fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Selfwhere + Self: Borrow<B>, + B: ?Sized,

    Immutable access to the Borrow<B> of a value. Read more
    §

    fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere + Self: BorrowMut<B>, + B: ?Sized,

    Mutable access to the BorrowMut<B> of a value. Read more
    §

    fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Selfwhere + Self: AsRef<R>, + R: ?Sized,

    Immutable access to the AsRef<R> view of a value. Read more
    §

    fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere + Self: AsMut<R>, + R: ?Sized,

    Mutable access to the AsMut<R> view of a value. Read more
    §

    fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Selfwhere + Self: Deref<Target = T>, + T: ?Sized,

    Immutable access to the Deref::Target of a value. Read more
    §

    fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Selfwhere + Self: DerefMut<Target = T> + Deref, + T: ?Sized,

    Mutable access to the Deref::Target of a value. Read more
    §

    fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

    Calls .tap() only in debug builds, and is erased in release builds.
    §

    fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

    Calls .tap_mut() only in debug builds, and is erased in release +builds.
    §

    fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Selfwhere + Self: Borrow<B>, + B: ?Sized,

    Calls .tap_borrow() only in debug builds, and is erased in release +builds.
    §

    fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere + Self: BorrowMut<B>, + B: ?Sized,

    Calls .tap_borrow_mut() only in debug builds, and is erased in release +builds.
    §

    fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Selfwhere + Self: AsRef<R>, + R: ?Sized,

    Calls .tap_ref() only in debug builds, and is erased in release +builds.
    §

    fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere + Self: AsMut<R>, + R: ?Sized,

    Calls .tap_ref_mut() only in debug builds, and is erased in release +builds.
    §

    fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Selfwhere + Self: Deref<Target = T>, + T: ?Sized,

    Calls .tap_deref() only in debug builds, and is erased in release +builds.
    §

    fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Selfwhere + Self: DerefMut<Target = T> + Deref, + T: ?Sized,

    Calls .tap_deref_mut() only in debug builds, and is erased in release +builds.
    source§

    impl<T> ToOwned for Twhere + T: Clone,

    §

    type Owned = T

    The resulting type after obtaining ownership.
    source§

    fn to_owned(&self) -> T

    Creates owned data from borrowed data, usually by cloning. Read more
    source§

    fn clone_into(&self, target: &mut T)

    Uses borrowed data to replace owned data, usually by cloning. Read more
    source§

    impl<T> ToString for Twhere + T: Display + ?Sized,

    source§

    default fn to_string(&self) -> String

    Converts the given value to a String. Read more
    §

    impl<T> TryConv for T

    §

    fn try_conv<T>(self) -> Result<T, Self::Error>where + Self: TryInto<T>,

    Attempts to convert self into T using TryInto<T>. Read more
    source§

    impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

    §

    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 Twhere + U: TryFrom<T>,

    §

    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.
    §

    impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

    §

    fn vzip(self) -> V

    §

    impl<T> WithSubscriber for T

    §

    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
    §

    fn with_current_subscriber(self) -> WithDispatch<Self>

    Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
    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> DeserializeOwned for Twhere + T: for<'de> Deserialize<'de>,

    §

    impl<T> PassType for Twhere + T: Clone + Debug + Sync + Send + 'static,

    §

    impl<T> TaskErr for Twhere + T: Error + Sync + Send + 'static,

    \ No newline at end of file diff --git a/hotshot_query_service/node/fn.define_api.html b/hotshot_query_service/node/fn.define_api.html new file mode 100644 index 000000000..5f741fc7b --- /dev/null +++ b/hotshot_query_service/node/fn.define_api.html @@ -0,0 +1,5 @@ +define_api in hotshot_query_service::node - Rust
    pub fn define_api<State, Types: NodeType>(
    +    options: &Options
    +) -> Result<Api<State, Error>, ApiError>where
    +    State: 'static + Send + Sync + ReadState,
    +    <State as ReadState>::State: Send + Sync + NodeDataSource<Types>,
    \ No newline at end of file diff --git a/hotshot_query_service/node/index.html b/hotshot_query_service/node/index.html new file mode 100644 index 000000000..2f001d9c7 --- /dev/null +++ b/hotshot_query_service/node/index.html @@ -0,0 +1,9 @@ +hotshot_query_service::node - Rust
    Expand description

    A node’s view of a HotShot chain

    +

    The node API provides a subjective view of the HotShot blockchain, from the perspective of +one particular node. It provides access to information that the +availability API does not, because this information depends on the +perspective of the node observing it, and may be subject to eventual consistency. For example, +/node/block-height and /node/proposals/:proposer_id/count may both return smaller counts +than expected, if the node being queried is not fully synced with the entire history of the +chain. However, the node will eventually sync and return the expected counts.

    +

    Re-exports

    Structs

    Enums

    Traits

    Functions

    \ No newline at end of file diff --git a/hotshot_query_service/node/sidebar-items.js b/hotshot_query_service/node/sidebar-items.js new file mode 100644 index 000000000..1b95c1e9e --- /dev/null +++ b/hotshot_query_service/node/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"enum":["Error"],"fn":["define_api"],"struct":["CustomSnafu","InvalidSignatureKeySnafu","Options","QueryProposalsSnafu","QuerySnafu","RequestSnafu"],"trait":["NodeDataSource","UpdateNodeData"]}; \ No newline at end of file diff --git a/hotshot_query_service/availability/struct.LeafStreamSnafu.html b/hotshot_query_service/node/struct.CustomSnafu.html similarity index 84% rename from hotshot_query_service/availability/struct.LeafStreamSnafu.html rename to hotshot_query_service/node/struct.CustomSnafu.html index 924b6fbe7..99d59f1bc 100644 --- a/hotshot_query_service/availability/struct.LeafStreamSnafu.html +++ b/hotshot_query_service/node/struct.CustomSnafu.html @@ -1,25 +1,25 @@ -LeafStreamSnafu in hotshot_query_service::availability - Rust
    pub struct LeafStreamSnafu<__T0, __T1> {
    -    pub height: __T0,
    -    pub reason: __T1,
    -}
    Expand description

    SNAFU context selector for the Error::LeafStream variant

    -

    Fields§

    §height: __T0§reason: __T1

    Implementations§

    source§

    impl<__T0, __T1> LeafStreamSnafu<__T0, __T1>

    source

    pub fn build(self) -> Errorwhere - __T0: Into<usize>, - __T1: Into<String>,

    Consume the selector and return the associated error

    -
    source

    pub fn fail<__T>(self) -> Result<__T, Error>where - __T0: Into<usize>, - __T1: Into<String>,

    Consume the selector and return a Result with the associated error

    -

    Trait Implementations§

    source§

    impl<__T0: Clone, __T1: Clone> Clone for LeafStreamSnafu<__T0, __T1>

    source§

    fn clone(&self) -> LeafStreamSnafu<__T0, __T1>

    Returns a copy of the value. Read more
    1.0.0 · source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    source§

    impl<__T0: Debug, __T1: Debug> Debug for LeafStreamSnafu<__T0, __T1>

    source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    source§

    impl<__T0, __T1> IntoError<Error> for LeafStreamSnafu<__T0, __T1>where - Error: Error + ErrorCompat, - __T0: Into<usize>, - __T1: Into<String>,

    §

    type Source = NoneError

    The underlying error
    source§

    fn into_error(self, error: Self::Source) -> Error

    Combine the information to produce the error
    source§

    impl<__T0: Copy, __T1: Copy> Copy for LeafStreamSnafu<__T0, __T1>

    Auto Trait Implementations§

    §

    impl<__T0, __T1> RefUnwindSafe for LeafStreamSnafu<__T0, __T1>where +CustomSnafu in hotshot_query_service::node - Rust
    pub struct CustomSnafu<__T0, __T1> {
    +    pub message: __T0,
    +    pub status: __T1,
    +}
    Expand description

    SNAFU context selector for the Error::Custom variant

    +

    Fields§

    §message: __T0§status: __T1

    Implementations§

    source§

    impl<__T0, __T1> CustomSnafu<__T0, __T1>

    source

    pub fn build(self) -> Errorwhere + __T0: Into<String>, + __T1: Into<StatusCode>,

    Consume the selector and return the associated error

    +
    source

    pub fn fail<__T>(self) -> Result<__T, Error>where + __T0: Into<String>, + __T1: Into<StatusCode>,

    Consume the selector and return a Result with the associated error

    +

    Trait Implementations§

    source§

    impl<__T0: Clone, __T1: Clone> Clone for CustomSnafu<__T0, __T1>

    source§

    fn clone(&self) -> CustomSnafu<__T0, __T1>

    Returns a copy of the value. Read more
    1.0.0 · source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    source§

    impl<__T0: Debug, __T1: Debug> Debug for CustomSnafu<__T0, __T1>

    source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    source§

    impl<__T0, __T1> IntoError<Error> for CustomSnafu<__T0, __T1>where + Error: Error + ErrorCompat, + __T0: Into<String>, + __T1: Into<StatusCode>,

    §

    type Source = NoneError

    The underlying error
    source§

    fn into_error(self, error: Self::Source) -> Error

    Combine the information to produce the error
    source§

    impl<__T0: Copy, __T1: Copy> Copy for CustomSnafu<__T0, __T1>

    Auto Trait Implementations§

    §

    impl<__T0, __T1> RefUnwindSafe for CustomSnafu<__T0, __T1>where __T0: RefUnwindSafe, - __T1: RefUnwindSafe,

    §

    impl<__T0, __T1> Send for LeafStreamSnafu<__T0, __T1>where + __T1: RefUnwindSafe,

    §

    impl<__T0, __T1> Send for CustomSnafu<__T0, __T1>where __T0: Send, - __T1: Send,

    §

    impl<__T0, __T1> Sync for LeafStreamSnafu<__T0, __T1>where + __T1: Send,

    §

    impl<__T0, __T1> Sync for CustomSnafu<__T0, __T1>where __T0: Sync, - __T1: Sync,

    §

    impl<__T0, __T1> Unpin for LeafStreamSnafu<__T0, __T1>where + __T1: Sync,

    §

    impl<__T0, __T1> Unpin for CustomSnafu<__T0, __T1>where __T0: Unpin, - __T1: Unpin,

    §

    impl<__T0, __T1> UnwindSafe for LeafStreamSnafu<__T0, __T1>where + __T1: Unpin,

    §

    impl<__T0, __T1> UnwindSafe for CustomSnafu<__T0, __T1>where __T0: UnwindSafe, __T1: UnwindSafe,

    Blanket Implementations§

    source§

    impl<T> Any for Twhere T: 'static + ?Sized,

    source§

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    §

    impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere diff --git a/hotshot_query_service/availability/struct.InvalidSignatureKeySnafu.html b/hotshot_query_service/node/struct.InvalidSignatureKeySnafu.html similarity index 84% rename from hotshot_query_service/availability/struct.InvalidSignatureKeySnafu.html rename to hotshot_query_service/node/struct.InvalidSignatureKeySnafu.html index be234cf2a..38c7da710 100644 --- a/hotshot_query_service/availability/struct.InvalidSignatureKeySnafu.html +++ b/hotshot_query_service/node/struct.InvalidSignatureKeySnafu.html @@ -1,8 +1,8 @@ -InvalidSignatureKeySnafu in hotshot_query_service::availability - Rust
    pub struct InvalidSignatureKeySnafu;
    Expand description

    SNAFU context selector for the Error::InvalidSignatureKey variant

    -

    Implementations§

    source§

    impl InvalidSignatureKeySnafu

    source

    pub fn build(self) -> Error

    Consume the selector and return the associated error

    -
    source

    pub fn fail<__T>(self) -> Result<__T, Error>

    Consume the selector and return a Result with the associated error

    -

    Trait Implementations§

    source§

    impl Clone for InvalidSignatureKeySnafu

    source§

    fn clone(&self) -> InvalidSignatureKeySnafu

    Returns a copy of the value. Read more
    1.0.0 · source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    source§

    impl Debug for InvalidSignatureKeySnafu

    source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    source§

    impl IntoError<Error> for InvalidSignatureKeySnafuwhere - Error: Error + ErrorCompat,

    §

    type Source = NoneError

    The underlying error
    source§

    fn into_error(self, error: Self::Source) -> Error

    Combine the information to produce the error
    source§

    impl Copy for InvalidSignatureKeySnafu

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for Twhere +InvalidSignatureKeySnafu in hotshot_query_service::node - Rust
    pub struct InvalidSignatureKeySnafu;
    Expand description

    SNAFU context selector for the Error::InvalidSignatureKey variant

    +

    Implementations§

    source§

    impl InvalidSignatureKeySnafu

    source

    pub fn build(self) -> Error

    Consume the selector and return the associated error

    +
    source

    pub fn fail<__T>(self) -> Result<__T, Error>

    Consume the selector and return a Result with the associated error

    +

    Trait Implementations§

    source§

    impl Clone for InvalidSignatureKeySnafu

    source§

    fn clone(&self) -> InvalidSignatureKeySnafu

    Returns a copy of the value. Read more
    1.0.0 · source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    source§

    impl Debug for InvalidSignatureKeySnafu

    source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    source§

    impl IntoError<Error> for InvalidSignatureKeySnafuwhere + Error: Error + ErrorCompat,

    §

    type Source = NoneError

    The underlying error
    source§

    fn into_error(self, error: Self::Source) -> Error

    Combine the information to produce the error
    source§

    impl Copy for InvalidSignatureKeySnafu

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for Twhere T: 'static + ?Sized,

    source§

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    §

    impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere T: 'a,

    §

    fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

    §

    impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere T: 'a,

    §

    fn implicit( diff --git a/hotshot_query_service/node/struct.Options.html b/hotshot_query_service/node/struct.Options.html new file mode 100644 index 000000000..c169a8dcb --- /dev/null +++ b/hotshot_query_service/node/struct.Options.html @@ -0,0 +1,141 @@ +Options in hotshot_query_service::node - Rust
    pub struct Options {
    +    pub api_path: Option<PathBuf>,
    +    pub extensions: Vec<Value>,
    +}

    Fields§

    §api_path: Option<PathBuf>§extensions: Vec<Value>

    Additional API specification files to merge with node-api-path.

    +

    These optional files may contain route definitions for application-specific routes that have +been added as extensions to the basic node API.

    +

    Trait Implementations§

    source§

    impl Args for Options

    source§

    fn group_id() -> Option<Id>

    Report the [ArgGroup::id][crate::ArgGroup::id] for this set of arguments
    source§

    fn augment_args<'b>(__clap_app: Command) -> Command

    Append to [Command] so it can instantiate Self. Read more
    source§

    fn augment_args_for_update<'b>(__clap_app: Command) -> Command

    Append to [Command] so it can update self. Read more
    source§

    impl Default for Options

    source§

    fn default() -> Options

    Returns the “default value” for a type. Read more
    source§

    impl FromArgMatches for Options

    source§

    fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

    Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
    source§

    fn from_arg_matches_mut( + __clap_arg_matches: &mut ArgMatches +) -> Result<Self, Error>

    Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
    source§

    fn update_from_arg_matches( + &mut self, + __clap_arg_matches: &ArgMatches +) -> Result<(), Error>

    Assign values from ArgMatches to self.
    source§

    fn update_from_arg_matches_mut( + &mut self, + __clap_arg_matches: &mut ArgMatches +) -> Result<(), Error>

    Assign values from ArgMatches to self.

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for Twhere + T: 'static + ?Sized,

    source§

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    §

    impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere + T: 'a,

    §

    fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

    §

    impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere + T: 'a,

    §

    fn implicit( + self, + class: Class, + constructed: bool, + tag: u32 +) -> TaggedParser<'a, Implicit, Self, E>

    source§

    impl<T> Borrow<T> for Twhere + T: ?Sized,

    source§

    fn borrow(&self) -> &T

    Immutably borrows from an owned value. Read more
    source§

    impl<T> BorrowMut<T> for Twhere + T: ?Sized,

    source§

    fn borrow_mut(&mut self) -> &mut T

    Mutably borrows from an owned value. Read more
    §

    impl<T> Conv for T

    §

    fn conv<T>(self) -> Twhere + Self: Into<T>,

    Converts self into T using Into<T>. Read more
    §

    impl<T> Downcast for Twhere + T: Any,

    §

    fn into_any(self: Box<T>) -> Box<dyn Any>

    Convert Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can +then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.
    §

    fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>

    Convert Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be +further downcast into Rc<ConcreteType> where ConcreteType implements Trait.
    §

    fn as_any(&self) -> &(dyn Any + 'static)

    Convert &Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot +generate &Any’s vtable from &Trait’s.
    §

    fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)

    Convert &mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot +generate &mut Any’s vtable from &mut Trait’s.
    §

    impl<T> DowncastSync for Twhere + T: Any + Send + Sync,

    §

    fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync>

    Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be +further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
    §

    impl<T> FmtForward for T

    §

    fn fmt_binary(self) -> FmtBinary<Self>where + Self: Binary,

    Causes self to use its Binary implementation when Debug-formatted.
    §

    fn fmt_display(self) -> FmtDisplay<Self>where + Self: Display,

    Causes self to use its Display implementation when +Debug-formatted.
    §

    fn fmt_lower_exp(self) -> FmtLowerExp<Self>where + Self: LowerExp,

    Causes self to use its LowerExp implementation when +Debug-formatted.
    §

    fn fmt_lower_hex(self) -> FmtLowerHex<Self>where + Self: LowerHex,

    Causes self to use its LowerHex implementation when +Debug-formatted.
    §

    fn fmt_octal(self) -> FmtOctal<Self>where + Self: Octal,

    Causes self to use its Octal implementation when Debug-formatted.
    §

    fn fmt_pointer(self) -> FmtPointer<Self>where + Self: Pointer,

    Causes self to use its Pointer implementation when +Debug-formatted.
    §

    fn fmt_upper_exp(self) -> FmtUpperExp<Self>where + Self: UpperExp,

    Causes self to use its UpperExp implementation when +Debug-formatted.
    §

    fn fmt_upper_hex(self) -> FmtUpperHex<Self>where + Self: UpperHex,

    Causes self to use its UpperHex implementation when +Debug-formatted.
    §

    fn fmt_list(self) -> FmtList<Self>where + &'a Self: for<'a> IntoIterator,

    Formats each item in a sequence. Read more
    source§

    impl<T> From<T> for T

    source§

    fn from(t: T) -> T

    Returns the argument unchanged.

    +
    §

    impl<T> Instrument for T

    §

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

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

    fn in_current_span(self) -> Instrumented<Self>

    Instruments this type with the current Span, returning an +Instrumented wrapper. Read more
    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 Twhere + 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.

    +
    §

    impl<D> OwoColorize for D

    §

    fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where + C: Color,

    Set the foreground color generically Read more
    §

    fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where + C: Color,

    Set the background color generically. Read more
    §

    fn black<'a>(&'a self) -> FgColorDisplay<'a, Black, Self>

    Change the foreground color to black
    §

    fn on_black<'a>(&'a self) -> BgColorDisplay<'a, Black, Self>

    Change the background color to black
    §

    fn red<'a>(&'a self) -> FgColorDisplay<'a, Red, Self>

    Change the foreground color to red
    §

    fn on_red<'a>(&'a self) -> BgColorDisplay<'a, Red, Self>

    Change the background color to red
    §

    fn green<'a>(&'a self) -> FgColorDisplay<'a, Green, Self>

    Change the foreground color to green
    §

    fn on_green<'a>(&'a self) -> BgColorDisplay<'a, Green, Self>

    Change the background color to green
    §

    fn yellow<'a>(&'a self) -> FgColorDisplay<'a, Yellow, Self>

    Change the foreground color to yellow
    §

    fn on_yellow<'a>(&'a self) -> BgColorDisplay<'a, Yellow, Self>

    Change the background color to yellow
    §

    fn blue<'a>(&'a self) -> FgColorDisplay<'a, Blue, Self>

    Change the foreground color to blue
    §

    fn on_blue<'a>(&'a self) -> BgColorDisplay<'a, Blue, Self>

    Change the background color to blue
    §

    fn magenta<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>

    Change the foreground color to magenta
    §

    fn on_magenta<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>

    Change the background color to magenta
    §

    fn purple<'a>(&'a self) -> FgColorDisplay<'a, Magenta, Self>

    Change the foreground color to purple
    §

    fn on_purple<'a>(&'a self) -> BgColorDisplay<'a, Magenta, Self>

    Change the background color to purple
    §

    fn cyan<'a>(&'a self) -> FgColorDisplay<'a, Cyan, Self>

    Change the foreground color to cyan
    §

    fn on_cyan<'a>(&'a self) -> BgColorDisplay<'a, Cyan, Self>

    Change the background color to cyan
    §

    fn white<'a>(&'a self) -> FgColorDisplay<'a, White, Self>

    Change the foreground color to white
    §

    fn on_white<'a>(&'a self) -> BgColorDisplay<'a, White, Self>

    Change the background color to white
    §

    fn default_color<'a>(&'a self) -> FgColorDisplay<'a, Default, Self>

    Change the foreground color to the terminal default
    §

    fn on_default_color<'a>(&'a self) -> BgColorDisplay<'a, Default, Self>

    Change the background color to the terminal default
    §

    fn bright_black<'a>(&'a self) -> FgColorDisplay<'a, BrightBlack, Self>

    Change the foreground color to bright black
    §

    fn on_bright_black<'a>(&'a self) -> BgColorDisplay<'a, BrightBlack, Self>

    Change the background color to bright black
    §

    fn bright_red<'a>(&'a self) -> FgColorDisplay<'a, BrightRed, Self>

    Change the foreground color to bright red
    §

    fn on_bright_red<'a>(&'a self) -> BgColorDisplay<'a, BrightRed, Self>

    Change the background color to bright red
    §

    fn bright_green<'a>(&'a self) -> FgColorDisplay<'a, BrightGreen, Self>

    Change the foreground color to bright green
    §

    fn on_bright_green<'a>(&'a self) -> BgColorDisplay<'a, BrightGreen, Self>

    Change the background color to bright green
    §

    fn bright_yellow<'a>(&'a self) -> FgColorDisplay<'a, BrightYellow, Self>

    Change the foreground color to bright yellow
    §

    fn on_bright_yellow<'a>(&'a self) -> BgColorDisplay<'a, BrightYellow, Self>

    Change the background color to bright yellow
    §

    fn bright_blue<'a>(&'a self) -> FgColorDisplay<'a, BrightBlue, Self>

    Change the foreground color to bright blue
    §

    fn on_bright_blue<'a>(&'a self) -> BgColorDisplay<'a, BrightBlue, Self>

    Change the background color to bright blue
    §

    fn bright_magenta<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>

    Change the foreground color to bright magenta
    §

    fn on_bright_magenta<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>

    Change the background color to bright magenta
    §

    fn bright_purple<'a>(&'a self) -> FgColorDisplay<'a, BrightMagenta, Self>

    Change the foreground color to bright purple
    §

    fn on_bright_purple<'a>(&'a self) -> BgColorDisplay<'a, BrightMagenta, Self>

    Change the background color to bright purple
    §

    fn bright_cyan<'a>(&'a self) -> FgColorDisplay<'a, BrightCyan, Self>

    Change the foreground color to bright cyan
    §

    fn on_bright_cyan<'a>(&'a self) -> BgColorDisplay<'a, BrightCyan, Self>

    Change the background color to bright cyan
    §

    fn bright_white<'a>(&'a self) -> FgColorDisplay<'a, BrightWhite, Self>

    Change the foreground color to bright white
    §

    fn on_bright_white<'a>(&'a self) -> BgColorDisplay<'a, BrightWhite, Self>

    Change the background color to bright white
    §

    fn bold<'a>(&'a self) -> BoldDisplay<'a, Self>

    Make the text bold
    §

    fn dimmed<'a>(&'a self) -> DimDisplay<'a, Self>

    Make the text dim
    §

    fn italic<'a>(&'a self) -> ItalicDisplay<'a, Self>

    Make the text italicized
    §

    fn underline<'a>(&'a self) -> UnderlineDisplay<'a, Self>

    Make the text italicized
    Make the text blink
    Make the text blink (but fast!)
    §

    fn reversed<'a>(&'a self) -> ReversedDisplay<'a, Self>

    Swap the foreground and background colors
    §

    fn hidden<'a>(&'a self) -> HiddenDisplay<'a, Self>

    Hide the text
    §

    fn strikethrough<'a>(&'a self) -> StrikeThroughDisplay<'a, Self>

    Cross out the text
    §

    fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where + Color: DynColor,

    Set the foreground color at runtime. Only use if you do not know which color will be used at +compile-time. If the color is constant, use either OwoColorize::fg or +a color-specific method, such as OwoColorize::green, Read more
    §

    fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where + Color: DynColor,

    Set the background color at runtime. Only use if you do not know what color to use at +compile-time. If the color is constant, use either OwoColorize::bg or +a color-specific method, such as OwoColorize::on_yellow, Read more
    §

    fn fg_rgb<const R: u8, const G: u8, const B: u8>( + &self +) -> FgColorDisplay<'_, CustomColor<R, G, B>, Self>

    Set the foreground color to a specific RGB value.
    §

    fn bg_rgb<const R: u8, const G: u8, const B: u8>( + &self +) -> BgColorDisplay<'_, CustomColor<R, G, B>, Self>

    Set the background color to a specific RGB value.
    §

    fn truecolor(&self, r: u8, g: u8, b: u8) -> FgDynColorDisplay<'_, Rgb, Self>

    Sets the foreground color to an RGB value.
    §

    fn on_truecolor(&self, r: u8, g: u8, b: u8) -> BgDynColorDisplay<'_, Rgb, Self>

    Sets the background color to an RGB value.
    §

    fn style(&self, style: Style) -> Styled<&Self>

    Apply a runtime-determined style
    §

    impl<T> Pipe for Twhere + T: ?Sized,

    §

    fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere + Self: Sized,

    Pipes by value. This is generally the method you want to use. Read more
    §

    fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere + R: 'a,

    Borrows self and passes that borrow into the pipe function. Read more
    §

    fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere + R: 'a,

    Mutably borrows self and passes that borrow into the pipe function. Read more
    §

    fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> Rwhere + Self: Borrow<B>, + B: 'a + ?Sized, + R: 'a,

    Borrows self, then passes self.borrow() into the pipe function. Read more
    §

    fn pipe_borrow_mut<'a, B, R>( + &'a mut self, + func: impl FnOnce(&'a mut B) -> R +) -> Rwhere + Self: BorrowMut<B>, + B: 'a + ?Sized, + R: 'a,

    Mutably borrows self, then passes self.borrow_mut() into the pipe +function. Read more
    §

    fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> Rwhere + Self: AsRef<U>, + U: 'a + ?Sized, + R: 'a,

    Borrows self, then passes self.as_ref() into the pipe function.
    §

    fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> Rwhere + Self: AsMut<U>, + U: 'a + ?Sized, + R: 'a,

    Mutably borrows self, then passes self.as_mut() into the pipe +function.
    §

    fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> Rwhere + Self: Deref<Target = T>, + T: 'a + ?Sized, + R: 'a,

    Borrows self, then passes self.deref() into the pipe function.
    §

    fn pipe_deref_mut<'a, T, R>( + &'a mut self, + func: impl FnOnce(&'a mut T) -> R +) -> Rwhere + Self: DerefMut<Target = T> + Deref, + T: 'a + ?Sized, + R: 'a,

    Mutably borrows self, then passes self.deref_mut() into the pipe +function.
    §

    impl<T> Pointable for T

    §

    const ALIGN: usize = _

    The alignment of pointer.
    §

    type Init = T

    The type for initializers.
    §

    unsafe fn init(init: <T as Pointable>::Init) -> usize

    Initializes a with the given initializer. Read more
    §

    unsafe fn deref<'a>(ptr: usize) -> &'a T

    Dereferences the given pointer. Read more
    §

    unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

    Mutably dereferences the given pointer. Read more
    §

    unsafe fn drop(ptr: usize)

    Drops the object pointed to by the given pointer. Read more
    source§

    impl<T> Same for T

    §

    type Output = T

    Should always be Self
    §

    impl<T> Tap for T

    §

    fn tap(self, func: impl FnOnce(&Self)) -> Self

    Immutable access to a value. Read more
    §

    fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

    Mutable access to a value. Read more
    §

    fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Selfwhere + Self: Borrow<B>, + B: ?Sized,

    Immutable access to the Borrow<B> of a value. Read more
    §

    fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere + Self: BorrowMut<B>, + B: ?Sized,

    Mutable access to the BorrowMut<B> of a value. Read more
    §

    fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Selfwhere + Self: AsRef<R>, + R: ?Sized,

    Immutable access to the AsRef<R> view of a value. Read more
    §

    fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere + Self: AsMut<R>, + R: ?Sized,

    Mutable access to the AsMut<R> view of a value. Read more
    §

    fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Selfwhere + Self: Deref<Target = T>, + T: ?Sized,

    Immutable access to the Deref::Target of a value. Read more
    §

    fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Selfwhere + Self: DerefMut<Target = T> + Deref, + T: ?Sized,

    Mutable access to the Deref::Target of a value. Read more
    §

    fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

    Calls .tap() only in debug builds, and is erased in release builds.
    §

    fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

    Calls .tap_mut() only in debug builds, and is erased in release +builds.
    §

    fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Selfwhere + Self: Borrow<B>, + B: ?Sized,

    Calls .tap_borrow() only in debug builds, and is erased in release +builds.
    §

    fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Selfwhere + Self: BorrowMut<B>, + B: ?Sized,

    Calls .tap_borrow_mut() only in debug builds, and is erased in release +builds.
    §

    fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Selfwhere + Self: AsRef<R>, + R: ?Sized,

    Calls .tap_ref() only in debug builds, and is erased in release +builds.
    §

    fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Selfwhere + Self: AsMut<R>, + R: ?Sized,

    Calls .tap_ref_mut() only in debug builds, and is erased in release +builds.
    §

    fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Selfwhere + Self: Deref<Target = T>, + T: ?Sized,

    Calls .tap_deref() only in debug builds, and is erased in release +builds.
    §

    fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Selfwhere + Self: DerefMut<Target = T> + Deref, + T: ?Sized,

    Calls .tap_deref_mut() only in debug builds, and is erased in release +builds.
    §

    impl<T> TryConv for T

    §

    fn try_conv<T>(self) -> Result<T, Self::Error>where + Self: TryInto<T>,

    Attempts to convert self into T using TryInto<T>. Read more
    source§

    impl<T, U> TryFrom<U> for Twhere + U: Into<T>,

    §

    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 Twhere + U: TryFrom<T>,

    §

    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.
    §

    impl<V, T> VZip<V> for Twhere + V: MultiLane<T>,

    §

    fn vzip(self) -> V

    §

    impl<T> WithSubscriber for T

    §

    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
    §

    fn with_current_subscriber(self) -> WithDispatch<Self>

    Attaches the current default Subscriber to this type, returning a +[WithDispatch] wrapper. Read more
    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
    \ No newline at end of file diff --git a/hotshot_query_service/availability/struct.QueryProposalsSnafu.html b/hotshot_query_service/node/struct.QueryProposalsSnafu.html similarity index 87% rename from hotshot_query_service/availability/struct.QueryProposalsSnafu.html rename to hotshot_query_service/node/struct.QueryProposalsSnafu.html index a695c82a2..cbec1526e 100644 --- a/hotshot_query_service/availability/struct.QueryProposalsSnafu.html +++ b/hotshot_query_service/node/struct.QueryProposalsSnafu.html @@ -1,13 +1,13 @@ -QueryProposalsSnafu in hotshot_query_service::availability - Rust
    pub struct QueryProposalsSnafu<__T0> {
    +QueryProposalsSnafu in hotshot_query_service::node - Rust
    pub struct QueryProposalsSnafu<__T0> {
         pub proposer: __T0,
     }
    Expand description

    SNAFU context selector for the Error::QueryProposals variant

    -

    Fields§

    §proposer: __T0

    Trait Implementations§

    source§

    impl<__T0: Clone> Clone for QueryProposalsSnafu<__T0>

    source§

    fn clone(&self) -> QueryProposalsSnafu<__T0>

    Returns a copy of the value. Read more
    1.0.0 · source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    source§

    impl<__T0: Debug> Debug for QueryProposalsSnafu<__T0>

    source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    source§

    impl<__T0> IntoError<Error> for QueryProposalsSnafu<__T0>where - Error: Error + ErrorCompat, - __T0: Into<EncodedPublicKey>,

    §

    type Source = QueryError

    The underlying error
    source§

    fn into_error(self, error: Self::Source) -> Error

    Combine the information to produce the error
    source§

    impl<__T0: Copy> Copy for QueryProposalsSnafu<__T0>

    Auto Trait Implementations§

    §

    impl<__T0> RefUnwindSafe for QueryProposalsSnafu<__T0>where - __T0: RefUnwindSafe,

    §

    impl<__T0> Send for QueryProposalsSnafu<__T0>where - __T0: Send,

    §

    impl<__T0> Sync for QueryProposalsSnafu<__T0>where - __T0: Sync,

    §

    impl<__T0> Unpin for QueryProposalsSnafu<__T0>where - __T0: Unpin,

    §

    impl<__T0> UnwindSafe for QueryProposalsSnafu<__T0>where +

    Fields§

    §proposer: __T0

    Trait Implementations§

    source§

    impl<__T0: Clone> Clone for QueryProposalsSnafu<__T0>

    source§

    fn clone(&self) -> QueryProposalsSnafu<__T0>

    Returns a copy of the value. Read more
    1.0.0 · source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    source§

    impl<__T0: Debug> Debug for QueryProposalsSnafu<__T0>

    source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    source§

    impl<__T0> IntoError<Error> for QueryProposalsSnafu<__T0>where + Error: Error + ErrorCompat, + __T0: Into<EncodedPublicKey>,

    §

    type Source = QueryError

    The underlying error
    source§

    fn into_error(self, error: Self::Source) -> Error

    Combine the information to produce the error
    source§

    impl<__T0: Copy> Copy for QueryProposalsSnafu<__T0>

    Auto Trait Implementations§

    §

    impl<__T0> RefUnwindSafe for QueryProposalsSnafu<__T0>where + __T0: RefUnwindSafe,

    §

    impl<__T0> Send for QueryProposalsSnafu<__T0>where + __T0: Send,

    §

    impl<__T0> Sync for QueryProposalsSnafu<__T0>where + __T0: Sync,

    §

    impl<__T0> Unpin for QueryProposalsSnafu<__T0>where + __T0: Unpin,

    §

    impl<__T0> UnwindSafe for QueryProposalsSnafu<__T0>where __T0: UnwindSafe,

    Blanket Implementations§

    source§

    impl<T> Any for Twhere T: 'static + ?Sized,

    source§

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    §

    impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere T: 'a,

    §

    fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

    §

    impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere diff --git a/hotshot_query_service/availability/struct.StreamLeafSnafu.html b/hotshot_query_service/node/struct.QuerySnafu.html similarity index 85% rename from hotshot_query_service/availability/struct.StreamLeafSnafu.html rename to hotshot_query_service/node/struct.QuerySnafu.html index c261169de..a7d7c9989 100644 --- a/hotshot_query_service/availability/struct.StreamLeafSnafu.html +++ b/hotshot_query_service/node/struct.QuerySnafu.html @@ -1,6 +1,6 @@ -StreamLeafSnafu in hotshot_query_service::availability - Rust
    pub struct StreamLeafSnafu;
    Expand description

    SNAFU context selector for the Error::StreamLeaf variant

    -

    Trait Implementations§

    source§

    impl Clone for StreamLeafSnafu

    source§

    fn clone(&self) -> StreamLeafSnafu

    Returns a copy of the value. Read more
    1.0.0 · source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    source§

    impl Debug for StreamLeafSnafu

    source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    source§

    impl IntoError<Error> for StreamLeafSnafuwhere - Error: Error + ErrorCompat,

    §

    type Source = QueryError

    The underlying error
    source§

    fn into_error(self, error: Self::Source) -> Error

    Combine the information to produce the error
    source§

    impl Copy for StreamLeafSnafu

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for Twhere +QuerySnafu in hotshot_query_service::node - Rust
    pub struct QuerySnafu;
    Expand description

    SNAFU context selector for the Error::Query variant

    +

    Trait Implementations§

    source§

    impl Clone for QuerySnafu

    source§

    fn clone(&self) -> QuerySnafu

    Returns a copy of the value. Read more
    1.0.0 · source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    source§

    impl Debug for QuerySnafu

    source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    source§

    impl IntoError<Error> for QuerySnafuwhere + Error: Error + ErrorCompat,

    §

    type Source = QueryError

    The underlying error
    source§

    fn into_error(self, error: Self::Source) -> Error

    Combine the information to produce the error
    source§

    impl Copy for QuerySnafu

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for Twhere T: 'static + ?Sized,

    source§

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    §

    impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere T: 'a,

    §

    fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

    §

    impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere T: 'a,

    §

    fn implicit( diff --git a/hotshot_query_service/availability/struct.StreamBlockSnafu.html b/hotshot_query_service/node/struct.RequestSnafu.html similarity index 87% rename from hotshot_query_service/availability/struct.StreamBlockSnafu.html rename to hotshot_query_service/node/struct.RequestSnafu.html index d0ce832e8..5789ed046 100644 --- a/hotshot_query_service/availability/struct.StreamBlockSnafu.html +++ b/hotshot_query_service/node/struct.RequestSnafu.html @@ -1,6 +1,6 @@ -StreamBlockSnafu in hotshot_query_service::availability - Rust
    pub struct StreamBlockSnafu;
    Expand description

    SNAFU context selector for the Error::StreamBlock variant

    -

    Trait Implementations§

    source§

    impl Clone for StreamBlockSnafu

    source§

    fn clone(&self) -> StreamBlockSnafu

    Returns a copy of the value. Read more
    1.0.0 · source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    source§

    impl Debug for StreamBlockSnafu

    source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    source§

    impl IntoError<Error> for StreamBlockSnafuwhere - Error: Error + ErrorCompat,

    §

    type Source = QueryError

    The underlying error
    source§

    fn into_error(self, error: Self::Source) -> Error

    Combine the information to produce the error
    source§

    impl Copy for StreamBlockSnafu

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for Twhere +RequestSnafu in hotshot_query_service::node - Rust
    pub struct RequestSnafu;
    Expand description

    SNAFU context selector for the Error::Request variant

    +

    Trait Implementations§

    source§

    impl Clone for RequestSnafu

    source§

    fn clone(&self) -> RequestSnafu

    Returns a copy of the value. Read more
    1.0.0 · source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    source§

    impl Debug for RequestSnafu

    source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    source§

    impl IntoError<Error> for RequestSnafuwhere + Error: Error + ErrorCompat,

    §

    type Source = RequestError

    The underlying error
    source§

    fn into_error(self, error: Self::Source) -> Error

    Combine the information to produce the error
    source§

    impl Copy for RequestSnafu

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for Twhere T: 'static + ?Sized,

    source§

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    §

    impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere T: 'a,

    §

    fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

    §

    impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere T: 'a,

    §

    fn implicit( diff --git a/hotshot_query_service/node/trait.NodeDataSource.html b/hotshot_query_service/node/trait.NodeDataSource.html new file mode 100644 index 000000000..83c5e4978 --- /dev/null +++ b/hotshot_query_service/node/trait.NodeDataSource.html @@ -0,0 +1,48 @@ +NodeDataSource in hotshot_query_service::node - Rust
    pub trait NodeDataSource<Types: NodeType> {
    +    // Required methods
    +    fn block_height<'life0, 'async_trait>(
    +        &'life0 self
    +    ) -> Pin<Box<dyn Future<Output = QueryResult<usize>> + Send + 'async_trait>>
    +       where Self: 'async_trait,
    +             'life0: 'async_trait;
    +    fn get_proposals<'life0, 'life1, 'async_trait>(
    +        &'life0 self,
    +        proposer: &'life1 SignatureKey<Types>,
    +        limit: Option<usize>
    +    ) -> Pin<Box<dyn Future<Output = QueryResult<Vec<LeafQueryData<Types>>>> + Send + 'async_trait>>
    +       where Self: 'async_trait,
    +             'life0: 'async_trait,
    +             'life1: 'async_trait;
    +    fn count_proposals<'life0, 'life1, 'async_trait>(
    +        &'life0 self,
    +        proposer: &'life1 SignatureKey<Types>
    +    ) -> Pin<Box<dyn Future<Output = QueryResult<usize>> + Send + 'async_trait>>
    +       where Self: 'async_trait,
    +             'life0: 'async_trait,
    +             'life1: 'async_trait;
    +}

    Required Methods§

    source

    fn block_height<'life0, 'async_trait>( + &'life0 self +) -> Pin<Box<dyn Future<Output = QueryResult<usize>> + Send + 'async_trait>>where + Self: 'async_trait, + 'life0: 'async_trait,

    source

    fn get_proposals<'life0, 'life1, 'async_trait>( + &'life0 self, + proposer: &'life1 SignatureKey<Types>, + limit: Option<usize> +) -> Pin<Box<dyn Future<Output = QueryResult<Vec<LeafQueryData<Types>>>> + Send + 'async_trait>>where + Self: 'async_trait, + 'life0: 'async_trait, + 'life1: 'async_trait,

    source

    fn count_proposals<'life0, 'life1, 'async_trait>( + &'life0 self, + proposer: &'life1 SignatureKey<Types> +) -> Pin<Box<dyn Future<Output = QueryResult<usize>> + Send + 'async_trait>>where + Self: 'async_trait, + 'life0: 'async_trait, + 'life1: 'async_trait,

    Implementors§

    source§

    impl<D, U, Types> NodeDataSource<Types> for ExtensibleDataSource<D, U>where + D: NodeDataSource<Types> + Send + Sync, + U: Send + Sync, + Types: NodeType,

    source§

    impl<Types> NodeDataSource<Types> for SqlStoragewhere + Types: NodeType,

    source§

    impl<Types, S, P> NodeDataSource<Types> for FetchingDataSource<Types, S, P>where + Types: NodeType, + S: NodeDataSource<Types> + Send + Sync, + P: Send + Sync,

    source§

    impl<Types: NodeType> NodeDataSource<Types> for FileSystemStorage<Types>where + Payload<Types>: QueryablePayload,

    \ No newline at end of file diff --git a/hotshot_query_service/node/trait.UpdateNodeData.html b/hotshot_query_service/node/trait.UpdateNodeData.html new file mode 100644 index 000000000..b2f5bc285 --- /dev/null +++ b/hotshot_query_service/node/trait.UpdateNodeData.html @@ -0,0 +1,24 @@ +UpdateNodeData in hotshot_query_service::node - Rust
    pub trait UpdateNodeData<Types: NodeType> {
    +    type Error: Error + Debug + Send + Sync + 'static;
    +
    +    // Required method
    +    fn insert_leaf<'life0, 'async_trait>(
    +        &'life0 mut self,
    +        leaf: LeafQueryData<Types>
    +    ) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>
    +       where Self: 'async_trait,
    +             'life0: 'async_trait;
    +}

    Required Associated Types§

    source

    type Error: Error + Debug + Send + Sync + 'static

    Required Methods§

    source

    fn insert_leaf<'life0, 'async_trait>( + &'life0 mut self, + leaf: LeafQueryData<Types> +) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where + Self: 'async_trait, + 'life0: 'async_trait,

    Implementors§

    source§

    impl<D, U, Types> UpdateNodeData<Types> for ExtensibleDataSource<D, U>where + D: UpdateNodeData<Types> + Send + Sync, + U: Send + Sync, + Types: NodeType,

    §

    type Error = <D as UpdateNodeData<Types>>::Error

    source§

    impl<Types> UpdateNodeData<Types> for SqlStoragewhere + Types: NodeType,

    source§

    impl<Types, S, P> UpdateNodeData<Types> for FetchingDataSource<Types, S, P>where + Types: NodeType, + S: UpdateNodeData<Types> + Send + Sync, + P: Send + Sync,

    §

    type Error = <S as UpdateNodeData<Types>>::Error

    source§

    impl<Types: NodeType> UpdateNodeData<Types> for FileSystemStorage<Types>where + Payload<Types>: QueryablePayload,

    §

    type Error = PersistenceError

    \ No newline at end of file diff --git a/hotshot_query_service/sidebar-items.js b/hotshot_query_service/sidebar-items.js index 7ffac8bb4..b9c0185fb 100644 --- a/hotshot_query_service/sidebar-items.js +++ b/hotshot_query_service/sidebar-items.js @@ -1 +1 @@ -window.SIDEBAR_ITEMS = {"enum":["Error","QueryError"],"fn":["run_standalone_service"],"macro":["include_migrations","instantiate_data_source_tests"],"mod":["availability","data_source","metrics","status"],"struct":["MissingSnafu","NotFoundSnafu","Options","Snafu"],"trait":["Resolvable"],"type":["Header","Metadata","Payload","QueryResult","SignatureKey","Transaction"]}; \ No newline at end of file +window.SIDEBAR_ITEMS = {"enum":["Error","QueryError"],"fn":["run_standalone_service"],"macro":["include_migrations","instantiate_data_source_tests"],"mod":["availability","data_source","metrics","node","status"],"struct":["MissingSnafu","NotFoundSnafu","Options","Snafu"],"trait":["Resolvable"],"type":["Header","Metadata","Payload","QueryResult","SignatureKey","Transaction"]}; \ No newline at end of file diff --git a/hotshot_query_service/status/enum.Error.html b/hotshot_query_service/status/enum.Error.html index 20e6d90bf..62db1ef57 100644 --- a/hotshot_query_service/status/enum.Error.html +++ b/hotshot_query_service/status/enum.Error.html @@ -1,16 +1,16 @@ -Error in hotshot_query_service::status - Rust
    pub enum Error {
    +Error in hotshot_query_service::status - Rust
    pub enum Error {
         Request {
             source: RequestError,
         },
         Internal {
             reason: String,
         },
    -}

    Variants§

    §

    Request

    Fields

    §source: RequestError
    §

    Internal

    Fields

    §reason: String

    Implementations§

    source§

    impl Error

    source

    pub fn status(&self) -> StatusCode

    Trait Implementations§

    source§

    impl Clone for Error

    source§

    fn clone(&self) -> Error

    Returns a copy of the value. Read more
    1.0.0 · source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    source§

    impl Debug for Error

    source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    source§

    impl<'de> Deserialize<'de> for Error

    source§

    fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where - __D: Deserializer<'de>,

    Deserialize this value from the given Serde deserializer. Read more
    source§

    impl Display for Error

    source§

    fn fmt(&self, __snafu_display_formatter: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    source§

    impl Error for Errorwhere - Self: Debug + Display,

    source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    source§

    fn source(&self) -> Option<&(dyn Error + 'static)>

    The lower-level source of this error, if any. Read more
    source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type based access to context intended for error reports. Read more
    source§

    impl ErrorCompat for Error

    source§

    fn backtrace(&self) -> Option<&Backtrace>

    Returns a Backtrace that may be printed.
    §

    fn iter_chain(&self) -> ChainCompat<'_>where +}

    Variants§

    §

    Request

    Fields

    §source: RequestError
    §

    Internal

    Fields

    §reason: String

    Implementations§

    source§

    impl Error

    source

    pub fn status(&self) -> StatusCode

    Trait Implementations§

    source§

    impl Clone for Error

    source§

    fn clone(&self) -> Error

    Returns a copy of the value. Read more
    1.0.0 · source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    source§

    impl Debug for Error

    source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    source§

    impl<'de> Deserialize<'de> for Error

    source§

    fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where + __D: Deserializer<'de>,

    Deserialize this value from the given Serde deserializer. Read more
    source§

    impl Display for Error

    source§

    fn fmt(&self, __snafu_display_formatter: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    source§

    impl Error for Errorwhere + Self: Debug + Display,

    source§

    fn description(&self) -> &str

    👎Deprecated since 1.42.0: use the Display impl or to_string()
    source§

    fn cause(&self) -> Option<&dyn Error>

    👎Deprecated since 1.33.0: replaced by Error::source, which can support downcasting
    source§

    fn source(&self) -> Option<&(dyn Error + 'static)>

    The lower-level source of this error, if any. Read more
    source§

    fn provide<'a>(&'a self, request: &mut Request<'a>)

    🔬This is a nightly-only experimental API. (error_generic_member_access)
    Provides type based access to context intended for error reports. Read more
    source§

    impl ErrorCompat for Error

    source§

    fn backtrace(&self) -> Option<&Backtrace>

    Returns a Backtrace that may be printed.
    §

    fn iter_chain(&self) -> ChainCompat<'_>where Self: AsErrorSource,

    Returns an iterator for traversing the chain of errors, starting with the current error -and continuing with recursive calls to Error::source. Read more
    source§

    impl From<Error> for Error

    source§

    fn from(original: Error) -> Error

    Converts to this type from the input type.
    source§

    impl From<RequestError> for Error

    source§

    fn from(original: RequestError) -> Error

    Converts to this type from the input type.
    source§

    impl From<String> for Error

    source§

    fn from(original: String) -> Error

    Converts to this type from the input type.
    source§

    impl Serialize for Error

    source§

    fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where +and continuing with recursive calls to Error::source. Read more

    source§

    impl From<Error> for Error

    source§

    fn from(original: Error) -> Error

    Converts to this type from the input type.
    source§

    impl From<RequestError> for Error

    source§

    fn from(original: RequestError) -> Error

    Converts to this type from the input type.
    source§

    impl From<String> for Error

    source§

    fn from(original: String) -> Error

    Converts to this type from the input type.
    source§

    impl Serialize for Error

    source§

    fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>where __S: Serializer,

    Serialize this value into the given Serde serializer. Read more

    Auto Trait Implementations§

    §

    impl RefUnwindSafe for Error

    §

    impl Send for Error

    §

    impl Sync for Error

    §

    impl Unpin for Error

    §

    impl UnwindSafe for Error

    Blanket Implementations§

    source§

    impl<T> Any for Twhere T: 'static + ?Sized,

    source§

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    §

    impl<T> AsErrorSource for Twhere T: Error + 'static,

    §

    fn as_error_source(&self) -> &(dyn Error + 'static)

    For maximum effectiveness, this needs to be called as a method diff --git a/hotshot_query_service/status/fn.define_api.html b/hotshot_query_service/status/fn.define_api.html index 02c67abc7..7f6198b4a 100644 --- a/hotshot_query_service/status/fn.define_api.html +++ b/hotshot_query_service/status/fn.define_api.html @@ -1,4 +1,4 @@ -define_api in hotshot_query_service::status - Rust
    pub fn define_api<State>(
    +define_api in hotshot_query_service::status - Rust
    pub fn define_api<State>(
         options: &Options
     ) -> Result<Api<State, Error>, ApiError>where
         State: 'static + Send + Sync + ReadState,
    diff --git a/hotshot_query_service/status/index.html b/hotshot_query_service/status/index.html
    index 3908fc6df..581848a84 100644
    --- a/hotshot_query_service/status/index.html
    +++ b/hotshot_query_service/status/index.html
    @@ -1 +1,14 @@
    -hotshot_query_service::status - Rust
    \ No newline at end of file +hotshot_query_service::status - Rust
    Expand description

    Queries for node-specific state and uncommitted data.

    +

    Unlike the availability and node APIs, which deal only +with committed data (albeit with different consistency properties), the status API offers a +glimpse into internal consensus state and uncommitted data. Here you can find low-level +information about a particular node, such as consensus and networking metrics. You can also find +information about pending blocks and transactions in the mempool.

    +

    The status API is intended to be a lightweight way to inspect the activities and health of a +consensus node. It is the only API that can be run without any persistent storage, and its +memory overhead is also very low. As a consequence, it only serves two types of data:

    +
      +
    • snapshots of the state right now, with no way to query historical snapshots
    • +
    • summary statistics
    • +
    +

    Structs

    Enums

    Traits

    Functions

    \ No newline at end of file diff --git a/hotshot_query_service/status/struct.Options.html b/hotshot_query_service/status/struct.Options.html index 29dbb5928..f01865a0d 100644 --- a/hotshot_query_service/status/struct.Options.html +++ b/hotshot_query_service/status/struct.Options.html @@ -1,15 +1,15 @@ -Options in hotshot_query_service::status - Rust
    pub struct Options {
    +Options in hotshot_query_service::status - Rust
    pub struct Options {
         pub api_path: Option<PathBuf>,
         pub extensions: Vec<Value>,
     }

    Fields§

    §api_path: Option<PathBuf>§extensions: Vec<Value>

    Additional API specification files to merge with status-api-path.

    These optional files may contain route definitions for application-specific routes that have been added as extensions to the basic status API.

    -

    Trait Implementations§

    source§

    impl Args for Options

    source§

    fn group_id() -> Option<Id>

    Report the [ArgGroup::id][crate::ArgGroup::id] for this set of arguments
    source§

    fn augment_args<'b>(__clap_app: Command) -> Command

    Append to [Command] so it can instantiate Self. Read more
    source§

    fn augment_args_for_update<'b>(__clap_app: Command) -> Command

    Append to [Command] so it can update self. Read more
    source§

    impl Default for Options

    source§

    fn default() -> Options

    Returns the “default value” for a type. Read more
    source§

    impl FromArgMatches for Options

    source§

    fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

    Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
    source§

    fn from_arg_matches_mut( +

    Trait Implementations§

    source§

    impl Args for Options

    source§

    fn group_id() -> Option<Id>

    Report the [ArgGroup::id][crate::ArgGroup::id] for this set of arguments
    source§

    fn augment_args<'b>(__clap_app: Command) -> Command

    Append to [Command] so it can instantiate Self. Read more
    source§

    fn augment_args_for_update<'b>(__clap_app: Command) -> Command

    Append to [Command] so it can update self. Read more
    source§

    impl Default for Options

    source§

    fn default() -> Options

    Returns the “default value” for a type. Read more
    source§

    impl FromArgMatches for Options

    source§

    fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

    Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
    source§

    fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches -) -> Result<Self, Error>

    Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
    source§

    fn update_from_arg_matches( +) -> Result<Self, Error>

    Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
    source§

    fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches -) -> Result<(), Error>

    Assign values from ArgMatches to self.
    source§

    fn update_from_arg_matches_mut( +) -> Result<(), Error>

    Assign values from ArgMatches to self.
    source§

    fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches ) -> Result<(), Error>

    Assign values from ArgMatches to self.

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for Twhere diff --git a/hotshot_query_service/status/trait.StatusDataSource.html b/hotshot_query_service/status/trait.StatusDataSource.html index a0dbcb74b..440bb9826 100644 --- a/hotshot_query_service/status/trait.StatusDataSource.html +++ b/hotshot_query_service/status/trait.StatusDataSource.html @@ -31,8 +31,9 @@ &'life0 self ) -> Pin<Box<dyn Future<Output = QueryResult<f64>> + Send + 'async_trait>>where Self: Sync + 'async_trait, - 'life0: 'async_trait,

    Implementors§

    source§

    impl StatusDataSource for MetricsDataSource

    source§

    impl<D, U> StatusDataSource for ExtensibleDataSource<D, U>where + 'life0: 'async_trait,

    Implementors§

    source§

    impl StatusDataSource for MetricsDataSource

    source§

    impl<D, U> StatusDataSource for ExtensibleDataSource<D, U>where D: StatusDataSource + Send + Sync, - U: Send + Sync,

    source§

    impl<Types> StatusDataSource for SqlDataSource<Types>where - Types: NodeType,

    source§

    impl<Types: NodeType> StatusDataSource for FileSystemDataSource<Types>where - Payload<Types>: QueryablePayload,

    \ No newline at end of file + U: Send + Sync,

    source§

    impl<Types, S, P> StatusDataSource for FetchingDataSource<Types, S, P>where + Types: NodeType, + S: NodeDataSource<Types> + Send + Sync, + P: Send + Sync,

    \ No newline at end of file diff --git a/hotshot_query_service/struct.MissingSnafu.html b/hotshot_query_service/struct.MissingSnafu.html index ca7393349..5bd4a2f44 100644 --- a/hotshot_query_service/struct.MissingSnafu.html +++ b/hotshot_query_service/struct.MissingSnafu.html @@ -1,8 +1,8 @@ -MissingSnafu in hotshot_query_service - Rust
    pub struct MissingSnafu;
    Expand description

    SNAFU context selector for the QueryError::Missing variant

    -

    Implementations§

    source§

    impl MissingSnafu

    source

    pub fn build(self) -> QueryError

    Consume the selector and return the associated error

    -
    source

    pub fn fail<__T>(self) -> Result<__T, QueryError>

    Consume the selector and return a Result with the associated error

    -

    Trait Implementations§

    source§

    impl Clone for MissingSnafu

    source§

    fn clone(&self) -> MissingSnafu

    Returns a copy of the value. Read more
    1.0.0 · source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    source§

    impl Debug for MissingSnafu

    source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    source§

    impl IntoError<QueryError> for MissingSnafuwhere - QueryError: Error + ErrorCompat,

    §

    type Source = NoneError

    The underlying error
    source§

    fn into_error(self, error: Self::Source) -> QueryError

    Combine the information to produce the error
    source§

    impl Copy for MissingSnafu

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for Twhere +MissingSnafu in hotshot_query_service - Rust
    pub struct MissingSnafu;
    Expand description

    SNAFU context selector for the QueryError::Missing variant

    +

    Implementations§

    source§

    impl MissingSnafu

    source

    pub fn build(self) -> QueryError

    Consume the selector and return the associated error

    +
    source

    pub fn fail<__T>(self) -> Result<__T, QueryError>

    Consume the selector and return a Result with the associated error

    +

    Trait Implementations§

    source§

    impl Clone for MissingSnafu

    source§

    fn clone(&self) -> MissingSnafu

    Returns a copy of the value. Read more
    1.0.0 · source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    source§

    impl Debug for MissingSnafu

    source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    source§

    impl IntoError<QueryError> for MissingSnafuwhere + QueryError: Error + ErrorCompat,

    §

    type Source = NoneError

    The underlying error
    source§

    fn into_error(self, error: Self::Source) -> QueryError

    Combine the information to produce the error
    source§

    impl Copy for MissingSnafu

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for Twhere T: 'static + ?Sized,

    source§

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    §

    impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere T: 'a,

    §

    fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

    §

    impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere T: 'a,

    §

    fn implicit( diff --git a/hotshot_query_service/struct.NotFoundSnafu.html b/hotshot_query_service/struct.NotFoundSnafu.html index f57636a18..cdbcf1ceb 100644 --- a/hotshot_query_service/struct.NotFoundSnafu.html +++ b/hotshot_query_service/struct.NotFoundSnafu.html @@ -1,8 +1,8 @@ -NotFoundSnafu in hotshot_query_service - Rust
    pub struct NotFoundSnafu;
    Expand description

    SNAFU context selector for the QueryError::NotFound variant

    -

    Implementations§

    source§

    impl NotFoundSnafu

    source

    pub fn build(self) -> QueryError

    Consume the selector and return the associated error

    -
    source

    pub fn fail<__T>(self) -> Result<__T, QueryError>

    Consume the selector and return a Result with the associated error

    -

    Trait Implementations§

    source§

    impl Clone for NotFoundSnafu

    source§

    fn clone(&self) -> NotFoundSnafu

    Returns a copy of the value. Read more
    1.0.0 · source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    source§

    impl Debug for NotFoundSnafu

    source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    source§

    impl IntoError<QueryError> for NotFoundSnafuwhere - QueryError: Error + ErrorCompat,

    §

    type Source = NoneError

    The underlying error
    source§

    fn into_error(self, error: Self::Source) -> QueryError

    Combine the information to produce the error
    source§

    impl Copy for NotFoundSnafu

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for Twhere +NotFoundSnafu in hotshot_query_service - Rust
    pub struct NotFoundSnafu;
    Expand description

    SNAFU context selector for the QueryError::NotFound variant

    +

    Implementations§

    source§

    impl NotFoundSnafu

    source

    pub fn build(self) -> QueryError

    Consume the selector and return the associated error

    +
    source

    pub fn fail<__T>(self) -> Result<__T, QueryError>

    Consume the selector and return a Result with the associated error

    +

    Trait Implementations§

    source§

    impl Clone for NotFoundSnafu

    source§

    fn clone(&self) -> NotFoundSnafu

    Returns a copy of the value. Read more
    1.0.0 · source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    source§

    impl Debug for NotFoundSnafu

    source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    source§

    impl IntoError<QueryError> for NotFoundSnafuwhere + QueryError: Error + ErrorCompat,

    §

    type Source = NoneError

    The underlying error
    source§

    fn into_error(self, error: Self::Source) -> QueryError

    Combine the information to produce the error
    source§

    impl Copy for NotFoundSnafu

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for Twhere T: 'static + ?Sized,

    source§

    fn type_id(&self) -> TypeId

    Gets the TypeId of self. Read more
    §

    impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere T: 'a,

    §

    fn explicit(self, class: Class, tag: u32) -> TaggedParser<'a, Explicit, Self, E>

    §

    impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere T: 'a,

    §

    fn implicit( diff --git a/hotshot_query_service/struct.Options.html b/hotshot_query_service/struct.Options.html index 4752be8d3..8a405342d 100644 --- a/hotshot_query_service/struct.Options.html +++ b/hotshot_query_service/struct.Options.html @@ -1,13 +1,14 @@ -Options in hotshot_query_service - Rust
    pub struct Options {
    +Options in hotshot_query_service - Rust
    pub struct Options {
         pub availability: Options,
    +    pub node: Options,
         pub status: Options,
         pub port: u16,
    -}

    Fields§

    §availability: Options§status: Options§port: u16

    Trait Implementations§

    source§

    impl Args for Options

    source§

    fn group_id() -> Option<Id>

    Report the [ArgGroup::id][crate::ArgGroup::id] for this set of arguments
    source§

    fn augment_args<'b>(__clap_app: Command) -> Command

    Append to [Command] so it can instantiate Self. Read more
    source§

    fn augment_args_for_update<'b>(__clap_app: Command) -> Command

    Append to [Command] so it can update self. Read more
    source§

    impl Default for Options

    source§

    fn default() -> Options

    Returns the “default value” for a type. Read more
    source§

    impl FromArgMatches for Options

    source§

    fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

    Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
    source§

    fn from_arg_matches_mut( +}

    Fields§

    §availability: Options§node: Options§status: Options§port: u16

    Trait Implementations§

    source§

    impl Args for Options

    source§

    fn group_id() -> Option<Id>

    Report the [ArgGroup::id][crate::ArgGroup::id] for this set of arguments
    source§

    fn augment_args<'b>(__clap_app: Command) -> Command

    Append to [Command] so it can instantiate Self. Read more
    source§

    fn augment_args_for_update<'b>(__clap_app: Command) -> Command

    Append to [Command] so it can update self. Read more
    source§

    impl Default for Options

    source§

    fn default() -> Options

    Returns the “default value” for a type. Read more
    source§

    impl FromArgMatches for Options

    source§

    fn from_arg_matches(__clap_arg_matches: &ArgMatches) -> Result<Self, Error>

    Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
    source§

    fn from_arg_matches_mut( __clap_arg_matches: &mut ArgMatches -) -> Result<Self, Error>

    Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
    source§

    fn update_from_arg_matches( +) -> Result<Self, Error>

    Instantiate Self from [ArgMatches], parsing the arguments as needed. Read more
    source§

    fn update_from_arg_matches( &mut self, __clap_arg_matches: &ArgMatches -) -> Result<(), Error>

    Assign values from ArgMatches to self.
    source§

    fn update_from_arg_matches_mut( +) -> Result<(), Error>

    Assign values from ArgMatches to self.
    source§

    fn update_from_arg_matches_mut( &mut self, __clap_arg_matches: &mut ArgMatches ) -> Result<(), Error>

    Assign values from ArgMatches to self.

    Auto Trait Implementations§

    Blanket Implementations§

    source§

    impl<T> Any for Twhere diff --git a/hotshot_query_service/struct.Snafu.html b/hotshot_query_service/struct.Snafu.html index 63dc3b2f7..beb98ee9c 100644 --- a/hotshot_query_service/struct.Snafu.html +++ b/hotshot_query_service/struct.Snafu.html @@ -1,13 +1,13 @@ -Snafu in hotshot_query_service - Rust
    pub struct Snafu<__T0> {
    +Snafu in hotshot_query_service - Rust
    pub struct Snafu<__T0> {
         pub message: __T0,
     }
    Expand description

    SNAFU context selector for the QueryError::Error variant

    -

    Fields§

    §message: __T0

    Implementations§

    source§

    impl<__T0> Snafu<__T0>

    source

    pub fn build(self) -> QueryErrorwhere +

    Fields§

    §message: __T0

    Implementations§

    source§

    impl<__T0> Snafu<__T0>

    source

    pub fn build(self) -> QueryErrorwhere __T0: Into<String>,

    Consume the selector and return the associated error

    -
    source

    pub fn fail<__T>(self) -> Result<__T, QueryError>where +

    source

    pub fn fail<__T>(self) -> Result<__T, QueryError>where __T0: Into<String>,

    Consume the selector and return a Result with the associated error

    -

    Trait Implementations§

    source§

    impl<__T0: Clone> Clone for Snafu<__T0>

    source§

    fn clone(&self) -> Snafu<__T0>

    Returns a copy of the value. Read more
    1.0.0 · source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    source§

    impl<__T0: Debug> Debug for Snafu<__T0>

    source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    source§

    impl<__T0> IntoError<QueryError> for Snafu<__T0>where +

    Trait Implementations§

    source§

    impl<__T0: Clone> Clone for Snafu<__T0>

    source§

    fn clone(&self) -> Snafu<__T0>

    Returns a copy of the value. Read more
    1.0.0 · source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    source§

    impl<__T0: Debug> Debug for Snafu<__T0>

    source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    source§

    impl<__T0> IntoError<QueryError> for Snafu<__T0>where QueryError: Error + ErrorCompat, - __T0: Into<String>,

    §

    type Source = NoneError

    The underlying error
    source§

    fn into_error(self, error: Self::Source) -> QueryError

    Combine the information to produce the error
    source§

    impl<__T0: Copy> Copy for Snafu<__T0>

    Auto Trait Implementations§

    §

    impl<__T0> RefUnwindSafe for Snafu<__T0>where + __T0: Into<String>,

    §

    type Source = NoneError

    The underlying error
    source§

    fn into_error(self, error: Self::Source) -> QueryError

    Combine the information to produce the error
    source§

    impl<__T0: Copy> Copy for Snafu<__T0>

    Auto Trait Implementations§

    §

    impl<__T0> RefUnwindSafe for Snafu<__T0>where __T0: RefUnwindSafe,

    §

    impl<__T0> Send for Snafu<__T0>where __T0: Send,

    §

    impl<__T0> Sync for Snafu<__T0>where __T0: Sync,

    §

    impl<__T0> Unpin for Snafu<__T0>where diff --git a/hotshot_query_service/type.Header.html b/hotshot_query_service/type.Header.html index 404b5e3b0..d7bc3b5a0 100644 --- a/hotshot_query_service/type.Header.html +++ b/hotshot_query_service/type.Header.html @@ -1 +1 @@ -Header in hotshot_query_service - Rust

    Type Alias hotshot_query_service::Header

    source ·
    pub type Header<Types> = <Types as NodeType>::BlockHeader;
    \ No newline at end of file +Header in hotshot_query_service - Rust

    Type Alias hotshot_query_service::Header

    source ·
    pub type Header<Types> = <Types as NodeType>::BlockHeader;
    \ No newline at end of file diff --git a/hotshot_query_service/type.Metadata.html b/hotshot_query_service/type.Metadata.html index ce8be4ed5..9f9b046d8 100644 --- a/hotshot_query_service/type.Metadata.html +++ b/hotshot_query_service/type.Metadata.html @@ -1 +1 @@ -Metadata in hotshot_query_service - Rust
    pub type Metadata<Types> = <Payload<Types> as BlockPayload>::Metadata;
    \ No newline at end of file +Metadata in hotshot_query_service - Rust
    pub type Metadata<Types> = <Payload<Types> as BlockPayload>::Metadata;
    \ No newline at end of file diff --git a/hotshot_query_service/type.Payload.html b/hotshot_query_service/type.Payload.html index 6a77287b3..7c5fe9d11 100644 --- a/hotshot_query_service/type.Payload.html +++ b/hotshot_query_service/type.Payload.html @@ -1 +1 @@ -Payload in hotshot_query_service - Rust
    pub type Payload<Types> = <Types as NodeType>::BlockPayload;
    \ No newline at end of file +Payload in hotshot_query_service - Rust
    pub type Payload<Types> = <Types as NodeType>::BlockPayload;
    \ No newline at end of file diff --git a/hotshot_query_service/type.QueryResult.html b/hotshot_query_service/type.QueryResult.html index daeaf2bc8..2efb28ebe 100644 --- a/hotshot_query_service/type.QueryResult.html +++ b/hotshot_query_service/type.QueryResult.html @@ -1,4 +1,4 @@ -QueryResult in hotshot_query_service - Rust
    pub type QueryResult<T> = Result<T, QueryError>;

    Aliased Type§

    enum QueryResult<T> {
    +QueryResult in hotshot_query_service - Rust
    pub type QueryResult<T> = Result<T, QueryError>;

    Aliased Type§

    enum QueryResult<T> {
         Ok(T),
         Err(QueryError),
     }

    Variants§

    §1.0.0

    Ok(T)

    Contains the success value

    diff --git a/hotshot_query_service/type.SignatureKey.html b/hotshot_query_service/type.SignatureKey.html index 5e03d02bb..7b4f28f43 100644 --- a/hotshot_query_service/type.SignatureKey.html +++ b/hotshot_query_service/type.SignatureKey.html @@ -1 +1 @@ -SignatureKey in hotshot_query_service - Rust
    pub type SignatureKey<Types> = <Types as NodeType>::SignatureKey;
    \ No newline at end of file +SignatureKey in hotshot_query_service - Rust
    pub type SignatureKey<Types> = <Types as NodeType>::SignatureKey;
    \ No newline at end of file diff --git a/hotshot_query_service/type.Transaction.html b/hotshot_query_service/type.Transaction.html index 8e9b48741..aee0c841f 100644 --- a/hotshot_query_service/type.Transaction.html +++ b/hotshot_query_service/type.Transaction.html @@ -1,2 +1,2 @@ -Transaction in hotshot_query_service - Rust
    pub type Transaction<Types> = <Payload<Types> as BlockPayload>::Transaction;
    Expand description

    Item within a Payload.

    +Transaction in hotshot_query_service - Rust
    pub type Transaction<Types> = <Payload<Types> as BlockPayload>::Transaction;
    Expand description

    Item within a Payload.

    \ No newline at end of file diff --git a/search-index.js b/search-index.js index 4539a4913..8dacc6712 100644 --- a/search-index.js +++ b/search-index.js @@ -1,5 +1,5 @@ var searchIndex = JSON.parse('{\ -"hotshot_query_service":{"doc":"The HotShot Query Service is a minimal, generic query …","t":"NNNENGGNDNDNDGEGIGDNGLLLLLLLLLLLLLLLLLLLLLLLLLLAMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLKALLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLOLLLLLLOLLLLLLLLLLLLLLLLLLLLLLLLLLLLMAMFLLLLALLMLLLLLLLLLLLLLLLLLLLKLLLLLLLLLLLLLLMMMMMIGGDQNQDNDEQNNNQDNDNDQGGDQNQDNNNDNDNDNDNDINDENDNDGGGGQDILLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLKLFLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLKKKLKKKLLLLLLLLLLLLMMMLLMLLLLLLLLLLLLLLLLLLLKKLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLKLMKLMLLLLLLLLLLLLLLMLMMMMMMLLLLLLLLMKKLLLLLLLLLLLLLLLLLLLLLLLLLLLLLKLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMMMMMMMMMMMMMMMMQDDDCIILLLLLLLLLLLLLLLLLLLLLLLLLLLKLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLKLLLALLLLLLLLLLLLLLLLLKLLLLLDDDIDDLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLKLLLLLLLLLLLLLLLFLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLOOLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLCLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLDDDDENNNDLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMENDDNIILLLLMLLLLLLLLLLKLLLLLLLLLLLLLLLLLFLLLLLLLLLLLLLLLLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMLLKLKLLLLLLLLLMLLLLLLLLLLLLLLMM","n":["Availability","Custom","Err","Error","Error","Header","Metadata","Missing","MissingSnafu","NotFound","NotFoundSnafu","Ok","Options","Payload","QueryError","QueryResult","Resolvable","SignatureKey","Snafu","Status","Transaction","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","as_any","as_any","as_any","as_any","as_any","as_any","as_any_mut","as_any_mut","as_any_mut","as_any_mut","as_any_mut","as_any_mut","as_error_source","as_error_source","augment_args","augment_args_for_update","availability","availability","backtrace","backtrace","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","build","build","build","catch_all","cause","cause","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","commitment","data_source","default","deref","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","description","description","deserialize","deserialize","drop","drop","drop","drop","drop","drop","fail","fail","fail","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from_arg_matches","from_arg_matches_mut","group_id","header","header","in_current_span","in_current_span","include_migrations","init","init","init","init","init","init","instantiate_data_source_tests","internal","into","into","into","into","into","into","into_any","into_any","into_any","into_any","into_any","into_any","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_error","into_error","into_error","message","metrics","port","run_standalone_service","serialize","serialize","source","source","status","status","status","status","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","to_string","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_resolve","type_id","type_id","type_id","type_id","type_id","type_id","update_from_arg_matches","update_from_arg_matches_mut","vzip","vzip","vzip","vzip","vzip","vzip","message","source","source","status","message","AvailabilityDataSource","BlockHash","BlockId","BlockQueryData","BlockRange","BlockStream","BlockStream","BlockStreamSnafu","Custom","CustomSnafu","Error","Error","Hash","Hash","Hash","InclusionProof","InconsistentLeafError","InvalidSignatureKey","InvalidSignatureKeySnafu","InvalidTransactionIndex","InvalidTransactionIndexSnafu","Iter","LeafHash","LeafId","LeafQueryData","LeafRange","LeafStream","LeafStream","LeafStreamSnafu","Number","Number","Number","Options","QueryBlock","QueryBlockSnafu","QueryLeaf","QueryLeafSnafu","QueryProposals","QueryProposalsSnafu","QueryTransaction","QueryTransactionSnafu","QueryablePayload","Request","RequestSnafu","ResourceId","StreamBlock","StreamBlockSnafu","StreamLeaf","StreamLeafSnafu","Timestamp","TransactionHash","TransactionInclusionProof","TransactionIndex","TransactionIndex","TransactionQueryData","UpdateAvailabilityData","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","api_path","as_any","as_any","as_any","as_any","as_any","as_any","as_any","as_any","as_any","as_any","as_any","as_any","as_any","as_any","as_any","as_any","as_any","as_any","as_any","as_any_mut","as_any_mut","as_any_mut","as_any_mut","as_any_mut","as_any_mut","as_any_mut","as_any_mut","as_any_mut","as_any_mut","as_any_mut","as_any_mut","as_any_mut","as_any_mut","as_any_mut","as_any_mut","as_any_mut","as_any_mut","as_any_mut","as_error_source","as_error_source","augment_args","augment_args_for_update","backtrace","backtrace","block_hash","block_hash","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","build","build","build","build","build","by_hash","by_hash","cause","cause","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","cmp","compare","count_proposals","default","define_api","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","description","description","deserialize","deserialize","deserialize","deserialize","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","enumerate","enumerate","enumerate","eq","eq","eq","eq","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","extensions","fail","fail","fail","fail","fail","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from_arg_matches","from_arg_matches_mut","genesis","genesis","get_block","get_block_range","get_block_with_transaction","get_hash","get_leaf","get_leaf_range","get_proposals","group_id","hash","hash","hash","hash","header","header","header","header","height","height","height","height","height","height","in_current_span","in_current_span","index","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","init","insert_block","insert_leaf","internal","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_error","into_error","into_error","into_error","into_error","into_error","into_error","into_error","into_error","into_error","into_error","into_error","is_empty","is_empty","is_empty","iter","leaf","leaf","len","len","message","metadata","new","new","nth","nth","nth_transaction","nth_transaction","nth_transaction_with_proof","nth_transaction_with_proof","partial_cmp","payload","proof","proof","proposer","proposer","qc","qc_leaf","reason","reason","resource","resource","resource","serialize","serialize","serialize","serialize","size","source","source","status","status","subscribe_blocks","subscribe_leaves","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","to_string","to_string","transaction","transaction","transaction","transaction","transaction_by_hash","transaction_by_hash","transaction_by_hash_with_proof","transaction_by_hash_with_proof","transaction_with_proof","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","update_from_arg_matches","update_from_arg_matches_mut","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","height","height","height","index","message","proposer","reason","reason","resource","resource","resource","source","source","source","source","source","source","source","status","Error","ExtensibleDataSource","FileSystemDataSource","MetricsDataSource","SqlDataSource","UpdateDataSource","VersionedDataSource","__clone_box","__clone_box","__clone_box","__clone_box","as_any","as_any","as_any","as_any_mut","as_any_mut","as_any_mut","as_bits","as_mut","as_mut_bits","as_ref","block_height","block_height","block_height","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone_into","clone_into","commit","commit","commit","count_proposals","count_proposals","create","create_with_store","default","deref","deref","deref","deref_mut","deref_mut","deref_mut","drop","drop","drop","encode_hex","encode_hex_upper","fmt","fmt","fmt","from","from","from","get_block","get_block","get_block_range","get_block_range","get_block_with_transaction","get_block_with_transaction","get_leaf","get_leaf","get_leaf_range","get_leaf_range","get_proposals","get_proposals","init","init","init","inner","inner_mut","insert_block","insert_block","insert_leaf","insert_leaf","into","into","into","into_any","into_any","into_any","into_any_arc","into_any_arc","into_any_arc","into_any_rc","into_any_rc","into_any_rc","metrics","metrics","metrics","new","open","open_with_store","populate_metrics","populate_metrics","populate_metrics","revert","revert","revert","skip_version","sql","subscribe_blocks","subscribe_blocks","subscribe_leaves","subscribe_leaves","to_owned","to_owned","try_as_bits","try_as_mut_bits","try_from","try_from","try_from","try_into","try_into","try_into","type_id","type_id","type_id","update","update","update","vzip","vzip","vzip","Config","Error","Migration","Query","SqlDataSource","Transaction","__clone_box","__clone_box","__clone_box","__clone_box","applied_on","as_any","as_any","as_any","as_any","as_any","as_any_mut","as_any_mut","as_any_mut","as_any_mut","as_any_mut","as_ref","as_ref","block_height","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","chain","checksum","client","client","client","clone","clone","clone_into","clone_into","cmp","commit","compare","connect","connect","context","count_proposals","database","default","default_migrations","deref","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","downcast","downcast_mut","downcast_ref","drop","drop","drop","drop","drop","drop","drop","eq","equivalent","equivalent","equivalent","equivalent","execute","execute_many","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from_str","get_block","get_block_range","get_block_with_transaction","get_leaf","get_leaf_range","get_proposals","header","header","host","include_dir","include_migrations","init","init","init","init","init","insert_block","insert_leaf","into","into","into","into","into","into_any","into_any","into_any","into_any","into_any","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","is","metrics","migrations","msg","name","new","no_migrations","partial_cmp","password","populate_metrics","port","postgres","prefix","query","query_one","query_one_static","query_opt","query_opt_static","query_static","reset_schema","revert","root_cause","schema","sql","subscribe_blocks","subscribe_leaves","tls","to_owned","to_owned","to_string","to_string","transaction","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","unapplied","update","user","version","vzip","vzip","vzip","vzip","vzip","Counter","Gauge","Histogram","Label","MetricsError","NoSuchMetric","NoSuchSubgroup","Prometheus","PrometheusMetrics","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","add","add_point","as_any","as_any","as_any","as_any","as_any","as_any","as_any_mut","as_any_mut","as_any_mut","as_any_mut","as_any_mut","as_any_mut","as_error_source","backtrace","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","cause","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","create_counter","create_gauge","create_histogram","create_label","default","deref","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","description","drop","drop","drop","drop","drop","drop","export","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","get","get","get","get_counter","get_gauge","get_histogram","get_label","get_subgroup","header","in_current_span","init","init","init","init","init","init","into","into","into","into","into","into","into_any","into_any","into_any","into_any","into_any","into_any","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","mean","sample_count","set","set","source","subgroup","sum","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","update","vzip","vzip","vzip","vzip","vzip","vzip","label","namespace","path","source","Error","Internal","MempoolQueryData","Options","Request","StatusDataSource","UpdateStatusData","__clone_box","__clone_box","__clone_box","__clone_box","api_path","as_any","as_any","as_any","as_any_mut","as_any_mut","as_any_mut","as_error_source","augment_args","augment_args_for_update","backtrace","block_height","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","cause","clone","clone","clone_into","clone_into","cmp","compare","consensus_metrics","consensus_metrics","default","default","define_api","deref","deref","deref","deref_mut","deref_mut","deref_mut","description","deserialize","deserialize","drop","drop","drop","eq","equivalent","equivalent","equivalent","equivalent","extensions","fmt","fmt","fmt","from","from","from","from","from","from_arg_matches","from_arg_matches_mut","get_hash","group_id","hash","header","in_current_span","init","init","init","into","into","into","into_any","into_any","into_any","into_any_arc","into_any_arc","into_any_arc","into_any_rc","into_any_rc","into_any_rc","memory_footprint","mempool_info","mempool_info","metrics","partial_cmp","populate_metrics","serialize","serialize","source","status","success_rate","success_rate","to_owned","to_owned","to_string","transaction_count","try_from","try_from","try_from","try_into","try_into","try_into","type_id","type_id","type_id","update_from_arg_matches","update_from_arg_matches_mut","vzip","vzip","vzip","reason","source"],"q":[[0,"hotshot_query_service"],[212,"hotshot_query_service::Error"],[216,"hotshot_query_service::QueryError"],[217,"hotshot_query_service::availability"],[869,"hotshot_query_service::availability::Error"],[888,"hotshot_query_service::data_source"],[1017,"hotshot_query_service::data_source::sql"],[1208,"hotshot_query_service::metrics"],[1383,"hotshot_query_service::metrics::MetricsError"],[1387,"hotshot_query_service::status"],[1506,"hotshot_query_service::status::Error"],[1508,"dyn_clone::sealed"],[1509,"dyn_clone::sealed"],[1510,"core::error"],[1511,"clap_builder::builder::command"],[1512,"snafu::backtrace_shim"],[1513,"core::option"],[1514,"alloc::string"],[1515,"core::convert"],[1516,"tide_disco::status"],[1517,"core::clone"],[1518,"commit"],[1519,"core::result"],[1520,"serde::de"],[1521,"core::fmt"],[1522,"core::fmt"],[1523,"clap_builder"],[1524,"clap_builder::util::id"],[1525,"color_eyre::section"],[1526,"core::fmt"],[1527,"core::marker"],[1528,"alloc::sync"],[1529,"alloc::rc"],[1530,"hotshot::types::handle"],[1531,"hotshot_types::traits::node_implementation"],[1532,"hotshot_types::traits::node_implementation"],[1533,"core::any"],[1534,"core::future::future"],[1535,"core::pin"],[1536,"tide_disco::api"],[1537,"tide_disco::api"],[1538,"core::iter::traits::iterator"],[1539,"core::cmp"],[1540,"core::ops::range"],[1541,"core::hash"],[1542,"core::marker"],[1543,"hotshot_types::data"],[1544,"hotshot_types::simple_certificate"],[1545,"bitvec::slice"],[1546,"bitvec::order"],[1547,"std::path"],[1548,"atomic_store::error"],[1549,"atomic_store::atomic_store"],[1550,"core::iter::traits::collect"],[1551,"hotshot_types::traits::metrics"],[1552,"bitvec::ptr::span"],[1553,"hotshot_types::event"],[1554,"time::offset_date_time"],[1555,"anyhow"],[1556,"tokio_postgres::client"],[1557,"alloc::vec"],[1558,"tokio_postgres::to_statement"],[1559,"core::iter::traits::collect"],[1560,"refinery_core::runner"],[1561,"refinery_core::error"],[1562,"hotshot_types::traits::metrics"]],"d":["","","Contains the error value","","There was an error while trying to fetch the requested …","","","The requested resource exists but is not currently …","SNAFU context selector for the QueryError::Missing variant","The requested resource does not exist or is not known to …","SNAFU context selector for the QueryError::NotFound variant","Contains the success value","","","","","A reference to a T which can be resolved into a whole T.","","SNAFU context selector for the QueryError::Error variant","","Item within a Payload.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Consume the selector and return the associated error","Consume the selector and return the associated error","Consume the selector and return the associated error","","","","","","","","","","","","","","Get a commitment to the underlying object.","Persistent storage and sources of data consumed by APIs.","","","","","","","","","","","","","","","","","","","","","","","","Consume the selector and return a Result with the …","Consume the selector and return a Result with the …","Consume the selector and return a Result with the …","","","","","","","","","","Returns the argument unchanged.","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","","","","","","Embed migrations from the given directory into the current …","","","","","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","Run an instance of the HotShot Query service with no …","","","","","","","","","","","","","","","","","","","","","","","","","","","","Get the underlying object if it is available without …","","","","","","","","","","","","","","","","","","","","","A block hash is the hash of the block header.","","","","","","SNAFU context selector for the Error::BlockStream variant","","SNAFU context selector for the Error::Custom variant","","","","","","A proof that a certain transaction exists in the block.","","","SNAFU context selector for the Error::InvalidSignatureKey …","","SNAFU context selector for the …","Enumerate the transactions in this block.","","","","","","","SNAFU context selector for the Error::LeafStream variant","","","","","","SNAFU context selector for the Error::QueryBlock variant","","SNAFU context selector for the Error::QueryLeaf variant","","SNAFU context selector for the Error::QueryProposals …","","SNAFU context selector for the Error::QueryTransaction …","A block payload whose contents (e.g. individual …","","SNAFU context selector for the Error::Request variant","","","SNAFU context selector for the Error::StreamBlock variant","","SNAFU context selector for the Error::StreamLeaf variant","","","","","An index which can be used to efficiently retrieve a …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Consume the selector and return the associated error","Consume the selector and return the associated error","Consume the selector and return the associated error","Consume the selector and return the associated error","Consume the selector and return the associated error","Get the index of the transaction with a given hash, if it …","Get the index of the transaction with a given hash, if it …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Enumerate the transactions in the block with their indices.","Enumerate the transactions in the block with their indices.","","","","","","","","","","","","","","","","","","","","","","Additional API specification files to merge with …","Consume the selector and return a Result with the …","Consume the selector and return a Result with the …","Consume the selector and return a Result with the …","Consume the selector and return a Result with the …","Consume the selector and return a Result with the …","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","Returns the argument unchanged.","","","","","","","Returns the block containing a transaction with the given …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Whether this block is empty of transactions.","Whether this block is empty of transactions.","","List the transaction indices in the block.","","","The number of transactions in the block.","","","","Collect information about a Leaf.","Collect information about a block.","Get the index of the nth transaction.","Get the index of the nth transaction.","Get the nth transaction.","Get the nth transaction.","Get the nth transaction, along with an inclusion proof.","Get the nth transaction, along with an inclusion proof.","","","Get an inclusion proof for a transaction with a given …","Get an inclusion proof for a transaction with a given …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Get a transaction by its block-specific index.","Get a transaction by its block-specific index.","","","Get the transaction with a given hash, if it is in the …","Get the transaction with a given hash, if it is in the …","Get the transaction with a given hash, if it is in the …","Get the transaction with a given hash, if it is in the …","Get a transaction by its block-specific index, along with …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Wrapper to add extensibility to an existing data source.","A data source for the APIs provided in this crate, backed …","A minimal data source for the status API provided in this …","","An extension trait for types which implement the update …","A data source with an atomic transaction-based …","","","","","","","","","","","","","","","","","","","","","","","","","","","","Atomically commit to all outstanding modifications to the …","","Commit the current state to persistent storage.","","","Create a new FileSystemDataSource with storage at path.","Create a new FileSystemDataSource using a persistent …","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","","","","","","","","","","","","","","Access the underlying data source.","Mutably access the underlying data source.","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","Open an existing FileSystemDataSource from storage at path.","Open an existing FileSystemDataSource using a persistent …","","","","Erase all oustanding modifications to the data.","","Revert changes made to persistent storage since the last …","Advance the version of the persistent store without …","","","","","","","","","","","","","","","","","","","Update query state based on a new consensus event.","","","","","","Postgres client config.","The Error type, a wrapper around a dynamic error type.","Represents a schema migration to be run on the database, …","","A data source for the APIs provided in this crate, backed …","An atomic SQL transaction.","","","","","Get the timestamp from when the Migration was applied. None…","","","","","","","","","","","","","","","","","","","","","","","","An iterator of the chain of source errors contained by …","Get the Migration checksum. Checksum is formed from the …","","","","","","","","","Atomically commit to all outstanding modifications to the …","","Connect to the database with this config.","Connect to a remote database.","Wrap the error value with additional context.","","Set the name of the database to connect to.","","The migrations requied to build the default schema for …","","","","","","","","","","","","","Attempt to downcast the error object to a concrete type.","Downcast this error object by mutable reference.","Downcast this error object by reference.","","","","","","","","","","","","","Execute a statement against the underlying database.","","","","","","","","Returns the argument unchanged.","","","Returns the argument unchanged.","Returns the argument unchanged.","","Returns the argument unchanged.","Returns the argument unchanged.","","","","","","","","","","Set the hostname of the database server.","Embed the contents of a directory in your crate.","Embed migrations from the given directory into the current …","","","","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","Returns true if E is the type held by this error object.","","Add custom migrations to run when connecting to the …","Create a new error object from a printable error message.","Get the Migration Name","Create a new error object from any error type.","Skip all migrations when connecting to the database.","","Set a password for connecting to the database.","","Set the port on which to connect to the database.","","Get the Prefix","","Query the underlying SQL database, returning exactly one …","Query the underlying SQL database with no parameters, …","Query the underlying SQL database, returning zero or one …","Query the underlying SQL database with no parameters, …","Query the underlying SQL database with no parameters.","Reset the schema on connection.","Erase all oustanding modifications to the data.","The lowest level cause of this error — this error’s …","Set the name of the schema to use for queries.","","","","Use TLS for an encrypted connection to the database.","","","","","Access the transaction which is accumulating all …","","","","","","","","","","","","","","","","Create an unapplied migration, name and version are parsed …","","Set the DB user to connect as.","Get the Migration version","","","","","","A Counter metric.","A Gauge metric.","A Histogram metric.","A Label metric.","","","","","A Prometheus-based implementation of a Metrics registry.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","","Get a counter in this sub-group by name.","Get a gauge in this sub-group by name.","Get a histogram in this sub-group by name.","Get a label in this sub-group by name.","Get a (possibly nested) subgroup of this group by its path.","","","","","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Additional API specification files to merge with …","","","","Returns the argument unchanged.","Returns the argument unchanged.","","Returns the argument unchanged.","","","","","","","","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"i":[7,7,121,0,10,0,0,10,0,10,0,121,0,0,0,0,0,0,0,7,0,7,7,11,11,12,12,13,13,10,10,7,11,12,13,10,19,7,11,12,13,10,19,7,10,19,19,0,19,7,10,7,11,12,13,10,19,7,11,12,13,10,19,11,12,13,7,7,10,7,11,12,13,10,7,11,12,13,10,145,0,19,7,11,12,13,10,19,7,11,12,13,10,19,7,10,7,10,7,11,12,13,10,19,11,12,13,7,7,11,12,13,10,10,7,7,7,7,11,12,13,10,19,19,19,19,7,10,7,10,0,7,11,12,13,10,19,0,7,7,11,12,13,10,19,7,11,12,13,10,19,7,11,12,13,10,19,7,11,12,13,10,19,11,12,13,13,0,19,0,7,10,7,10,0,7,10,19,7,11,12,13,10,7,10,7,11,12,13,10,19,7,11,12,13,10,19,145,7,11,12,13,10,19,19,19,7,11,12,13,10,19,146,147,148,146,149,0,0,0,0,41,27,41,0,27,0,0,107,80,86,58,150,0,27,0,27,0,150,0,0,0,41,27,41,0,80,86,58,0,27,0,27,0,27,0,27,0,0,27,0,0,27,0,27,0,0,0,0,0,150,0,0,58,58,49,49,48,48,60,60,51,51,61,61,62,62,63,63,64,64,65,65,66,66,67,67,52,52,54,54,55,55,56,56,57,57,27,27,72,58,49,48,60,51,72,61,62,63,64,65,66,67,52,54,55,56,57,27,58,49,48,60,51,72,61,62,63,64,65,66,67,52,54,55,56,57,27,48,27,72,72,48,27,49,51,58,49,48,60,51,72,61,62,63,64,65,66,67,52,54,55,56,57,27,58,49,48,60,51,72,61,62,63,64,65,66,67,52,54,55,56,57,27,52,54,55,56,57,150,150,48,27,58,49,48,60,51,61,62,63,64,65,66,67,52,54,55,56,57,27,58,49,48,60,51,61,62,63,64,65,66,67,52,54,55,56,57,27,58,58,41,72,0,58,49,48,60,51,72,61,62,63,64,65,66,67,52,54,55,56,57,27,58,49,48,60,51,72,61,62,63,64,65,66,67,52,54,55,56,57,27,48,27,49,60,51,27,58,49,48,60,51,72,61,62,63,64,65,66,67,52,54,55,56,57,27,150,150,60,58,49,60,51,58,58,58,58,49,49,49,49,60,60,60,60,51,51,51,51,72,52,54,55,56,57,58,58,49,48,48,60,51,61,62,63,64,65,66,67,52,54,55,56,57,27,27,58,58,58,49,48,60,51,72,61,62,63,64,65,66,67,52,54,55,56,57,27,27,27,72,72,49,60,41,41,41,58,41,41,41,72,58,49,60,51,58,48,60,27,49,60,51,52,54,55,48,27,52,58,49,48,60,51,72,61,62,63,64,65,66,67,52,54,55,56,57,27,107,107,27,58,49,48,60,51,72,61,62,63,64,65,66,67,52,54,55,56,57,27,58,49,48,60,51,72,61,62,63,64,65,66,67,52,54,55,56,57,27,58,49,48,60,51,72,61,62,63,64,65,66,67,52,54,55,56,57,27,58,49,48,60,51,72,61,62,63,64,65,66,67,52,54,55,56,57,27,61,62,63,64,65,66,67,52,54,55,56,57,150,150,60,150,49,48,150,60,57,60,49,60,150,150,150,150,150,150,58,60,150,150,49,67,49,48,54,55,62,64,66,49,60,51,27,60,48,27,27,57,41,41,58,49,48,60,51,61,62,63,64,65,66,67,52,54,55,56,57,27,58,48,27,150,150,60,51,150,150,150,150,150,58,49,48,60,51,72,61,62,63,64,65,66,67,52,54,55,56,57,27,58,49,48,60,51,72,61,62,63,64,65,66,67,52,54,55,56,57,27,58,49,48,60,51,72,61,62,63,64,65,66,67,52,54,55,56,57,27,72,72,58,49,48,60,51,72,61,62,63,64,65,66,67,52,54,55,56,57,27,151,152,153,151,154,155,152,153,156,157,158,159,156,160,157,161,158,155,154,44,0,0,0,0,0,0,99,99,101,101,99,100,101,99,100,101,99,99,99,99,99,100,101,99,100,101,99,100,101,99,101,99,101,44,99,100,99,100,100,100,101,99,100,101,99,100,101,99,100,101,99,99,99,100,101,99,100,101,99,100,99,100,99,100,99,100,99,100,99,100,99,100,101,99,99,99,100,99,100,99,100,101,99,100,101,99,100,101,99,100,101,99,100,101,99,100,100,99,100,101,44,99,100,100,0,99,100,99,100,99,101,99,99,99,100,101,99,100,101,99,100,101,43,99,100,99,100,101,0,0,0,0,0,0,112,112,119,119,112,114,118,112,119,115,114,118,112,119,115,114,114,115,114,118,112,119,115,114,118,112,119,115,114,112,162,118,115,112,119,112,119,112,115,112,119,115,114,115,119,119,0,114,114,118,112,119,115,114,114,118,112,119,115,114,114,114,114,114,118,112,119,115,115,112,112,112,112,112,118,118,114,114,112,112,119,115,114,114,114,118,112,119,119,115,119,115,115,115,115,115,115,114,112,119,0,0,114,118,112,119,115,115,115,114,118,112,119,115,114,118,112,119,115,114,118,112,119,115,114,118,112,119,115,114,115,119,114,112,114,119,112,119,115,119,0,112,162,162,162,162,162,162,119,115,114,119,112,115,115,119,112,119,114,112,115,114,118,112,119,115,114,118,112,119,115,114,118,112,119,115,112,115,119,112,114,118,112,119,115,0,0,0,0,0,134,134,134,0,108,108,131,131,135,135,132,132,136,136,131,132,134,108,131,135,132,136,134,108,131,135,132,136,134,134,134,108,131,135,132,136,134,108,131,135,132,136,134,108,131,135,132,136,108,131,135,132,136,108,108,108,108,108,134,108,131,135,132,136,134,108,131,135,132,136,134,134,108,131,135,132,136,108,134,134,108,131,135,132,136,134,134,108,131,135,132,136,131,135,136,108,108,108,108,108,134,134,134,108,131,135,132,136,134,108,131,135,132,136,134,108,131,135,132,136,134,108,131,135,132,136,134,108,131,135,132,136,132,132,135,136,134,108,132,108,131,135,132,136,134,134,108,131,135,132,136,134,108,131,135,132,136,134,108,131,135,132,136,135,134,108,131,135,132,136,163,163,164,165,0,28,0,0,28,0,0,143,143,28,28,144,143,144,28,143,144,28,28,144,144,28,42,143,144,28,143,144,28,28,143,28,143,28,143,143,42,42,143,144,0,143,144,28,143,144,28,28,143,28,143,144,28,143,143,143,143,143,144,143,28,28,143,144,28,28,28,144,144,143,144,143,28,28,143,144,28,143,144,28,143,144,28,143,144,28,143,144,28,143,42,42,42,143,166,143,28,28,28,42,42,143,28,28,143,143,144,28,143,144,28,143,144,28,144,144,143,144,28,167,168],"f":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[-1,1],2,[]],[[-1,3],2,[]],[[-1,3],2,[]],[[-1,1],2,[]],[[-1,3],2,[]],[[-1,1],2,[]],[[-1,1],2,[]],[[-1,3],2,[]],[[-1,1],2,[]],[[-1,3],2,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,5,[]],[-1,5,[]],[6,6],[6,6],0,0,[7,[[9,[8]]]],[10,[[9,[8]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[11,10],[12,10],[[[13,[-1]]],10,[[15,[14]]]],[[16,14],7],[7,[[9,[5]]]],[10,[[9,[5]]]],[7,7],[11,11],[12,12],[[[13,[-1]]],[[13,[-1]]],17],[10,10],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[-1,[[18,[-2]]],[],[]],0,[[],19],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[7,21],[10,21],[-1,[[22,[7]]],23],[-1,[[22,[10]]],23],[20,2],[20,2],[20,2],[20,2],[20,2],[20,2],[11,[[22,[-1,10]]],[]],[12,[[22,[-1,10]]],[]],[[[13,[-1]]],[[22,[-2,10]]],[[15,[14]]],[]],[[7,24],25],[[7,24],25],[[11,24],25],[[12,24],25],[[[13,[-1]],24],25,26],[[10,24],25],[[10,24],25],[[[2,[14,16]]],7],[27,7],[-1,-1,[]],[28,7],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[29,[[22,[19,30]]]],[29,[[22,[19,30]]]],[[],[[9,[31]]]],[[-1,-2],[[32,[-2,-3]]],[],[33,34,35],[]],[[-1,-2],[[32,[-2,-3]]],[],[33,34,35],[]],[-1,[],[]],[-1,[],[]],0,[[],20],[[],20],[[],20],[[],20],[[],20],[[],20],0,[-1,7,33],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[[36,[-1]]],[[36,[4]]],[]],[[[36,[-1]]],[[36,[4]]],[]],[[[36,[-1]]],[[36,[4]]],[]],[[[36,[-1]]],[[36,[4]]],[]],[[[36,[-1]]],[[36,[4]]],[]],[[[36,[-1]]],[[36,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[11,10],[12,10],[[[13,[-1]]],10,[[15,[14]]]],0,0,0,[[19,-2,[39,[-1,-3]]],[[22,[2,7]]],40,[[41,[-1]],42,[43,[-1]],44,34,35],[[45,[-1]]]],[[7,-1],22,46],[[10,-1],22,46],[7,[[9,[5]]]],[10,[[9,[5]]]],0,[7,16],[10,16],0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,14,[]],[-1,14,[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2,-1]]],[],[]],[-1,47,[]],[-1,47,[]],[-1,47,[]],[-1,47,[]],[-1,47,[]],[-1,47,[]],[[19,29],[[22,[2,30]]]],[[19,29],[[22,[2,30]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[-1,1],2,[]],[[-1,3],2,[]],[[-1,3],2,[]],[[-1,1],2,[]],[[-1,1],2,[]],[[-1,3],2,[]],[[-1,1],2,[]],[[-1,3],2,[]],[[-1,1],2,[]],[[-1,3],2,[]],[[-1,3],2,[]],[[-1,1],2,[]],[[-1,3],2,[]],[[-1,1],2,[]],[[-1,1],2,[]],[[-1,3],2,[]],[[-1,3],2,[]],[[-1,1],2,[]],[[-1,1],2,[]],[[-1,3],2,[]],[[-1,1],2,[]],[[-1,3],2,[]],[[-1,3],2,[]],[[-1,1],2,[]],[[-1,3],2,[]],[[-1,1],2,[]],[[-1,1],2,[]],[[-1,3],2,[]],[[-1,3],2,[]],[[-1,1],2,[]],[[-1,3],2,[]],[[-1,1],2,[]],[[-1,1],2,[]],[[-1,3],2,[]],[[-1,1],2,[]],[[-1,3],2,[]],0,[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,5,[]],[-1,5,[]],[6,6],[6,6],[[[48,[-1]]],[[9,[8]]],40],[27,[[9,[8]]]],[[[49,[-1]]],[[50,[-1]]],40],[[[51,[-1]]],[[50,[-1]]],40],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[[52,[-1,-2]]],27,[[15,[53]]],[[15,[53]]]],[[[54,[-1,-2]]],27,[[15,[20]]],[[15,[14]]]],[[[55,[-1,-2]]],27,[[15,[20]]],[[15,[14]]]],[56,27],[[[57,[-1,-2]]],27,[[15,[14]]],[[15,[16]]]],[[-1,18],9,[]],[[-1,18],9,[]],[[[48,[-1]]],[[9,[5]]],40],[27,[[9,[5]]]],[[[58,[-1]]],[[58,[-1]]],59],[[[49,[-1]]],[[49,[-1]]],[17,40]],[[[48,[-1]]],[[48,[-1]]],[17,40]],[[[60,[-1]]],[[60,[-1]]],[17,40]],[[[51,[-1]]],[[51,[-1]]],[17,40]],[61,61],[[[62,[-1]]],[[62,[-1]]],17],[63,63],[[[64,[-1]]],[[64,[-1]]],17],[65,65],[[[66,[-1]]],[[66,[-1]]],17],[[[67,[-1]]],[[67,[-1]]],17],[[[52,[-1,-2]]],[[52,[-1,-2]]],17,17],[[[54,[-1,-2]]],[[54,[-1,-2]]],17,17],[[[55,[-1,-2]]],[[55,[-1,-2]]],17,17],[56,56],[[[57,[-1,-2]]],[[57,[-1,-2]]],17,17],[27,27],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[[58,[-1]],[58,[-1]]],68,59],[[-1,-2],68,[],[]],[[-1,[69,[-2]]],[[71,[[36,[70]]]]],[],[]],[[],72],[72,[[22,[[73,[-1,27]],74]]],[34,35,75]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[[[48,[-1]]],21,40],[27,21],[-1,[[22,[[49,[-2]]]]],23,40],[-1,[[22,[[60,[-2]]]]],23,40],[-1,[[22,[[51,[-2]]]]],23,40],[-1,[[22,[27]]],23],[20,2],[20,2],[20,2],[20,2],[20,2],[20,2],[20,2],[20,2],[20,2],[20,2],[20,2],[20,2],[20,2],[20,2],[20,2],[20,2],[20,2],[20,2],[20,2],[-1,[[36,[76]]],[]],[-1,[[36,[76]]],[]],[[[60,[-1]]],[[0,[76]]],40],[[[58,[-1]],[58,[-1]]],77,59],[[[49,[-1]],[49,[-1]]],77,[78,40]],[[[60,[-1]],[60,[-1]]],77,[78,40]],[[[51,[-1]],[51,[-1]]],77,[78,40]],[[-1,-2],77,[],[]],[[-1,-2],77,[],[]],[[-1,-2],77,[],[]],[[-1,-2],77,[],[]],[[-1,-2],77,[],[]],[[-1,-2],77,[],[]],[[-1,-2],77,[],[]],[[-1,-2],77,[],[]],[[-1,-2],77,[],[]],[[-1,-2],77,[],[]],[[-1,-2],77,[],[]],[[-1,-2],77,[],[]],[[-1,-2],77,[],[]],[[-1,-2],77,[],[]],[[-1,-2],77,[],[]],[[-1,-2],77,[],[]],0,[[[52,[-1,-2]]],[[22,[-3,27]]],[[15,[53]]],[[15,[53]]],[]],[[[54,[-1,-2]]],[[22,[-3,27]]],[[15,[20]]],[[15,[14]]],[]],[[[55,[-1,-2]]],[[22,[-3,27]]],[[15,[20]]],[[15,[14]]],[]],[56,[[22,[-1,27]]],[]],[[[57,[-1,-2]]],[[22,[-3,27]]],[[15,[14]]],[[15,[16]]],[]],[[[58,[-1]],24],25,59],[[[58,[-1]],24],25,59],[[[49,[-1]],24],25,[26,40]],[[[48,[-1]],24],25,40],[[[48,[-1]],24],25,[26,40]],[[[60,[-1]],24],25,[26,40]],[[[51,[-1]],24],25,[26,40]],[[61,24],25],[[[62,[-1]],24],25,26],[[63,24],25],[[[64,[-1]],24],25,26],[[65,24],25],[[[66,[-1]],24],25,26],[[[67,[-1]],24],25,26],[[[52,[-1,-2]],24],25,26,26],[[[54,[-1,-2]],24],25,26,26],[[[55,[-1,-2]],24],25,26,26],[[56,24],25],[[[57,[-1,-2]],24],25,26,26],[[27,24],25],[[27,24],25],[-1,-1,[]],[20,[[58,[-1]]],59],[[[18,[-1]]],[[58,[-1]]],59],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[79,27],[[[2,[14,16]]],27],[-1,-1,[]],[29,[[22,[72,30]]]],[29,[[22,[72,30]]]],[[],[[49,[-1]]],40],[[],[[60,[-1]]],40],[[-1,-3],[[71,[[36,[70]]]]],[],[],[[15,[[80,[-2]]]],34,35]],[[-1,-2],[[71,[[36,[70]]]]],[],[[81,[20]],34]],[[-1,[82,[-2]]],[[71,[[36,[70]]]]],[],[]],[[-1,-2],53,[83,84],85],[[-1,-3],[[71,[[36,[70]]]]],[],[],[[15,[[86,[-2]]]],34,35]],[[-1,-2],[[71,[[36,[70]]]]],[],[[81,[20]],34]],[[-1,[69,[-2]],[9,[20]]],[[71,[[36,[70]]]]],[],[]],[[],[[9,[31]]]],[[[58,[-1]],-2],2,59,87],[[[49,[-1]]],[[88,[-1]]],40],[[[60,[-1]]],[[50,[-1]]],40],[[[51,[-1]]],[[82,[-1]]],40],[[-1,-2],[[32,[-2,-3]]],[],[33,34,35],[]],[[-1,-2],[[32,[-2,-3]]],[],[33,34,35],[]],[[[60,[-1]]],[[89,[-1]]],40],[[-1,-2],[[32,[-2,-3]]],[],[33,34,35],[]],[[[49,[-1]]],53,40],[[[60,[-1]]],53,40],[[[51,[-1]]],53,40],0,0,0,[-1,[],[]],[-1,[],[]],0,[[],20],[[],20],[[],20],[[],20],[[],20],[[],20],[[],20],[[],20],[[],20],[[],20],[[],20],[[],20],[[],20],[[],20],[[],20],[[],20],[[],20],[[],20],[[],20],[[-1,[60,[-2]]],[[71,[[36,[70]]]]],[],[]],[[-1,[49,[-2]]],[[71,[[36,[70]]]]],[],[]],[-1,27,33],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[[36,[-1]]],[[36,[4]]],[]],[[[36,[-1]]],[[36,[4]]],[]],[[[36,[-1]]],[[36,[4]]],[]],[[[36,[-1]]],[[36,[4]]],[]],[[[36,[-1]]],[[36,[4]]],[]],[[[36,[-1]]],[[36,[4]]],[]],[[[36,[-1]]],[[36,[4]]],[]],[[[36,[-1]]],[[36,[4]]],[]],[[[36,[-1]]],[[36,[4]]],[]],[[[36,[-1]]],[[36,[4]]],[]],[[[36,[-1]]],[[36,[4]]],[]],[[[36,[-1]]],[[36,[4]]],[]],[[[36,[-1]]],[[36,[4]]],[]],[[[36,[-1]]],[[36,[4]]],[]],[[[36,[-1]]],[[36,[4]]],[]],[[[36,[-1]]],[[36,[4]]],[]],[[[36,[-1]]],[[36,[4]]],[]],[[[36,[-1]]],[[36,[4]]],[]],[[[36,[-1]]],[[36,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[61,27],[[[62,[-1]]],27,[[15,[14]]]],[63,27],[[[64,[-1]]],27,[[15,[14]]]],[65,27],[[[66,[-1]]],27,[[15,[14]]]],[[[67,[-1]]],27,[[15,[90]]]],[[[52,[-1,-2]]],27,[[15,[53]]],[[15,[53]]]],[[[54,[-1,-2]]],27,[[15,[20]]],[[15,[14]]]],[[[55,[-1,-2]]],27,[[15,[20]]],[[15,[14]]]],[56,27],[[[57,[-1,-2]]],27,[[15,[14]]],[[15,[16]]]],[-1,77,[]],[-1,77,[]],[[[60,[-1]]],77,40],[-1,[],[]],[[[49,[-1]]],[[91,[-1]]],40],0,[-1,20,[]],[[[60,[-1]]],20,40],0,[[[60,[-1]]],[[92,[-1]]],40],[[[91,[-1]],[93,[-1]]],[[22,[[49,[-1]],[48,[-1]]]]],40],[[[91,[-1]],[93,[-1]],[94,[-1]]],[[22,[[60,[-1]],[48,[-1]]]]],40],[[-1,20],9,[]],[[-1,20],9,[]],[[-1,20],9,[]],[[-1,20],9,[]],[[-1,20],[[9,[2]]],[]],[[-1,20],[[9,[2]]],[]],[[[58,[-1]],[58,[-1]]],[[9,[68]]],59],[[[60,[-1]]],[[94,[-1]]],40],[-1,9,[]],[-1,9,[]],[[[49,[-1]]],[[69,[-1]]],40],0,[[[49,[-1]]],[[93,[-1]]],40],0,0,0,0,0,0,[[[49,[-1]],-2],22,40,46],[[[60,[-1]],-2],22,40,46],[[[51,[-1]],-2],22,40,46],[[27,-1],22,46],[[[60,[-1]]],53,40],[[[48,[-1]]],[[9,[5]]],40],[27,[[9,[5]]]],[27,16],0,[[-1,20],[[71,[[36,[70]]]]],[]],[[-1,20],[[71,[[36,[70]]]]],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,14,[]],[-1,14,[]],[-1,14,[]],[-1,9,[]],[-1,9,[]],[[[60,[-1]],[95,[-1]]],[[9,[[51,[-1]]]]],40],[[[51,[-1]]],[[96,[-1]]],40],[[-1,18],9,[]],[[-1,18],9,[]],[[-1,18],[[9,[2]]],[]],[[-1,18],[[9,[2]]],[]],[-1,[[9,[2]]],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,47,[]],[-1,47,[]],[-1,47,[]],[-1,47,[]],[-1,47,[]],[-1,47,[]],[-1,47,[]],[-1,47,[]],[-1,47,[]],[-1,47,[]],[-1,47,[]],[-1,47,[]],[-1,47,[]],[-1,47,[]],[-1,47,[]],[-1,47,[]],[-1,47,[]],[-1,47,[]],[-1,47,[]],[[72,29],[[22,[2,30]]]],[[72,29],[[22,[2,30]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[-1,1],2,[]],[[-1,3],2,[]],[[-1,1],2,[]],[[-1,3],2,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,[[97,[-2,-3]]],[],[],98],[[[99,[-1,-2]]],-2,[],[]],[-1,[[97,[-2,-3]]],[],[],98],[[[99,[-1,-2]]],-2,[],[]],[[[99,[-1,-2]]],[[71,[[36,[70]]]]],[42,34,35],[34,35]],[[[100,[-1]]],[[71,[[36,[70]]]]],40],[101,[[71,[[36,[70]]]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[[99,[-1,-2]]],[[99,[-1,-2]]],17,17],[101,101],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[-1,[[71,[[36,[70]]]]],[]],[[[99,[-1,-2]]],[[71,[[36,[70]]]]],[44,34],34],[[[100,[-1]]],[[71,[[36,[70]]]]],40],[[[99,[-2,-3]],[69,[-1]]],[[71,[[36,[70]]]]],40,[[41,[-1]],34,35],[34,35]],[[[100,[-1]],[69,[-1]]],[[71,[[36,[70]]]]],40],[102,[[22,[[100,[-1]],103]]],40],[104,[[22,[[100,[-1]],103]]],40],[[],101],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,2],[20,2],[20,2],[-1,-2,[],[[106,[105]]]],[-1,-2,[],[[106,[105]]]],[[[99,[-1,-2]],24],25,26,26],[[[100,[-1]],24],25,40],[[101,24],25],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[[[99,[-2,-3]],-4],[[71,[[36,[70]]]]],40,[[41,[-1]],34,35],[34,35],[[15,[[80,[-1]]]],34,35]],[[[100,[-1]],-2],[[71,[[36,[70]]]]],40,[[15,[[80,[-1]]]],34,35]],[[[99,[-2,-3]],-4],[[71,[[36,[70]]]]],40,[[41,[-1]],34,35],[34,35],[[81,[20]],34]],[[[100,[-1]],-2],[[71,[[36,[70]]]]],40,[[81,[20]],34]],[[[99,[-2,-3]],[82,[-1]]],[[71,[[36,[70]]]]],40,[[41,[-1]],34,35],[34,35]],[[[100,[-1]],[82,[-1]]],[[71,[[36,[70]]]]],40],[[[99,[-2,-3]],-4],[[71,[[36,[70]]]]],40,[[41,[-1]],34,35],[34,35],[[15,[[86,[-1]]]],34,35]],[[[100,[-1]],-2],[[71,[[36,[70]]]]],40,[[15,[[86,[-1]]]],34,35]],[[[99,[-2,-3]],-4],[[71,[[36,[70]]]]],40,[[41,[-1]],34,35],[34,35],[[81,[20]],34]],[[[100,[-1]],-2],[[71,[[36,[70]]]]],40,[[81,[20]],34]],[[[99,[-2,-3]],[69,[-1]],[9,[20]]],[[71,[[36,[70]]]]],40,[[41,[-1]],34,35],[34,35]],[[[100,[-1]],[69,[-1]],[9,[20]]],[[71,[[36,[70]]]]],40],[[],20],[[],20],[[],20],[[[99,[-1,-2]]],-1,[],[]],[[[99,[-1,-2]]],-1,[],[]],[[[99,[-2,-3]],[60,[-1]]],[[71,[[36,[70]]]]],40,[[107,[-1]],34,35],[34,35]],[[[100,[-1]],[60,[-1]]],[[71,[[36,[70]]]]],40],[[[99,[-2,-3]],[49,[-1]]],[[71,[[36,[70]]]]],40,[[107,[-1]],34,35],[34,35]],[[[100,[-1]],[49,[-1]]],[[71,[[36,[70]]]]],40],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[[36,[-1]]],[[36,[4]]],[]],[[[36,[-1]]],[[36,[4]]],[]],[[[36,[-1]]],[[36,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[99,[-1,-2]]],108,[42,34,35],[34,35]],[[[100,[-1]]],108,40],[101,108],[[-1,-2],[[99,[-1,-2]]],[],[]],[102,[[22,[[100,[-1]],103]]],40],[104,[[22,[[100,[-1]],103]]],40],[-1,[[36,[109]]],[]],[-1,[[36,[109]]],[]],[-1,[[36,[109]]],[]],[-1,[[71,[[36,[70]]]]],[]],[[[99,[-1,-2]]],[[71,[[36,[70]]]]],[44,34],34],[[[100,[-1]]],[[71,[[36,[70]]]]],40],[[[100,[-1]]],[[22,[2,103]]],40],0,[[[99,[-2,-3]],20],[[71,[[36,[70]]]]],40,[[41,[-1]],34,35],[34,35]],[[[100,[-1]],20],[[71,[[36,[70]]]]],40],[[[99,[-2,-3]],20],[[71,[[36,[70]]]]],40,[[41,[-1]],34,35],[34,35]],[[[100,[-1]],20],[[71,[[36,[70]]]]],40],[-1,-2,[],[]],[-1,-2,[],[]],[-1,[[22,[[97,[-2,-3]],[110,[-2]]]]],[],[],98],[-1,[[22,[[97,[-2,-3]],[110,[-2]]]]],[],[],98],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,47,[]],[-1,47,[]],[-1,47,[]],[[-1,[111,[-2]]],[[71,[[36,[70]]]]],[],[]],[[-1,[111,[-2]]],[[71,[[36,[70]]]]],[],[]],[[-1,[111,[-2]]],[[71,[[36,[70]]]]],[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],0,0,0,0,0,0,[[-1,3],2,[]],[[-1,1],2,[]],[[-1,3],2,[]],[[-1,1],2,[]],[112,[[9,[113]]]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[114,5],[114,5],[[[115,[-1]]],[[71,[[36,[70]]]]],40],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[114,116],[112,53],[-1,117,[]],[118,117],[[[115,[-1]]],117,40],[112,112],[119,119],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[112,112],68],[[[115,[-1]]],[[71,[[36,[70]]]]],40],[[-1,-2],68,[],[]],[119,[[22,[[115,[-1]],114]]],40],[119,[[22,[[115,[-1]],114]]],40],[[114,-1],114,[33,34,35]],[[[115,[-1]],[69,[-1]]],[[71,[[36,[70]]]]],40],[[119,21],119],[[],119],[[],[[120,[112]]]],[114],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[114],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[114,[[22,[-1,114]]],[33,26,34,35]],[114,[[9,[-1]]],[33,26,34,35]],[114,[[9,[-1]]],[33,26,34,35]],[20,2],[114,2],[20,2],[20,2],[20,2],[20,2],[[[115,[-1]]],2,40],[[112,112],77],[[-1,-2],77,[],[]],[[-1,-2],77,[],[]],[[-1,-2],77,[],[]],[[-1,-2],77,[],[]],[[118,-1,-2],[[121,[2]]],[84,122],123],[[118,-1],[[121,[2]]],123],[[114,24],[[22,[2,124]]]],[[114,24],[[22,[2,124]]]],[[112,24],[[22,[2,124]]]],[[112,24],[[22,[2,124]]]],[[119,24],25],[[[115,[-1]],24],25,[40,26]],[-1,-1,[]],[-1,114,[5,34,35]],[125,-1,[]],[-1,-1,[]],[-1,-1,[]],[126,119],[-1,-1,[]],[-1,-1,[]],[21,[[22,[119]]]],[[[115,[-1]],-2],[[71,[[36,[70]]]]],40,[[15,[[80,[-1]]]],34,35]],[[[115,[-1]],-2],[[71,[[36,[70]]]]],40,[[81,[20]],34]],[[[115,[-1]],[82,[-1]]],[[71,[[36,[70]]]]],40],[[[115,[-1]],-2],[[71,[[36,[70]]]]],40,[[15,[[86,[-1]]]],34,35]],[[[115,[-1]],-2],[[71,[[36,[70]]]]],40,[[81,[20]],34]],[[[115,[-1]],[69,[-1]],[9,[20]]],[[71,[[36,[70]]]]],40],[[-1,-2],[[32,[-2,-3]]],[],[33,34,35],[]],[[-1,-2],[[32,[-2,-3]]],[],[33,34,35],[]],[[119,-1],119,[[15,[14]]]],0,0,[[],20],[[],20],[[],20],[[],20],[[],20],[[[115,[-1]],[60,[-1]]],[[71,[[36,[70]]]]],40],[[[115,[-1]],[49,[-1]]],[[71,[[36,[70]]]]],40],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[[36,[-1]]],[[36,[4]]],[]],[[[36,[-1]]],[[36,[4]]],[]],[[[36,[-1]]],[[36,[4]]],[]],[[[36,[-1]]],[[36,[4]]],[]],[[[36,[-1]]],[[36,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[114,77],[[[115,[-1]]],108,40],[[119,-1],119,123],[-1,114,[33,26,34,35]],[112,21],[-1,114,[5,34,35]],[119,119],[[112,112],[[9,[68]]]],[[119,21],119],[-1,[[36,[109]]],[]],[[119,127],119],0,[112,128],[[-1,-2,-3],[[71,[[36,[70]]]]],35,[84,122,35],[123,34]],[[-1,-2,-3],[[71,[[36,[70]]]]],35,[84,122,35],[123,34]],[[-1,-2],[[71,[[36,[70]]]]],35,[84,122,35]],[[-1,-2,-3],[[71,[[36,[70]]]]],35,[84,122,35],[123,34]],[[-1,-2],[[71,[[36,[70]]]]],35,[84,122,35]],[[-1,-2],[[71,[[36,[70]]]]],35,[84,122,35]],[119,119],[[[115,[-1]]],[[71,[[36,[70]]]]],40],[114,5],[[119,-1],119,[[15,[14]]]],[112,[[9,[21]]]],[[[115,[-1]],20],[[71,[[36,[70]]]]],40],[[[115,[-1]],20],[[71,[[36,[70]]]]],40],[119,119],[-1,-2,[],[]],[-1,-2,[],[]],[-1,14,[]],[-1,14,[]],[[[115,[-1]]],[[121,[118]]],40],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,47,[]],[-1,47,[]],[-1,47,[]],[-1,47,[]],[-1,47,[]],[[21,21],[[22,[112,129]]]],[[-1,[111,[-2]]],[[71,[[36,[70]]]]],[],[]],[[119,21],119],[112,130],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],0,0,0,0,0,0,0,0,0,[[-1,3],2,[]],[[-1,1],2,[]],[[-1,1],2,[]],[[-1,3],2,[]],[[-1,1],2,[]],[[-1,3],2,[]],[[-1,1],2,[]],[[-1,3],2,[]],[[-1,1],2,[]],[[-1,3],2,[]],[[131,20],2],[[132,133],2],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,5,[]],[134,[[9,[8]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[134,[[9,[5]]]],[108,108],[131,131],[135,135],[132,132],[136,136],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[108,14,[9,[14]]],[[36,[137]]]],[[108,14,[9,[14]]],[[36,[138]]]],[[108,14,[9,[14]]],[[36,[139]]]],[[108,14],[[36,[140]]]],[[],108],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[134,21],[20,2],[20,2],[20,2],[20,2],[20,2],[20,2],[108,[[22,[14]]]],[[134,24],25],[[134,24],25],[[108,24],25],[[131,24],25],[[135,24],25],[[132,24],25],[[136,24],25],[141,134],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[131,20],[135,20],[136,14],[[108,21],[[22,[131,134]]]],[[108,21],[[22,[135,134]]]],[[108,21],[[22,[132,134]]]],[[108,21],[[22,[136,134]]]],[[108,-1],[[22,[108,134]]],123],[[-1,-2],[[32,[-2,-3]]],[],[33,34,35],[]],[-1,[],[]],[[],20],[[],20],[[],20],[[],20],[[],20],[[],20],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[[36,[-1]]],[[36,[4]]],[]],[[[36,[-1]]],[[36,[4]]],[]],[[[36,[-1]]],[[36,[4]]],[]],[[[36,[-1]]],[[36,[4]]],[]],[[[36,[-1]]],[[36,[4]]],[]],[[[36,[-1]]],[[36,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[132,133],[132,20],[[135,20],2],[[136,14],2],[134,[[9,[5]]]],[[108,14],[[36,[109]]]],[132,133],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,14,[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,47,[]],[-1,47,[]],[-1,47,[]],[-1,47,[]],[-1,47,[]],[-1,47,[]],[[135,142],2],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],0,0,0,0,0,0,0,0,0,0,0,[[-1,1],2,[]],[[-1,3],2,[]],[[-1,1],2,[]],[[-1,3],2,[]],0,[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,5,[]],[6,6],[6,6],[28,[[9,[8]]]],[-1,[[71,[[36,[70]]]]],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[28,[[9,[5]]]],[143,143],[28,28],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[143,143],68],[[-1,-2],68,[],[]],[-1,[[121,[108]]],[]],[-1,[[121,[108]]],[]],[[],143],[[],144],[144,[[22,[[73,[-1,28]],74]]],[34,35,75]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[28,21],[-1,[[22,[143]]],23],[-1,[[22,[28]]],23],[20,2],[20,2],[20,2],[[143,143],77],[[-1,-2],77,[],[]],[[-1,-2],77,[],[]],[[-1,-2],77,[],[]],[[-1,-2],77,[],[]],0,[[143,24],25],[[28,24],25],[[28,24],25],[-1,-1,[]],[-1,-1,[]],[79,28],[-1,-1,[]],[14,28],[29,[[22,[144,30]]]],[29,[[22,[144,30]]]],[[-1,-2],53,[83,84],85],[[],[[9,[31]]]],[[143,-1],2,87],[[-1,-2],[[32,[-2,-3]]],[],[33,34,35],[]],[-1,[],[]],[[],20],[[],20],[[],20],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[[36,[-1]]],[[36,[4]]],[]],[[[36,[-1]]],[[36,[4]]],[]],[[[36,[-1]]],[[36,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],0,[-1,[[71,[[36,[70]]]]],35],[-1,[[71,[[36,[70]]]]],35],[-1,108,[]],[[143,143],[[9,[68]]]],[-1,[[36,[109]]],[]],[[143,-1],22,46],[[28,-1],22,46],[28,[[9,[5]]]],[28,16],[-1,[[71,[[36,[70]]]]],35],[-1,[[71,[[36,[70]]]]],35],[-1,-2,[],[]],[-1,-2,[],[]],[-1,14,[]],0,[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,47,[]],[-1,47,[]],[-1,47,[]],[[144,29],[[22,[2,30]]]],[[144,29],[[22,[2,30]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],0,0],"c":[],"p":[[3,"Private",1508],[15,"tuple"],[3,"Private",1508],[8,"Any",1509],[8,"Error",1510],[3,"Command",1511],[4,"Error",0],[3,"Backtrace",1512],[4,"Option",1513],[4,"QueryError",0],[3,"NotFoundSnafu",0],[3,"MissingSnafu",0],[3,"Snafu",0],[3,"String",1514],[8,"Into",1515],[4,"StatusCode",1516],[8,"Clone",1517],[3,"Commitment",1518],[3,"Options",0],[15,"usize"],[15,"str"],[4,"Result",1519],[8,"Deserializer",1520],[3,"Formatter",1521],[6,"Result",1521],[8,"Debug",1521],[4,"Error",217],[4,"Error",1387],[3,"ArgMatches",1522],[6,"Error",1523],[3,"Id",1524],[3,"IndentedSection",1525],[8,"Display",1521],[8,"Send",1526],[8,"Sync",1526],[3,"Box",1527],[3,"Arc",1528],[3,"Rc",1529],[3,"SystemContextHandle",1530],[8,"NodeType",1531],[8,"AvailabilityDataSource",217],[8,"StatusDataSource",1387],[8,"UpdateDataSource",888],[8,"VersionedDataSource",888],[8,"NodeImplementation",1531],[8,"Serializer",1532],[3,"TypeId",1509],[3,"InconsistentLeafError",217],[3,"LeafQueryData",217],[6,"BlockHash",217],[3,"TransactionQueryData",217],[3,"InvalidTransactionIndexSnafu",217],[15,"u64"],[3,"LeafStreamSnafu",217],[3,"BlockStreamSnafu",217],[3,"InvalidSignatureKeySnafu",217],[3,"CustomSnafu",217],[4,"ResourceId",217],[8,"Committable",1518],[3,"BlockQueryData",217],[3,"RequestSnafu",217],[3,"QueryLeafSnafu",217],[3,"StreamLeafSnafu",217],[3,"QueryBlockSnafu",217],[3,"StreamBlockSnafu",217],[3,"QueryTransactionSnafu",217],[3,"QueryProposalsSnafu",217],[4,"Ordering",1533],[6,"SignatureKey",0],[8,"Future",1534],[3,"Pin",1535],[3,"Options",217],[3,"Api",1536],[4,"ApiError",1536],[8,"ReadState",1537],[8,"Iterator",1538],[15,"bool"],[8,"PartialEq",1533],[4,"RequestError",1539],[6,"BlockId",217],[8,"RangeBounds",1540],[6,"TransactionHash",217],[8,"Hash",1541],[8,"Sized",1526],[8,"BuildHasher",1541],[6,"LeafId",217],[8,"Hasher",1541],[6,"LeafHash",217],[6,"Header",0],[3,"EncodedPublicKey",1542],[3,"Leaf",1543],[6,"Metadata",0],[6,"QuorumCertificate",1544],[6,"Payload",0],[6,"TransactionIndex",217],[6,"Transaction",0],[3,"BitSlice",1545],[8,"BitOrder",1546],[3,"ExtensibleDataSource",888],[3,"FileSystemDataSource",888],[3,"MetricsDataSource",888],[3,"Path",1547],[4,"PersistenceError",1548],[3,"AtomicStoreLoader",1549],[15,"char"],[8,"FromIterator",1550],[8,"UpdateAvailabilityData",217],[3,"PrometheusMetrics",1208],[8,"Metrics",1551],[4,"BitSpanError",1552],[3,"Event",1553],[3,"Migration",1017],[3,"OffsetDateTime",1554],[3,"Error",1017],[3,"SqlDataSource",1017],[3,"Chain",1555],[3,"Client",1556],[3,"Transaction",1017],[3,"Config",1017],[3,"Vec",1557],[6,"QueryResult",0],[8,"ToStatement",1558],[8,"IntoIterator",1550],[3,"Error",1521],[15,"never"],[3,"Config",1559],[15,"u16"],[4,"Type",1560],[3,"Error",1561],[15,"u32"],[3,"Counter",1208],[3,"Histogram",1208],[15,"f64"],[4,"MetricsError",1208],[3,"Gauge",1208],[3,"Label",1208],[8,"Counter",1551],[8,"Gauge",1551],[8,"Histogram",1551],[8,"Label",1551],[4,"Error",1562],[15,"i64"],[3,"MempoolQueryData",1387],[3,"Options",1387],[8,"Resolvable",0],[13,"Custom",212],[13,"Availability",212],[13,"Status",212],[13,"Error",216],[8,"QueryablePayload",217],[13,"InvalidTransactionIndex",869],[13,"LeafStream",869],[13,"BlockStream",869],[13,"Custom",869],[13,"QueryProposals",869],[13,"QueryLeaf",869],[13,"QueryBlock",869],[13,"QueryTransaction",869],[13,"Request",869],[13,"StreamLeaf",869],[13,"StreamBlock",869],[8,"Query",1017],[13,"NoSuchMetric",1383],[13,"NoSuchSubgroup",1383],[13,"Prometheus",1383],[8,"UpdateStatusData",1387],[13,"Internal",1506],[13,"Request",1506]],"b":[[107,"impl-Display-for-Error"],[108,"impl-Debug-for-Error"],[112,"impl-Debug-for-QueryError"],[113,"impl-Display-for-QueryError"],[114,"impl-From%3C(String,+StatusCode)%3E-for-Error"],[115,"impl-From%3CError%3E-for-Error"],[117,"impl-From%3CError%3E-for-Error"],[536,"impl-Display-for-ResourceId%3CT%3E"],[537,"impl-Debug-for-ResourceId%3CT%3E"],[539,"impl-Display-for-InconsistentLeafError%3CTypes%3E"],[540,"impl-Debug-for-InconsistentLeafError%3CTypes%3E"],[555,"impl-Display-for-Error"],[556,"impl-Debug-for-Error"],[558,"impl-From%3Cusize%3E-for-ResourceId%3CT%3E"],[559,"impl-From%3CCommitment%3CT%3E%3E-for-ResourceId%3CT%3E"],[577,"impl-From%3CRequestError%3E-for-Error"],[578,"impl-From%3C(String,+StatusCode)%3E-for-Error"],[1038,"impl-AsRef%3Cdyn+Error%3E-for-Error"],[1039,"impl-AsRef%3Cdyn+Error+%2B+Send+%2B+Sync%3E-for-Error"],[1099,"impl-Debug-for-Error"],[1100,"impl-Display-for-Error"],[1101,"impl-Display-for-Migration"],[1102,"impl-Debug-for-Migration"],[1291,"impl-Display-for-MetricsError"],[1292,"impl-Debug-for-MetricsError"],[1447,"impl-Debug-for-Error"],[1448,"impl-Display-for-Error"],[1451,"impl-From%3CRequestError%3E-for-Error"],[1453,"impl-From%3CString%3E-for-Error"]]}\ +"hotshot_query_service":{"doc":"The HotShot Query Service is a minimal, generic query …","t":"NNNENGGNDNNDNDGEGIGDNGLLLLLLLLLLLLLLLLLLLLLLLLLLAMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLKALLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLOLLLLLLOLLLLLLLLLLLLLLLLLLLLLLLLLLLLMAAMMFLLLLALLMLLLLLLLLLLLLLLLLLLLKLLLLLLLLLLLLLLMMMMMMIGGDQNDEQENDNDNDNNNQDNDQGGDQNNNDNINNDEGGGGQDILLLLLLLLLLLLLLLLLLLLLLLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLFLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLKKKLKKLLLLLLLLLLLLMLLMLLLLLLLLLLLLLLKKLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLKLMKLLMLLLLLLLLLLLLLLLMLMMMLLLLLLLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLKLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMMMMMQDDGDCIILLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLKLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLKLLLLAALLLLLLLLLLLLLLLLLKLLLLLCDDCGCLLOCLICCAKKKKKADLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLDDDIDDLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLKLLLLLLLLLLLLLLLFLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLOOLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLCLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLDDDDENNNDLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMNDEQNDCIDNNDDNDILLLLLLLLLLLLMLLLLLLLLLLLLLLLLLLKLLLLLLLLLLLLLLLLLLLLLLLLLLLLLKLFLLLLLLLLLLLLLLLLLLLLLLLMLLLLLLLLLLLLLLLLLLLLKLLLLLLLLLLKLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMLLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMMMMMMENDDNIILLLLMLLLLLLLLLLKLLLLLLLLLLLLLLLLLFLLLLLLLLLLLLLLLLLMLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLMLLKLKLLLLLLLLLMLLLLLLLLLLLLLLMM","n":["Availability","Custom","Err","Error","Error","Header","Metadata","Missing","MissingSnafu","Node","NotFound","NotFoundSnafu","Ok","Options","Payload","QueryError","QueryResult","Resolvable","SignatureKey","Snafu","Status","Transaction","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","as_any","as_any","as_any","as_any","as_any","as_any","as_any_mut","as_any_mut","as_any_mut","as_any_mut","as_any_mut","as_any_mut","as_error_source","as_error_source","augment_args","augment_args_for_update","availability","availability","backtrace","backtrace","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","build","build","build","catch_all","cause","cause","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","commitment","data_source","default","deref","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","description","description","deserialize","deserialize","drop","drop","drop","drop","drop","drop","fail","fail","fail","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from_arg_matches","from_arg_matches_mut","group_id","header","header","in_current_span","in_current_span","include_migrations","init","init","init","init","init","init","instantiate_data_source_tests","internal","into","into","into","into","into","into","into_any","into_any","into_any","into_any","into_any","into_any","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_error","into_error","into_error","message","metrics","node","node","port","run_standalone_service","serialize","serialize","source","source","status","status","status","status","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","to_string","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_resolve","type_id","type_id","type_id","type_id","type_id","type_id","update_from_arg_matches","update_from_arg_matches_mut","vzip","vzip","vzip","vzip","vzip","vzip","message","source","source","source","status","message","AvailabilityDataSource","BlockHash","BlockId","BlockQueryData","BlockRange","Custom","CustomSnafu","Error","Error","Fetch","FetchBlock","FetchBlockSnafu","FetchLeaf","FetchLeafSnafu","FetchTransaction","FetchTransactionSnafu","Hash","Hash","Hash","InclusionProof","InconsistentLeafError","InvalidTransactionIndex","InvalidTransactionIndexSnafu","Iter","LeafHash","LeafId","LeafQueryData","LeafRange","Number","Number","Number","Options","Pending","QueryablePayload","Ready","Request","RequestSnafu","ResourceId","Timestamp","TransactionHash","TransactionInclusionProof","TransactionIndex","TransactionIndex","TransactionQueryData","UpdateAvailabilityData","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","api_path","as_any","as_any","as_any","as_any","as_any","as_any","as_any","as_any","as_any","as_any","as_any","as_any","as_any","as_any","as_any_mut","as_any_mut","as_any_mut","as_any_mut","as_any_mut","as_any_mut","as_any_mut","as_any_mut","as_any_mut","as_any_mut","as_any_mut","as_any_mut","as_any_mut","as_any_mut","as_error_source","as_error_source","augment_args","augment_args_for_update","backtrace","backtrace","block_hash","block_hash","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","build","build","build","build","build","by_hash","by_hash","cause","cause","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","cmp","compare","context","default","define_api","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","description","description","deserialize","deserialize","deserialize","deserialize","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","drop","enumerate","enumerate","enumerate","eq","eq","eq","eq","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","equivalent","extensions","fail","fail","fail","fail","fail","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from","from_arg_matches","from_arg_matches_mut","genesis","genesis","get_block","get_block_range","get_block_with_transaction","get_hash","get_leaf","get_leaf_range","group_id","hash","hash","hash","hash","header","header","header","header","height","height","height","height","in_current_span","in_current_span","index","init","init","init","init","init","init","init","init","init","init","init","init","init","init","insert_block","insert_leaf","internal","into","into","into","into","into","into","into","into","into","into","into","into","into","into","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_error","into_error","into_error","into_error","into_error","into_error","into_future","is_empty","is_empty","is_empty","iter","leaf","leaf","len","len","map","message","metadata","new","new","nth","nth","nth_transaction","nth_transaction","nth_transaction_with_proof","nth_transaction_with_proof","partial_cmp","payload","proof","proof","proposer","qc","qc_leaf","resolve","resource","resource","resource","serialize","serialize","serialize","serialize","size","source","source","status","status","subscribe_blocks","subscribe_blocks","subscribe_leaves","subscribe_leaves","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","to_string","to_string","transaction","transaction","transaction","transaction","transaction_by_hash","transaction_by_hash","transaction_by_hash","transaction_by_hash_with_proof","transaction_by_hash_with_proof","transaction_with_proof","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_into","try_resolve","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","type_id","update_from_arg_matches","update_from_arg_matches_mut","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","vzip","with_context","height","index","message","resource","resource","resource","source","status","Error","ExtensibleDataSource","FetchingDataSource","FileSystemDataSource","MetricsDataSource","SqlDataSource","UpdateDataSource","VersionedDataSource","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","as_any","as_any","as_any","as_any_mut","as_any_mut","as_any_mut","as_bits","as_mut","as_mut_bits","as_ref","block_height","block_height","block_height","block_height","block_height","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","clone","clone","clone","clone_into","clone_into","clone_into","commit","commit","commit","connect","count_proposals","count_proposals","create","create","create_with_store","create_with_store","default","deref","deref","deref","deref_mut","deref_mut","deref_mut","drop","drop","drop","encode_hex","encode_hex_upper","fmt","fmt","fmt","from","from","from","get_block","get_block","get_block_range","get_block_range","get_block_with_transaction","get_block_with_transaction","get_leaf","get_leaf","get_leaf_range","get_leaf_range","get_proposals","get_proposals","init","init","init","inner","inner_mut","insert_block","insert_block","insert_leaf","insert_leaf","insert_leaf","insert_leaf","into","into","into","into_any","into_any","into_any","into_any_arc","into_any_arc","into_any_arc","into_any_rc","into_any_rc","into_any_rc","metrics","metrics","metrics","new","new","open","open","open_with_store","open_with_store","populate_metrics","populate_metrics","populate_metrics","revert","revert","revert","skip_version","skip_version","sql","storage","storage","storage_mut","to_owned","to_owned","to_owned","transaction","try_as_bits","try_as_mut_bits","try_from","try_from","try_from","try_into","try_into","try_into","type_id","type_id","type_id","update","update","update","vzip","vzip","vzip","Config","Error","Migration","Query","SqlDataSource","Transaction","client","connect","include_migrations","postgres","transaction","AvailabilityStorage","FileSystemStorage","SqlStorage","fs","get_block","get_block_range","get_block_with_transaction","get_leaf","get_leaf_range","sql","FileSystemStorage","as_any","as_any_mut","block_height","borrow","borrow_mut","commit","count_proposals","create","create_with_store","deref","deref_mut","drop","fmt","from","get_block","get_block_range","get_block_with_transaction","get_leaf","get_leaf_range","get_proposals","init","insert_block","insert_leaf","insert_leaf","into","into_any","into_any_arc","into_any_rc","open","open_with_store","revert","skip_version","try_from","try_into","type_id","vzip","Config","Error","Migration","Query","SqlStorage","Transaction","__clone_box","__clone_box","__clone_box","__clone_box","applied_on","as_any","as_any","as_any","as_any","as_any","as_any_mut","as_any_mut","as_any_mut","as_any_mut","as_any_mut","as_ref","as_ref","block_height","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","chain","checksum","client","client","client","clone","clone","clone_into","clone_into","cmp","commit","compare","connect","connect","context","count_proposals","database","default","default_migrations","deref","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","downcast","downcast_mut","downcast_ref","drop","drop","drop","drop","drop","drop","drop","eq","equivalent","equivalent","equivalent","equivalent","execute","execute_many","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from_str","get_block","get_block_range","get_block_with_transaction","get_leaf","get_leaf_range","get_proposals","header","header","host","include_dir","include_migrations","init","init","init","init","init","insert_block","insert_leaf","insert_leaf","into","into","into","into","into","into_any","into_any","into_any","into_any","into_any","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","is","migrations","msg","name","new","no_migrations","partial_cmp","password","port","postgres","prefix","query","query_one","query_one_static","query_opt","query_opt_static","query_static","reset_schema","revert","root_cause","schema","sql","tls","to_owned","to_owned","to_string","to_string","transaction","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","unapplied","user","version","vzip","vzip","vzip","vzip","vzip","Counter","Gauge","Histogram","Label","MetricsError","NoSuchMetric","NoSuchSubgroup","Prometheus","PrometheusMetrics","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","add","add_point","as_any","as_any","as_any","as_any","as_any","as_any","as_any_mut","as_any_mut","as_any_mut","as_any_mut","as_any_mut","as_any_mut","as_error_source","backtrace","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","cause","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","create_counter","create_gauge","create_histogram","create_label","default","deref","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","description","drop","drop","drop","drop","drop","drop","export","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","get","get","get","get_counter","get_gauge","get_histogram","get_label","get_subgroup","header","in_current_span","init","init","init","init","init","init","into","into","into","into","into","into","into_any","into_any","into_any","into_any","into_any","into_any","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","mean","sample_count","set","set","source","subgroup","sum","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","update","vzip","vzip","vzip","vzip","vzip","vzip","label","namespace","path","source","Custom","CustomSnafu","Error","Error","InvalidSignatureKey","InvalidSignatureKeySnafu","LeafQueryData","NodeDataSource","Options","Query","QueryProposals","QueryProposalsSnafu","QuerySnafu","Request","RequestSnafu","UpdateNodeData","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","__clone_box","api_path","as_any","as_any","as_any","as_any","as_any","as_any","as_any","as_any_mut","as_any_mut","as_any_mut","as_any_mut","as_any_mut","as_any_mut","as_any_mut","as_error_source","augment_args","augment_args_for_update","backtrace","block_height","borrow","borrow","borrow","borrow","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","borrow_mut","build","build","cause","clone","clone","clone","clone","clone","clone","clone_into","clone_into","clone_into","clone_into","clone_into","clone_into","count_proposals","default","define_api","deref","deref","deref","deref","deref","deref","deref","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","deref_mut","description","deserialize","drop","drop","drop","drop","drop","drop","drop","extensions","fail","fail","fmt","fmt","fmt","fmt","fmt","fmt","fmt","from","from","from","from","from","from","from","from","from","from_arg_matches","from_arg_matches_mut","get_proposals","group_id","header","in_current_span","init","init","init","init","init","init","init","insert_leaf","internal","into","into","into","into","into","into","into","into_any","into_any","into_any","into_any","into_any","into_any","into_any","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_arc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_any_rc","into_error","into_error","into_error","into_error","into_error","message","proposer","serialize","source","status","status","to_owned","to_owned","to_owned","to_owned","to_owned","to_owned","to_string","try_from","try_from","try_from","try_from","try_from","try_from","try_from","try_into","try_into","try_into","try_into","try_into","try_into","try_into","type_id","type_id","type_id","type_id","type_id","type_id","type_id","update_from_arg_matches","update_from_arg_matches_mut","vzip","vzip","vzip","vzip","vzip","vzip","vzip","message","proposer","source","source","source","status","Error","Internal","MempoolQueryData","Options","Request","StatusDataSource","UpdateStatusData","__clone_box","__clone_box","__clone_box","__clone_box","api_path","as_any","as_any","as_any","as_any_mut","as_any_mut","as_any_mut","as_error_source","augment_args","augment_args_for_update","backtrace","block_height","borrow","borrow","borrow","borrow_mut","borrow_mut","borrow_mut","cause","clone","clone","clone_into","clone_into","cmp","compare","consensus_metrics","consensus_metrics","default","default","define_api","deref","deref","deref","deref_mut","deref_mut","deref_mut","description","deserialize","deserialize","drop","drop","drop","eq","equivalent","equivalent","equivalent","equivalent","extensions","fmt","fmt","fmt","from","from","from","from","from","from_arg_matches","from_arg_matches_mut","get_hash","group_id","hash","header","in_current_span","init","init","init","into","into","into","into_any","into_any","into_any","into_any_arc","into_any_arc","into_any_arc","into_any_rc","into_any_rc","into_any_rc","memory_footprint","mempool_info","mempool_info","metrics","partial_cmp","populate_metrics","serialize","serialize","source","status","success_rate","success_rate","to_owned","to_owned","to_string","transaction_count","try_from","try_from","try_from","try_into","try_into","try_into","type_id","type_id","type_id","update_from_arg_matches","update_from_arg_matches_mut","vzip","vzip","vzip","reason","source"],"q":[[0,"hotshot_query_service"],[216,"hotshot_query_service::Error"],[221,"hotshot_query_service::QueryError"],[222,"hotshot_query_service::availability"],[737,"hotshot_query_service::availability::Error"],[745,"hotshot_query_service::data_source"],[891,"hotshot_query_service::data_source::sql"],[902,"hotshot_query_service::data_source::storage"],[912,"hotshot_query_service::data_source::storage::fs"],[949,"hotshot_query_service::data_source::storage::sql"],[1136,"hotshot_query_service::metrics"],[1311,"hotshot_query_service::metrics::MetricsError"],[1315,"hotshot_query_service::node"],[1528,"hotshot_query_service::node::Error"],[1534,"hotshot_query_service::status"],[1653,"hotshot_query_service::status::Error"],[1655,"dyn_clone::sealed"],[1656,"dyn_clone::sealed"],[1657,"core::error"],[1658,"clap_builder::builder::command"],[1659,"snafu::backtrace_shim"],[1660,"core::option"],[1661,"alloc::string"],[1662,"core::convert"],[1663,"tide_disco::status"],[1664,"core::clone"],[1665,"commit"],[1666,"core::result"],[1667,"serde::de"],[1668,"core::fmt"],[1669,"core::fmt"],[1670,"clap_builder"],[1671,"clap_builder::util::id"],[1672,"color_eyre::section"],[1673,"core::fmt"],[1674,"core::marker"],[1675,"alloc::sync"],[1676,"alloc::rc"],[1677,"hotshot::types::handle"],[1678,"hotshot_types::traits::node_implementation"],[1679,"hotshot_types::traits::node_implementation"],[1680,"core::any"],[1681,"snafu"],[1682,"snafu"],[1683,"tide_disco::api"],[1684,"core::iter::traits::iterator"],[1685,"core::cmp"],[1686,"core::future::future"],[1687,"core::pin"],[1688,"core::ops::range"],[1689,"core::hash"],[1690,"core::marker"],[1691,"core::ops::function"],[1692,"hotshot_types::simple_certificate"],[1693,"bitvec::slice"],[1694,"bitvec::order"],[1695,"std::path"],[1696,"anyhow"],[1697,"atomic_store::atomic_store"],[1698,"core::iter::traits::collect"],[1699,"hotshot_types::traits::metrics"],[1700,"bitvec::ptr::span"],[1701,"hotshot_types::event"],[1702,"atomic_store::error"],[1703,"time::offset_date_time"],[1704,"anyhow"],[1705,"tokio_postgres::to_statement"],[1706,"core::iter::traits::collect"],[1707,"refinery_core::runner"],[1708,"refinery_core::error"],[1709,"hotshot_types::traits::metrics"],[1710,"hotshot_types::traits::signature_key"]],"d":["","","Contains the error value","","There was an error while trying to fetch the requested …","","","The requested resource exists but is not currently …","SNAFU context selector for the QueryError::Missing variant","","The requested resource does not exist or is not known to …","SNAFU context selector for the QueryError::NotFound variant","Contains the success value","","","","","A reference to a T which can be resolved into a whole T.","","SNAFU context selector for the QueryError::Error variant","","Item within a Payload.","","","","","","","","","","","","","","","","","","","","","","","","","","","Queries for HotShot chain state.","","","","","","","","","","","","","","","","Consume the selector and return the associated error","Consume the selector and return the associated error","Consume the selector and return the associated error","","","","","","","","","","","","","","Get a commitment to the underlying object.","Persistent storage and sources of data consumed by APIs.","","","","","","","","","","","","","","","","","","","","","","","","Consume the selector and return a Result with the …","Consume the selector and return a Result with the …","Consume the selector and return a Result with the …","","","","","","","","","Returns the argument unchanged.","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","","","","","","Embed migrations from the given directory into the current …","","","","","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","A node’s view of a HotShot chain","","","Run an instance of the HotShot Query service with no …","","","","","Queries for node-specific state and uncommitted data.","","","","","","","","","","","","","","","","","","","","","","","Get the underlying object if it is available without …","","","","","","","","","","","","","","","","","","","","","An interface for querying a HotShot blockchain.","A block hash is the hash of the block header.","","","","","SNAFU context selector for the Error::Custom variant","","","An in-progress request to fetch some data.","","SNAFU context selector for the Error::FetchBlock variant","","SNAFU context selector for the Error::FetchLeaf variant","","SNAFU context selector for the Error::FetchTransaction …","","","","A proof that a certain transaction exists in the block.","","","SNAFU context selector for the …","Enumerate the transactions in this block.","","","","","","","","","","A block payload whose contents (e.g. individual …","","","SNAFU context selector for the Error::Request variant","","","","","","An index which can be used to efficiently retrieve a …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Consume the selector and return the associated error","Consume the selector and return the associated error","Consume the selector and return the associated error","Consume the selector and return the associated error","Consume the selector and return the associated error","Get the index of the transaction with a given hash, if it …","Get the index of the transaction with a given hash, if it …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Convert this Fetch to a Result with the provided error …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Enumerate the transactions in the block with their indices.","Enumerate the transactions in the block with their indices.","","","","","","","","","","","","","","","","","","","","","","Additional API specification files to merge with …","Consume the selector and return a Result with the …","Consume the selector and return a Result with the …","Consume the selector and return a Result with the …","Consume the selector and return a Result with the …","Consume the selector and return a Result with the …","","","","","","","","","","","","","","","","Returns the argument unchanged.","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","Returns the argument unchanged.","","","","","","","","Returns the block containing a transaction with the given …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Whether this block is empty of transactions.","Whether this block is empty of transactions.","","List the transaction indices in the block.","","","The number of transactions in the block.","","Transform the result of this fetch.","","","Collect information about a Leaf.","Collect information about a block.","Get the index of the nth transaction.","Get the index of the nth transaction.","Get the nth transaction.","Get the nth transaction.","Get the nth transaction, along with an inclusion proof.","Get the nth transaction, along with an inclusion proof.","","","Get an inclusion proof for a transaction with a given …","Get an inclusion proof for a transaction with a given …","","","","Wait for the data to become available, if it is not …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Get a transaction by its block-specific index.","Get a transaction by its block-specific index.","","","Get the transaction with a given hash, if it is in the …","Get the transaction with a given hash, if it is in the …","","Get the transaction with a given hash, if it is in the …","Get the transaction with a given hash, if it is in the …","Get a transaction by its block-specific index, along with …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Get the requested data if it is available immediately.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Convert this Fetch to a Result with the provided error …","","","","","","","","","","Wrapper to add extensibility to an existing data source.","The most basic kind of data source.","A data source for the APIs provided in this crate, backed …","A minimal data source for the status API provided in this …","","An extension trait for types which implement the update …","A data source with an atomic transaction-based …","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Atomically commit to all outstanding modifications to the …","","","Connect to a remote database.","","","Create a new FileSystemDataSource with storage at path.","Create a new FileSystemDataSource with storage at path.","Create a new FileSystemDataSource using a persistent …","Create a new FileSystemDataSource using a persistent …","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","","","","","","","","","","","","","","Access the underlying data source.","Mutably access the underlying data source.","","","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","Create a data source with local storage and a remote data …","Open an existing FileSystemDataSource from storage at path.","Open an existing FileSystemDataSource from storage at path.","Open an existing FileSystemDataSource using a persistent …","Open an existing FileSystemDataSource using a persistent …","","","","Erase all oustanding modifications to the data.","","","Advance the version of the persistent store without …","Advance the version of the persistent store without …","","Persistent storage for data sources.","Obtain direct, read-only access to the underlying local …","Obtain direct, mutable access the underlying local storage.","","","","Access the transaction which is accumulating all …","","","","","","","","","","","","Update query state based on a new consensus event.","","","","","","","The Error type, a wrapper around a dynamic error type.","Represents a schema migration to be run on the database, …","","A data source for the APIs provided in this crate, backed …","","","Connect to a remote database.","Embed migrations from the given directory into the current …","","Access the transaction which is accumulating all …","Persistent storage for a HotShot blockchain.","","","","","","","","","","Storage for the APIs provided in this crate, backed by a …","","","","","","","","Create a new FileSystemStorage with storage at path.","Create a new FileSystemStorage using a persistent storage …","","","","","Returns the argument unchanged.","","","","","","","","","","","Calls U::from(self).","","","","Open an existing FileSystemStorage from storage at path.","Open an existing FileSystemStorage using a persistent …","","Advance the version of the persistent store without …","","","","","Postgres client config.","The Error type, a wrapper around a dynamic error type.","Represents a schema migration to be run on the database, …","","Storage for the APIs provided in this crate, backed by a …","An atomic SQL transaction.","","","","","Get the timestamp from when the Migration was applied. None…","","","","","","","","","","","","","","","","","","","","","","","","An iterator of the chain of source errors contained by …","Get the Migration checksum. Checksum is formed from the …","","","","","","","","","","","Connect to the database with this config.","Connect to a remote database.","Wrap the error value with additional context.","","Set the name of the database to connect to.","","The migrations requied to build the default schema for …","","","","","","","","","","","","","Attempt to downcast the error object to a concrete type.","Downcast this error object by mutable reference.","Downcast this error object by reference.","","","","","","","","","","","","","Execute a statement against the underlying database.","","","","","","","","Returns the argument unchanged.","","","Returns the argument unchanged.","Returns the argument unchanged.","","Returns the argument unchanged.","Returns the argument unchanged.","","","","","","","","","","Set the hostname of the database server.","Embed the contents of a directory in your crate.","Embed migrations from the given directory into the current …","","","","","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","Returns true if E is the type held by this error object.","Add custom migrations to run when connecting to the …","Create a new error object from a printable error message.","Get the Migration Name","Create a new error object from any error type.","Skip all migrations when connecting to the database.","","Set a password for connecting to the database.","Set the port on which to connect to the database.","","Get the Prefix","","Query the underlying SQL database, returning exactly one …","Query the underlying SQL database with no parameters, …","Query the underlying SQL database, returning zero or one …","Query the underlying SQL database with no parameters, …","Query the underlying SQL database with no parameters.","Reset the schema on connection.","","The lowest level cause of this error — this error’s …","Set the name of the schema to use for queries.","","Use TLS for an encrypted connection to the database.","","","","","Access the transaction which is accumulating all …","","","","","","","","","","","","","","","","Create an unapplied migration, name and version are parsed …","Set the DB user to connect as.","Get the Migration version","","","","","","A Counter metric.","A Gauge metric.","A Histogram metric.","A Label metric.","","","","","A Prometheus-based implementation of a Metrics registry.","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","","Get a counter in this sub-group by name.","Get a gauge in this sub-group by name.","Get a histogram in this sub-group by name.","Get a label in this sub-group by name.","Get a (possibly nested) subgroup of this group by its path.","","","","","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","SNAFU context selector for the Error::Custom variant","","","","SNAFU context selector for the Error::InvalidSignatureKey …","","","","","","SNAFU context selector for the Error::QueryProposals …","SNAFU context selector for the Error::Query variant","","SNAFU context selector for the Error::Request variant","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Consume the selector and return the associated error","Consume the selector and return the associated error","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Additional API specification files to merge with …","Consume the selector and return a Result with the …","Consume the selector and return a Result with the …","","","","","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","","","","","","","","","","","","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","Additional API specification files to merge with …","","","","Returns the argument unchanged.","Returns the argument unchanged.","Returns the argument unchanged.","","","","","","","","","","","","","Calls U::from(self).","Calls U::from(self).","Calls U::from(self).","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","","",""],"i":[7,7,117,0,10,0,0,10,0,7,10,0,117,0,0,0,0,0,0,0,7,0,7,7,11,11,12,12,13,13,10,10,7,11,12,13,10,19,7,11,12,13,10,19,7,10,19,19,0,19,7,10,7,11,12,13,10,19,7,11,12,13,10,19,11,12,13,7,7,10,7,11,12,13,10,7,11,12,13,10,156,0,19,7,11,12,13,10,19,7,11,12,13,10,19,7,10,7,10,7,11,12,13,10,19,11,12,13,7,7,11,12,13,10,10,7,7,7,7,7,11,12,13,10,19,19,19,19,7,10,7,10,0,7,11,12,13,10,19,0,7,7,11,12,13,10,19,7,11,12,13,10,19,7,11,12,13,10,19,7,11,12,13,10,19,11,12,13,13,0,0,19,19,0,7,10,7,10,0,7,10,19,7,11,12,13,10,7,10,7,11,12,13,10,19,7,11,12,13,10,19,156,7,11,12,13,10,19,19,19,7,11,12,13,10,19,157,158,159,160,157,161,0,0,0,0,42,27,0,0,112,0,27,0,27,0,27,0,78,84,60,162,0,27,0,162,0,0,0,42,78,84,60,0,65,0,65,27,0,0,0,0,0,0,162,0,0,60,60,51,51,50,50,62,62,53,53,63,63,54,54,55,55,56,56,57,57,59,59,27,27,68,65,60,51,50,62,53,68,63,54,55,56,57,59,27,65,60,51,50,62,53,68,63,54,55,56,57,59,27,50,27,68,68,50,27,51,53,65,60,51,50,62,53,68,63,54,55,56,57,59,27,65,60,51,50,62,53,68,63,54,55,56,57,59,27,54,55,56,57,59,162,162,50,27,60,51,50,62,53,63,54,55,56,57,59,27,60,51,50,62,53,63,54,55,56,57,59,27,60,60,65,68,0,65,60,51,50,62,53,68,63,54,55,56,57,59,27,65,60,51,50,62,53,68,63,54,55,56,57,59,27,50,27,51,62,53,27,65,60,51,50,62,53,68,63,54,55,56,57,59,27,162,162,62,60,51,62,53,60,60,60,60,51,51,51,51,62,62,62,62,53,53,53,53,68,54,55,56,57,59,60,60,51,50,50,62,53,63,54,55,56,57,59,27,27,65,60,60,60,51,50,62,53,68,63,54,55,56,57,59,27,27,27,68,68,51,62,42,42,42,60,42,42,68,60,51,62,53,60,50,62,27,51,62,53,57,50,27,57,65,60,51,50,62,53,68,63,54,55,56,57,59,27,112,112,27,65,60,51,50,62,53,68,63,54,55,56,57,59,27,65,60,51,50,62,53,68,63,54,55,56,57,59,27,60,51,50,62,53,68,63,54,55,56,57,59,27,65,60,51,50,62,53,68,63,54,55,56,57,59,27,63,54,55,56,57,59,65,162,162,62,162,51,50,162,62,65,59,62,51,62,162,162,162,162,162,162,60,62,162,162,51,51,50,65,54,55,56,51,62,53,27,62,50,27,27,59,42,42,42,42,60,51,50,62,53,63,54,55,56,57,59,27,60,50,27,162,162,62,53,162,162,62,162,162,162,65,60,51,50,62,53,68,63,54,55,56,57,59,27,65,60,51,50,62,53,68,63,54,55,56,57,59,27,65,65,60,51,50,62,53,68,63,54,55,56,57,59,27,68,68,65,60,51,50,62,53,68,63,54,55,56,57,59,27,65,163,163,164,165,166,167,168,164,46,0,0,0,0,0,0,0,98,98,99,99,100,100,98,99,100,98,99,100,98,98,98,98,98,98,99,99,100,98,99,100,98,99,100,98,99,100,98,99,100,46,98,99,99,98,99,105,99,105,99,100,98,99,100,98,99,100,98,99,100,98,98,98,99,100,98,99,100,98,99,98,99,98,99,98,99,98,99,98,99,98,99,100,98,98,98,99,98,98,99,99,98,99,100,98,99,100,98,99,100,98,99,100,98,99,100,98,99,105,99,105,99,98,99,100,46,98,99,105,99,0,0,99,99,98,99,100,99,98,98,98,99,100,98,99,100,98,99,100,45,98,99,98,99,100,0,0,0,0,0,0,120,120,0,0,120,0,0,0,0,111,111,111,111,111,0,0,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,107,0,0,0,0,0,0,122,122,101,101,122,103,122,116,101,102,103,122,116,101,102,103,103,102,103,122,116,101,102,103,122,116,101,102,103,122,169,116,102,122,101,122,101,122,102,122,101,102,103,102,101,101,0,103,103,122,116,101,102,103,103,122,116,101,102,103,103,103,103,103,122,116,101,102,102,122,122,122,122,122,116,116,103,103,122,122,101,102,103,103,103,122,116,101,101,102,101,102,102,102,102,102,102,103,122,101,0,0,103,122,116,101,102,102,102,102,103,122,116,101,102,103,122,116,101,102,103,122,116,101,102,103,122,116,101,102,103,101,103,122,103,101,122,101,101,0,122,169,169,169,169,169,169,101,102,103,101,122,101,122,101,103,122,102,103,122,116,101,102,103,122,116,101,102,103,122,116,101,102,122,101,122,103,122,116,101,102,0,0,0,0,0,138,138,138,0,114,114,135,135,139,139,136,136,140,140,135,136,138,114,135,139,136,140,138,114,135,139,136,140,138,138,138,114,135,139,136,140,138,114,135,139,136,140,138,114,135,139,136,140,114,135,139,136,140,114,114,114,114,114,138,114,135,139,136,140,138,114,135,139,136,140,138,138,114,135,139,136,140,114,138,138,114,135,139,136,140,138,138,114,135,139,136,140,135,139,140,114,114,114,114,114,138,138,138,114,135,139,136,140,138,114,135,139,136,140,138,114,135,139,136,140,138,114,135,139,136,140,138,114,135,139,136,140,136,136,139,140,138,114,136,114,135,139,136,140,138,138,114,135,139,136,140,138,114,135,139,136,140,138,114,135,139,136,140,139,138,114,135,139,136,140,170,170,171,172,29,0,0,113,29,0,0,0,0,29,29,0,0,29,0,0,149,149,150,150,151,151,147,147,148,148,29,29,152,152,149,150,151,147,148,29,152,149,150,151,147,148,29,29,152,152,29,43,152,149,150,151,147,148,29,152,149,150,151,147,148,29,147,148,29,149,150,151,147,148,29,149,150,151,147,148,29,43,152,0,152,149,150,151,147,148,29,152,149,150,151,147,148,29,29,29,152,149,150,151,147,148,29,152,147,148,149,150,151,147,148,29,29,152,149,150,151,147,148,29,29,29,152,152,43,152,29,29,152,149,150,151,147,148,29,113,29,152,149,150,151,147,148,29,152,149,150,151,147,148,29,152,149,150,151,147,148,29,152,149,150,151,147,148,29,149,150,151,147,148,148,151,29,29,29,148,149,150,151,147,148,29,29,152,149,150,151,147,148,29,152,149,150,151,147,148,29,152,149,150,151,147,148,29,152,152,152,149,150,151,147,148,29,173,174,175,176,174,173,0,28,0,0,28,0,0,154,154,28,28,155,154,155,28,154,155,28,28,155,155,28,44,154,155,28,154,155,28,28,154,28,154,28,154,154,44,44,154,155,0,154,155,28,154,155,28,28,154,28,154,155,28,154,154,154,154,154,155,154,28,28,154,155,28,28,28,155,155,154,155,154,28,28,154,155,28,154,155,28,154,155,28,154,155,28,154,155,28,154,44,44,44,154,177,154,28,28,28,44,44,154,28,28,154,154,155,28,154,155,28,154,155,28,155,155,154,155,28,178,179],"f":[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[-1,1],2,[]],[[-1,3],2,[]],[[-1,3],2,[]],[[-1,1],2,[]],[[-1,1],2,[]],[[-1,3],2,[]],[[-1,1],2,[]],[[-1,3],2,[]],[[-1,1],2,[]],[[-1,3],2,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,5,[]],[-1,5,[]],[6,6],[6,6],0,0,[7,[[9,[8]]]],[10,[[9,[8]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[11,10],[12,10],[[[13,[-1]]],10,[[15,[14]]]],[[16,14],7],[7,[[9,[5]]]],[10,[[9,[5]]]],[7,7],[11,11],[12,12],[[[13,[-1]]],[[13,[-1]]],17],[10,10],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[-1,[[18,[-2]]],[],[]],0,[[],19],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[7,21],[10,21],[-1,[[22,[7]]],23],[-1,[[22,[10]]],23],[20,2],[20,2],[20,2],[20,2],[20,2],[20,2],[11,[[22,[-1,10]]],[]],[12,[[22,[-1,10]]],[]],[[[13,[-1]]],[[22,[-2,10]]],[[15,[14]]],[]],[[7,24],25],[[7,24],25],[[11,24],25],[[12,24],25],[[[13,[-1]],24],25,26],[[10,24],25],[[10,24],25],[27,7],[-1,-1,[]],[28,7],[[[2,[14,16]]],7],[29,7],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[30,[[22,[19,31]]]],[30,[[22,[19,31]]]],[[],[[9,[32]]]],[[-1,-2],[[33,[-2,-3]]],[],[34,35,36],[]],[[-1,-2],[[33,[-2,-3]]],[],[34,35,36],[]],[-1,[],[]],[-1,[],[]],0,[[],20],[[],20],[[],20],[[],20],[[],20],[[],20],0,[-1,7,34],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[39,[-1]]],[[39,[4]]],[]],[[[39,[-1]]],[[39,[4]]],[]],[[[39,[-1]]],[[39,[4]]],[]],[[[39,[-1]]],[[39,[4]]],[]],[[[39,[-1]]],[[39,[4]]],[]],[[[39,[-1]]],[[39,[4]]],[]],[11,10],[12,10],[[[13,[-1]]],10,[[15,[14]]]],0,0,0,0,0,[[19,-2,[40,[-1,-3]]],[[22,[2,7]]],41,[[42,[-1]],[43,[-1]],44,[45,[-1]],46,35,36],[[47,[-1]]]],[[7,-1],22,48],[[10,-1],22,48],[7,[[9,[5]]]],[10,[[9,[5]]]],0,[7,16],[10,16],0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,14,[]],[-1,14,[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2,-1]]],[],[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[[19,30],[[22,[2,31]]]],[[19,30],[[22,[2,31]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[-1,1],2,[]],[[-1,3],2,[]],[[-1,1],2,[]],[[-1,3],2,[]],[[-1,1],2,[]],[[-1,3],2,[]],[[-1,3],2,[]],[[-1,1],2,[]],[[-1,3],2,[]],[[-1,1],2,[]],[[-1,3],2,[]],[[-1,1],2,[]],[[-1,1],2,[]],[[-1,3],2,[]],[[-1,3],2,[]],[[-1,1],2,[]],[[-1,1],2,[]],[[-1,3],2,[]],[[-1,3],2,[]],[[-1,1],2,[]],[[-1,1],2,[]],[[-1,3],2,[]],[[-1,3],2,[]],[[-1,1],2,[]],0,[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,5,[]],[-1,5,[]],[6,6],[6,6],[[[50,[-1]]],[[9,[8]]],41],[27,[[9,[8]]]],[[[51,[-1]]],[[52,[-1]]],41],[[[53,[-1]]],[[52,[-1]]],41],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[[54,[-1]]],27,[[15,[14]]]],[[[55,[-1]]],27,[[15,[14]]]],[[[56,[-1]]],27,[[15,[14]]]],[[[57,[-1,-2]]],27,[[15,[58]]],[[15,[58]]]],[[[59,[-1,-2]]],27,[[15,[14]]],[[15,[16]]]],[[-1,18],9,[]],[[-1,18],9,[]],[[[50,[-1]]],[[9,[5]]],41],[27,[[9,[5]]]],[[[60,[-1]]],[[60,[-1]]],61],[[[51,[-1]]],[[51,[-1]]],[17,41]],[[[50,[-1]]],[[50,[-1]]],[17,41]],[[[62,[-1]]],[[62,[-1]]],[17,41]],[[[53,[-1]]],[[53,[-1]]],[17,41]],[63,63],[[[54,[-1]]],[[54,[-1]]],17],[[[55,[-1]]],[[55,[-1]]],17],[[[56,[-1]]],[[56,[-1]]],17],[[[57,[-1,-2]]],[[57,[-1,-2]]],17,17],[[[59,[-1,-2]]],[[59,[-1,-2]]],17,17],[27,27],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[[60,[-1]],[60,[-1]]],64,61],[[-1,-2],64,[],[]],[[[65,[-1]],-3],[[22,[-1,-2]]],[],[5,66],[[67,[-2]]]],[[],68],[68,[[22,[[69,[-1,27]],70]]],[35,36,71]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[[[50,[-1]]],21,41],[27,21],[-1,[[22,[[51,[-2]]]]],23,41],[-1,[[22,[[62,[-2]]]]],23,41],[-1,[[22,[[53,[-2]]]]],23,41],[-1,[[22,[27]]],23],[20,2],[20,2],[20,2],[20,2],[20,2],[20,2],[20,2],[20,2],[20,2],[20,2],[20,2],[20,2],[20,2],[20,2],[-1,[[37,[72]]],[]],[-1,[[37,[72]]],[]],[[[62,[-1]]],[[0,[72]]],41],[[[60,[-1]],[60,[-1]]],73,61],[[[51,[-1]],[51,[-1]]],73,[74,41]],[[[62,[-1]],[62,[-1]]],73,[74,41]],[[[53,[-1]],[53,[-1]]],73,[74,41]],[[-1,-2],73,[],[]],[[-1,-2],73,[],[]],[[-1,-2],73,[],[]],[[-1,-2],73,[],[]],[[-1,-2],73,[],[]],[[-1,-2],73,[],[]],[[-1,-2],73,[],[]],[[-1,-2],73,[],[]],[[-1,-2],73,[],[]],[[-1,-2],73,[],[]],[[-1,-2],73,[],[]],[[-1,-2],73,[],[]],[[-1,-2],73,[],[]],[[-1,-2],73,[],[]],[[-1,-2],73,[],[]],[[-1,-2],73,[],[]],0,[[[54,[-1]]],[[22,[-2,27]]],[[15,[14]]],[]],[[[55,[-1]]],[[22,[-2,27]]],[[15,[14]]],[]],[[[56,[-1]]],[[22,[-2,27]]],[[15,[14]]],[]],[[[57,[-1,-2]]],[[22,[-3,27]]],[[15,[58]]],[[15,[58]]],[]],[[[59,[-1,-2]]],[[22,[-3,27]]],[[15,[14]]],[[15,[16]]],[]],[[[60,[-1]],24],25,61],[[[60,[-1]],24],25,61],[[[51,[-1]],24],25,[26,41]],[[[50,[-1]],24],25,41],[[[50,[-1]],24],25,[26,41]],[[[62,[-1]],24],25,[26,41]],[[[53,[-1]],24],25,[26,41]],[[63,24],25],[[[54,[-1]],24],25,26],[[[55,[-1]],24],25,26],[[[56,[-1]],24],25,26],[[[57,[-1,-2]],24],25,26,26],[[[59,[-1,-2]],24],25,26,26],[[27,24],25],[[27,24],25],[-1,-1,[]],[20,[[60,[-1]]],61],[[[18,[-1]]],[[60,[-1]]],61],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[[[2,[14,16]]],27],[-1,-1,[]],[75,27],[30,[[22,[68,31]]]],[30,[[22,[68,31]]]],[[],[[51,[-1]]],41],[[],[[62,[-1]]],41],[[-1,-3],[[77,[[37,[76]]]]],[],[],[[15,[[78,[-2]]]],35,36]],[[-1,-2],[[77,[[37,[76]]]]],[],[[79,[20]],35]],[[-1,[80,[-2]]],[[77,[[37,[76]]]]],[],[]],[[-1,-2],58,[81,82],83],[[-1,-3],[[77,[[37,[76]]]]],[],[],[[15,[[84,[-2]]]],35,36]],[[-1,-2],[[77,[[37,[76]]]]],[],[[79,[20]],35]],[[],[[9,[32]]]],[[[60,[-1]],-2],2,61,85],[[[51,[-1]]],[[86,[-1]]],41],[[[62,[-1]]],[[52,[-1]]],41],[[[53,[-1]]],[[80,[-1]]],41],[[-1,-2],[[33,[-2,-3]]],[],[34,35,36],[]],[[-1,-2],[[33,[-2,-3]]],[],[34,35,36],[]],[[[62,[-1]]],[[87,[-1]]],41],[[-1,-2],[[33,[-2,-3]]],[],[34,35,36],[]],[[[51,[-1]]],58,41],[[[62,[-1]]],58,41],[[[53,[-1]]],58,41],0,[-1,[],[]],[-1,[],[]],0,[[],20],[[],20],[[],20],[[],20],[[],20],[[],20],[[],20],[[],20],[[],20],[[],20],[[],20],[[],20],[[],20],[[],20],[[-1,[62,[-2]]],[[77,[[37,[76]]]]],[],[]],[[-1,[51,[-2]]],[[77,[[37,[76]]]]],[],[]],[-1,27,34],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[39,[-1]]],[[39,[4]]],[]],[[[39,[-1]]],[[39,[4]]],[]],[[[39,[-1]]],[[39,[4]]],[]],[[[39,[-1]]],[[39,[4]]],[]],[[[39,[-1]]],[[39,[4]]],[]],[[[39,[-1]]],[[39,[4]]],[]],[[[39,[-1]]],[[39,[4]]],[]],[[[39,[-1]]],[[39,[4]]],[]],[[[39,[-1]]],[[39,[4]]],[]],[[[39,[-1]]],[[39,[4]]],[]],[[[39,[-1]]],[[39,[4]]],[]],[[[39,[-1]]],[[39,[4]]],[]],[[[39,[-1]]],[[39,[4]]],[]],[[[39,[-1]]],[[39,[4]]],[]],[63,27],[[[54,[-1]]],27,[[15,[14]]]],[[[55,[-1]]],27,[[15,[14]]]],[[[56,[-1]]],27,[[15,[14]]]],[[[57,[-1,-2]]],27,[[15,[58]]],[[15,[58]]]],[[[59,[-1,-2]]],27,[[15,[14]]],[[15,[16]]]],[[[65,[-1]]],[],35],[-1,73,[]],[-1,73,[]],[[[62,[-1]]],73,41],[-1,[],[]],[[[51,[-1]]],[[88,[-1]]],41],0,[-1,20,[]],[[[62,[-1]]],20,41],[[[65,[-1]],-2],[[65,[-3]]],[],[35,89],[]],0,[[[62,[-1]]],[[90,[-1]]],41],[[[88,[-1]],[91,[-1]]],[[22,[[51,[-1]],[50,[-1]]]]],41],[[[88,[-1]],[91,[-1]],[92,[-1]]],[[22,[[62,[-1]],[50,[-1]]]]],41],[[-1,20],9,[]],[[-1,20],9,[]],[[-1,20],9,[]],[[-1,20],9,[]],[[-1,20],[[9,[2]]],[]],[[-1,20],[[9,[2]]],[]],[[[60,[-1]],[60,[-1]]],[[9,[64]]],61],[[[62,[-1]]],[[92,[-1]]],41],[-1,9,[]],[-1,9,[]],[[[51,[-1]]],[[93,[-1]]],41],[[[51,[-1]]],[[91,[-1]]],41],0,[[[65,[-1]]],-1,35],0,0,0,[[[51,[-1]],-2],22,41,48],[[[62,[-1]],-2],22,41,48],[[[53,[-1]],-2],22,41,48],[[27,-1],22,48],[[[62,[-1]]],58,41],[[[50,[-1]]],[[9,[5]]],41],[27,[[9,[5]]]],[27,16],0,[[-1,20],[[77,[[37,[76]]]]],36],[[-1,20],[[77,[[37,[76]]]]],36],[[-1,20],[[77,[[37,[76]]]]],36],[[-1,20],[[77,[[37,[76]]]]],36],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,14,[]],[-1,14,[]],[-1,14,[]],[-1,9,[]],[-1,9,[]],[[[62,[-1]],[94,[-1]]],[[9,[[53,[-1]]]]],41],[[[53,[-1]]],[[95,[-1]]],41],[[-1,18],9,[]],[[-1,18],9,[]],[[[62,[-1]],[18,[[95,[-1]]]]],[[9,[[94,[-1]]]]],41],[[-1,18],[[9,[2]]],[]],[[-1,18],[[9,[2]]],[]],[-1,[[9,[2]]],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[[[65,[-1]]],[[22,[-1,[65,[-1]]]]],[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[[68,30],[[22,[2,31]]]],[[68,30],[[22,[2,31]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[[65,[-1]],-2],[[22,[-1,-3]]],[],89,[5,66]],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[-1,3],2,[]],[[-1,1],2,[]],[[-1,3],2,[]],[[-1,1],2,[]],[[-1,3],2,[]],[[-1,1],2,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,[[96,[-2,-3]]],[],[],97],[[[98,[-1,-2]]],-2,[],[]],[-1,[[96,[-2,-3]]],[],[],97],[[[98,[-1,-2]]],-2,[],[]],[[[98,[-2,-3]]],[[77,[[37,[76]]]]],41,[[43,[-1]],35,36],[35,36]],[[[98,[-1,-2]]],[[77,[[37,[76]]]]],[44,35,36],[35,36]],[[[99,[-1,-2,-3]]],[[77,[[37,[76]]]]],41,[[43,[-1]],35,36],[35,36]],[[[99,[-1,-2,-3]]],[[77,[[37,[76]]]]],41,[[43,[-1]],35,36],[35,36]],[100,[[77,[[37,[76]]]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[[98,[-1,-2]]],[[98,[-1,-2]]],17,17],[[[99,[-1,-2,-3]]],[[99,[-1,-2,-3]]],41,[],[]],[100,100],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[-1,[[77,[[37,[76]]]]],[]],[[[98,[-1,-2]]],[[77,[[37,[76]]]]],[46,35],35],[[[99,[-1,-2,-3]]],[[77,[[37,[76]]]]],41,[46,35,36],[35,36]],[101,[[22,[[99,[-1,102,2]],103]]],41],[[[98,[-2,-3]],[93,[-1]]],[[77,[[37,[76]]]]],41,[[43,[-1]],35,36],[35,36]],[[[99,[-1,-2,-3]],[93,[-1]]],[[77,[[37,[76]]]]],41,[[43,[-1]],35,36],[35,36]],[104,[[106,[[105,[-1]]]]],41],[104,[[106,[[99,[-1,[107,[-1]],2]]]]],41],[108,[[106,[[105,[-1]]]]],41],[108,[[106,[[99,[-1,[107,[-1]],2]]]]],41],[[],100],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,2],[20,2],[20,2],[-1,-2,[],[[110,[109]]]],[-1,-2,[],[[110,[109]]]],[[[98,[-1,-2]],24],25,26,26],[[[99,[-1,-2,-3]],24],25,41,26,26],[[100,24],25],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[[[98,[-2,-3]],-4],[[77,[[37,[76]]]]],41,[[42,[-1]],35,36],[35,36],[[15,[[78,[-1]]]],35,36]],[[[99,[-1,-2,-3]],-4],[[77,[[37,[76]]]]],41,[[111,[-1]]],[35,36],[[15,[[78,[-1]]]],35,36]],[[[98,[-2,-3]],-4],[[77,[[37,[76]]]]],41,[[42,[-1]],35,36],[35,36],[[79,[20]],35]],[[[99,[-1,-2,-3]],-4],[[77,[[37,[76]]]]],41,[[111,[-1]]],[35,36],[[79,[20]],35]],[[[98,[-2,-3]],[80,[-1]]],[[77,[[37,[76]]]]],41,[[42,[-1]],35,36],[35,36]],[[[99,[-1,-2,-3]],[80,[-1]]],[[77,[[37,[76]]]]],41,[[111,[-1]]],[35,36]],[[[98,[-2,-3]],-4],[[77,[[37,[76]]]]],41,[[42,[-1]],35,36],[35,36],[[15,[[84,[-1]]]],35,36]],[[[99,[-1,-2,-3]],-4],[[77,[[37,[76]]]]],41,[[111,[-1]]],[35,36],[[15,[[84,[-1]]]],35,36]],[[[98,[-2,-3]],-4],[[77,[[37,[76]]]]],41,[[42,[-1]],35,36],[35,36],[[79,[20]],35]],[[[99,[-1,-2,-3]],-4],[[77,[[37,[76]]]]],41,[[111,[-1]]],[35,36],[[79,[20]],35]],[[[98,[-2,-3]],[93,[-1]],[9,[20]]],[[77,[[37,[76]]]]],41,[[43,[-1]],35,36],[35,36]],[[[99,[-1,-2,-3]],[93,[-1]],[9,[20]]],[[77,[[37,[76]]]]],41,[[43,[-1]],35,36],[35,36]],[[],20],[[],20],[[],20],[[[98,[-1,-2]]],-1,[],[]],[[[98,[-1,-2]]],-1,[],[]],[[[98,[-2,-3]],[62,[-1]]],[[77,[[37,[76]]]]],41,[[112,[-1]],35,36],[35,36]],[[[99,[-1,-2,-3]],[62,[-1]]],[[77,[[37,[76]]]]],41,[[112,[-1]],35,36],[35,36]],[[[98,[-2,-3]],[51,[-1]]],[[77,[[37,[76]]]]],41,[[113,[-1]],35,36],[35,36]],[[[98,[-2,-3]],[51,[-1]]],[[77,[[37,[76]]]]],41,[[112,[-1]],35,36],[35,36]],[[[99,[-1,-2,-3]],[51,[-1]]],[[77,[[37,[76]]]]],41,[[112,[-1]],35,36],[35,36]],[[[99,[-1,-2,-3]],[51,[-1]]],[[77,[[37,[76]]]]],41,[[113,[-1]],35,36],[35,36]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[39,[-1]]],[[39,[4]]],[]],[[[39,[-1]]],[[39,[4]]],[]],[[[39,[-1]]],[[39,[4]]],[]],[[[98,[-1,-2]]],114,[44,35,36],[35,36]],[[[99,[-1,-2,-3]]],114,41,[[43,[-1]],35,36],[35,36]],[100,114],[[-1,-2],[[98,[-1,-2]]],[],[]],[[-2,-3],[[106,[[99,[-1,-2,-3]]]]],41,[[43,[-1]],[113,[-1]],[111,[-1]],46],[35,36]],[104,[[106,[[105,[-1]]]]],41],[104,[[106,[[99,[-1,[107,[-1]],2]]]]],41],[108,[[106,[[105,[-1]]]]],41],[108,[[106,[[99,[-1,[107,[-1]],2]]]]],41],[-1,[[37,[115]]],[]],[-1,[[37,[115]]],[]],[-1,[[37,[115]]],[]],[-1,[[77,[[37,[76]]]]],[]],[[[98,[-1,-2]]],[[77,[[37,[76]]]]],[46,35],35],[[[99,[-1,-2,-3]]],[[77,[[37,[76]]]]],41,[46,35,36],[35,36]],[[[105,[-1]]],[[106,[2]]],41],[[[99,[-1,[107,[-1]],2]]],[[106,[2]]],41],0,0,[[[99,[-1,-2,-3]]],[[0,[-1,-2]]],41,[],[]],[[[99,[-1,-2,-3]]],[[0,[-1,-2]]],41,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[[99,[-1,102,2]]],[[117,[116]]],41],[-1,[[22,[[96,[-2,-3]],[118,[-2]]]]],[],[],97],[-1,[[22,[[96,[-2,-3]],[118,[-2]]]]],[],[],97],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[[-1,[119,[-2]]],[[77,[[37,[76]]]]],[],[]],[[-1,[119,[-2]]],[[77,[[37,[76]]]]],[],[]],[[-1,[119,[-2]]],[[77,[[37,[76]]]]],[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],0,0,0,0,0,0,[[[120,[-1]]],[[77,[[37,[76]]]]],41],[101,[[22,[[120,[-1]],103]]],41],0,0,[[[120,[-1]]],[[117,[116]]],41],0,0,0,0,[[-1,[78,[-2]]],[[77,[[37,[76]]]]],[],[]],[[-1,-2],[[77,[[37,[76]]]]],[],[[79,[20]],35]],[[-1,[80,[-2]]],[[77,[[37,[76]]]]],[],[]],[[-1,[84,[-2]]],[[77,[[37,[76]]]]],[],[]],[[-1,-2],[[77,[[37,[76]]]]],[],[[79,[20]],35]],0,0,[-1,4,[]],[-1,4,[]],[[[107,[-1]]],[[77,[[37,[76]]]]],41],[-1,-2,[],[]],[-1,-2,[],[]],[[[107,[-1]]],[[77,[[37,[76]]]]],41],[[[107,[-1]],[93,[-1]]],[[77,[[37,[76]]]]],41],[104,[[22,[[107,[-1]],121]]],41],[108,[[22,[[107,[-1]],121]]],41],[20,-1,[]],[20,-1,[]],[20,2],[[[107,[-1]],24],25,41],[-1,-1,[]],[[[107,[-1]],[78,[-1]]],[[77,[[37,[76]]]]],41],[[[107,[-1]],-2],[[77,[[37,[76]]]]],41,[[79,[20]],35]],[[[107,[-1]],[80,[-1]]],[[77,[[37,[76]]]]],41],[[[107,[-1]],[84,[-1]]],[[77,[[37,[76]]]]],41],[[[107,[-1]],-2],[[77,[[37,[76]]]]],41,[[79,[20]],35]],[[[107,[-1]],[93,[-1]],[9,[20]]],[[77,[[37,[76]]]]],41],[[],20],[[[107,[-1]],[62,[-1]]],[[77,[[37,[76]]]]],41],[[[107,[-1]],[51,[-1]]],[[77,[[37,[76]]]]],41],[[[107,[-1]],[51,[-1]]],[[77,[[37,[76]]]]],41],[-1,-2,[],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[39,[-1]]],[[39,[4]]],[]],[104,[[22,[[107,[-1]],121]]],41],[108,[[22,[[107,[-1]],121]]],41],[[[107,[-1]]],[[77,[[37,[76]]]]],41],[[[107,[-1]]],[[22,[2,121]]],41],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,49,[]],[-1,-2,[],[]],0,0,0,0,0,0,[[-1,1],2,[]],[[-1,3],2,[]],[[-1,1],2,[]],[[-1,3],2,[]],[122,[[9,[123]]]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[103,5],[103,5],[102,[[77,[[37,[76]]]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[103,124],[122,58],[-1,[[77,[[37,[76]]]]],[]],[116,[[77,[[37,[76]]]]]],[102,[[77,[[37,[76]]]]]],[122,122],[101,101],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[122,122],64],[102,[[77,[[37,[76]]]]]],[[-1,-2],64,[],[]],[101,[[22,[[120,[-1]],103]]],41],[101,[[22,[102,103]]]],[[103,-1],103,[34,35,36]],[[102,[93,[-1]]],[[77,[[37,[76]]]]],41],[[101,21],101],[[],101],[[],[[125,[122]]]],[20,-1,[]],[103],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[103],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[103,[[22,[-1,103]]],[34,26,35,36]],[103,[[9,[-1]]],[34,26,35,36]],[103,[[9,[-1]]],[34,26,35,36]],[20,2],[103,2],[20,2],[20,2],[20,2],[20,2],[102,2],[[122,122],73],[[-1,-2],73,[],[]],[[-1,-2],73,[],[]],[[-1,-2],73,[],[]],[[-1,-2],73,[],[]],[[116,-1,-2],[[117,[2]]],[82,126],127],[[116,-1],[[117,[2]]],127],[[103,24],[[22,[2,128]]]],[[103,24],[[22,[2,128]]]],[[122,24],[[22,[2,128]]]],[[122,24],[[22,[2,128]]]],[[101,24],25],[[102,24],25],[-1,-1,[]],[129,-1,[]],[-1,103,[5,35,36]],[-1,-1,[]],[-1,-1,[]],[130,101],[-1,-1,[]],[-1,-1,[]],[21,[[22,[101]]]],[[102,[78,[-1]]],[[77,[[37,[76]]]]],41],[[102,-1],[[77,[[37,[76]]]]],[[79,[20]],35]],[[102,[80,[-1]]],[[77,[[37,[76]]]]],41],[[102,[84,[-1]]],[[77,[[37,[76]]]]],41],[[102,-1],[[77,[[37,[76]]]]],[[79,[20]],35]],[[102,[93,[-1]],[9,[20]]],[[77,[[37,[76]]]]],41],[[-1,-2],[[33,[-2,-3]]],[],[34,35,36],[]],[[-1,-2],[[33,[-2,-3]]],[],[34,35,36],[]],[[101,-1],101,[[15,[14]]]],0,0,[[],20],[[],20],[[],20],[[],20],[[],20],[[102,[62,[-1]]],[[77,[[37,[76]]]]],41],[[102,[51,[-1]]],[[77,[[37,[76]]]]],41],[[102,[51,[-1]]],[[77,[[37,[76]]]]],41],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[39,[-1]]],[[39,[4]]],[]],[[[39,[-1]]],[[39,[4]]],[]],[[[39,[-1]]],[[39,[4]]],[]],[[[39,[-1]]],[[39,[4]]],[]],[[[39,[-1]]],[[39,[4]]],[]],[103,73],[[101,-1],101,127],[-1,103,[34,26,35,36]],[122,21],[-1,103,[5,35,36]],[101,101],[[122,122],[[9,[64]]]],[[101,21],101],[[101,131],101],0,[122,132],[[-1,-2,-3],[[77,[[37,[76]]]]],36,[82,126,36],[127,35]],[[-1,-2,-3],[[77,[[37,[76]]]]],36,[82,126,36],[127,35]],[[-1,-2],[[77,[[37,[76]]]]],36,[82,126,36]],[[-1,-2,-3],[[77,[[37,[76]]]]],36,[82,126,36],[127,35]],[[-1,-2],[[77,[[37,[76]]]]],36,[82,126,36]],[[-1,-2],[[77,[[37,[76]]]]],36,[82,126,36]],[101,101],[102,[[77,[[37,[76]]]]]],[103,5],[[101,-1],101,[[15,[14]]]],[122,[[9,[21]]]],[101,101],[-1,-2,[],[]],[-1,-2,[],[]],[-1,14,[]],[-1,14,[]],[102,[[117,[116]]]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[[21,21],[[22,[122,133]]]],[[101,21],101],[122,134],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],0,0,0,0,0,0,0,0,0,[[-1,3],2,[]],[[-1,1],2,[]],[[-1,1],2,[]],[[-1,3],2,[]],[[-1,1],2,[]],[[-1,3],2,[]],[[-1,1],2,[]],[[-1,3],2,[]],[[-1,1],2,[]],[[-1,3],2,[]],[[135,20],2],[[136,137],2],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,5,[]],[138,[[9,[8]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[138,[[9,[5]]]],[114,114],[135,135],[139,139],[136,136],[140,140],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[114,14,[9,[14]]],[[37,[141]]]],[[114,14,[9,[14]]],[[37,[142]]]],[[114,14,[9,[14]]],[[37,[143]]]],[[114,14],[[37,[144]]]],[[],114],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[138,21],[20,2],[20,2],[20,2],[20,2],[20,2],[20,2],[114,[[22,[14]]]],[[138,24],25],[[138,24],25],[[114,24],25],[[135,24],25],[[139,24],25],[[136,24],25],[[140,24],25],[145,138],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[135,20],[139,20],[140,14],[[114,21],[[22,[135,138]]]],[[114,21],[[22,[139,138]]]],[[114,21],[[22,[136,138]]]],[[114,21],[[22,[140,138]]]],[[114,-1],[[22,[114,138]]],127],[[-1,-2],[[33,[-2,-3]]],[],[34,35,36],[]],[-1,[],[]],[[],20],[[],20],[[],20],[[],20],[[],20],[[],20],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[39,[-1]]],[[39,[4]]],[]],[[[39,[-1]]],[[39,[4]]],[]],[[[39,[-1]]],[[39,[4]]],[]],[[[39,[-1]]],[[39,[4]]],[]],[[[39,[-1]]],[[39,[4]]],[]],[[[39,[-1]]],[[39,[4]]],[]],[136,137],[136,20],[[139,20],2],[[140,14],2],[138,[[9,[5]]]],[[114,14],[[37,[115]]]],[136,137],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,14,[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[[139,146],2],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,[[-1,1],2,[]],[[-1,3],2,[]],[[-1,1],2,[]],[[-1,3],2,[]],[[-1,1],2,[]],[[-1,3],2,[]],[[-1,1],2,[]],[[-1,3],2,[]],[[-1,1],2,[]],[[-1,3],2,[]],[[-1,1],2,[]],[[-1,3],2,[]],0,[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,5,[]],[6,6],[6,6],[29,[[9,[8]]]],[-1,[[77,[[37,[76]]]]],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[147,29],[[[148,[-1,-2]]],29,[[15,[14]]],[[15,[16]]]],[29,[[9,[5]]]],[149,149],[150,150],[[[151,[-1]]],[[151,[-1]]],17],[147,147],[[[148,[-1,-2]]],[[148,[-1,-2]]],17,17],[29,29],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[-1,[93,[-2]]],[[77,[[37,[76]]]]],[],[]],[[],152],[152,[[22,[[69,[-1,29]],70]]],[35,36,71]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[29,21],[-1,[[22,[29]]],23],[20,2],[20,2],[20,2],[20,2],[20,2],[20,2],[20,2],0,[147,[[22,[-1,29]]],[]],[[[148,[-1,-2]]],[[22,[-3,29]]],[[15,[14]]],[[15,[16]]],[]],[[149,24],25],[[150,24],25],[[[151,[-1]],24],25,26],[[147,24],25],[[[148,[-1,-2]],24],25,26,26],[[29,24],25],[[29,24],25],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[75,29],[[[2,[14,16]]],29],[30,[[22,[152,31]]]],[30,[[22,[152,31]]]],[[-1,[93,[-2]],[9,[20]]],[[77,[[37,[76]]]]],[],[]],[[],[[9,[32]]]],[[-1,-2],[[33,[-2,-3]]],[],[34,35,36],[]],[-1,[],[]],[[],20],[[],20],[[],20],[[],20],[[],20],[[],20],[[],20],[[-1,[51,[-2]]],[[77,[[37,[76]]]]],[],[]],[-1,29,34],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[39,[-1]]],[[39,[4]]],[]],[[[39,[-1]]],[[39,[4]]],[]],[[[39,[-1]]],[[39,[4]]],[]],[[[39,[-1]]],[[39,[4]]],[]],[[[39,[-1]]],[[39,[4]]],[]],[[[39,[-1]]],[[39,[4]]],[]],[[[39,[-1]]],[[39,[4]]],[]],[149,29],[150,29],[[[151,[-1]]],29,[[15,[153]]]],[147,29],[[[148,[-1,-2]]],29,[[15,[14]]],[[15,[16]]]],0,0,[[29,-1],22,48],[29,[[9,[5]]]],[29,16],0,[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,14,[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[[152,30],[[22,[2,31]]]],[[152,30],[[22,[2,31]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],0,0,0,0,0,0,0,0,0,0,0,0,0,[[-1,1],2,[]],[[-1,3],2,[]],[[-1,1],2,[]],[[-1,3],2,[]],0,[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,4,[]],[-1,5,[]],[6,6],[6,6],[28,[[9,[8]]]],[-1,[[77,[[37,[76]]]]],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[28,[[9,[5]]]],[154,154],[28,28],[[-1,-2],2,[],[]],[[-1,-2],2,[],[]],[[154,154],64],[[-1,-2],64,[],[]],[-1,[[117,[114]]],[]],[-1,[[117,[114]]],[]],[[],154],[[],155],[155,[[22,[[69,[-1,28]],70]]],[35,36,71]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[20,-1,[]],[28,21],[-1,[[22,[154]]],23],[-1,[[22,[28]]],23],[20,2],[20,2],[20,2],[[154,154],73],[[-1,-2],73,[],[]],[[-1,-2],73,[],[]],[[-1,-2],73,[],[]],[[-1,-2],73,[],[]],0,[[154,24],25],[[28,24],25],[[28,24],25],[-1,-1,[]],[-1,-1,[]],[-1,-1,[]],[14,28],[75,28],[30,[[22,[155,31]]]],[30,[[22,[155,31]]]],[[-1,-2],58,[81,82],83],[[],[[9,[32]]]],[[154,-1],2,85],[[-1,-2],[[33,[-2,-3]]],[],[34,35,36],[]],[-1,[],[]],[[],20],[[],20],[[],20],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[37,[-1]]],[[37,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[38,[-1]]],[[38,[4]]],[]],[[[39,[-1]]],[[39,[4]]],[]],[[[39,[-1]]],[[39,[4]]],[]],[[[39,[-1]]],[[39,[4]]],[]],0,[-1,[[77,[[37,[76]]]]],36],[-1,[[77,[[37,[76]]]]],36],[-1,114,[]],[[154,154],[[9,[64]]]],[-1,[[37,[115]]],[]],[[154,-1],22,48],[[28,-1],22,48],[28,[[9,[5]]]],[28,16],[-1,[[77,[[37,[76]]]]],36],[-1,[[77,[[37,[76]]]]],36],[-1,-2,[],[]],[-1,-2,[],[]],[-1,14,[]],0,[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,[[22,[-2]]],[],[]],[-1,49,[]],[-1,49,[]],[-1,49,[]],[[155,30],[[22,[2,31]]]],[[155,30],[[22,[2,31]]]],[-1,-2,[],[]],[-1,-2,[],[]],[-1,-2,[],[]],0,0],"c":[],"p":[[3,"Private",1655],[15,"tuple"],[3,"Private",1655],[8,"Any",1656],[8,"Error",1657],[3,"Command",1658],[4,"Error",0],[3,"Backtrace",1659],[4,"Option",1660],[4,"QueryError",0],[3,"NotFoundSnafu",0],[3,"MissingSnafu",0],[3,"Snafu",0],[3,"String",1661],[8,"Into",1662],[4,"StatusCode",1663],[8,"Clone",1664],[3,"Commitment",1665],[3,"Options",0],[15,"usize"],[15,"str"],[4,"Result",1666],[8,"Deserializer",1667],[3,"Formatter",1668],[6,"Result",1668],[8,"Debug",1668],[4,"Error",222],[4,"Error",1534],[4,"Error",1315],[3,"ArgMatches",1669],[6,"Error",1670],[3,"Id",1671],[3,"IndentedSection",1672],[8,"Display",1668],[8,"Send",1673],[8,"Sync",1673],[3,"Box",1674],[3,"Arc",1675],[3,"Rc",1676],[3,"SystemContextHandle",1677],[8,"NodeType",1678],[8,"AvailabilityDataSource",222],[8,"NodeDataSource",1315],[8,"StatusDataSource",1534],[8,"UpdateDataSource",745],[8,"VersionedDataSource",745],[8,"NodeImplementation",1678],[8,"Serializer",1679],[3,"TypeId",1656],[3,"InconsistentLeafError",222],[3,"LeafQueryData",222],[6,"BlockHash",222],[3,"TransactionQueryData",222],[3,"FetchLeafSnafu",222],[3,"FetchBlockSnafu",222],[3,"FetchTransactionSnafu",222],[3,"InvalidTransactionIndexSnafu",222],[15,"u64"],[3,"CustomSnafu",222],[4,"ResourceId",222],[8,"Committable",1665],[3,"BlockQueryData",222],[3,"RequestSnafu",222],[4,"Ordering",1680],[4,"Fetch",222],[8,"ErrorCompat",1681],[8,"IntoError",1681],[3,"Options",222],[3,"Api",1682],[4,"ApiError",1682],[8,"ReadState",1683],[8,"Iterator",1684],[15,"bool"],[8,"PartialEq",1680],[4,"RequestError",1685],[8,"Future",1686],[3,"Pin",1687],[6,"BlockId",222],[8,"RangeBounds",1688],[6,"TransactionHash",222],[8,"Hash",1689],[8,"Sized",1673],[8,"BuildHasher",1689],[6,"LeafId",222],[8,"Hasher",1689],[6,"LeafHash",222],[6,"Header",0],[3,"Leaf",1690],[8,"FnOnce",1691],[6,"Metadata",0],[6,"QuorumCertificate",1692],[6,"Payload",0],[6,"SignatureKey",0],[6,"TransactionIndex",222],[6,"Transaction",0],[3,"BitSlice",1693],[8,"BitOrder",1694],[3,"ExtensibleDataSource",745],[3,"FetchingDataSource",745],[3,"MetricsDataSource",745],[3,"Config",949],[3,"SqlStorage",949],[3,"Error",949],[3,"Path",1695],[6,"FileSystemDataSource",745],[6,"Result",1696],[3,"FileSystemStorage",912],[3,"AtomicStoreLoader",1697],[15,"char"],[8,"FromIterator",1698],[8,"AvailabilityStorage",902],[8,"UpdateAvailabilityData",222],[8,"UpdateNodeData",1315],[3,"PrometheusMetrics",1136],[8,"Metrics",1699],[3,"Transaction",949],[6,"QueryResult",0],[4,"BitSpanError",1700],[3,"Event",1701],[6,"SqlDataSource",891],[4,"PersistenceError",1702],[3,"Migration",949],[3,"OffsetDateTime",1703],[3,"Chain",1696],[3,"Vec",1704],[8,"ToStatement",1705],[8,"IntoIterator",1698],[3,"Error",1668],[15,"never"],[3,"Config",1706],[15,"u16"],[4,"Type",1707],[3,"Error",1708],[15,"u32"],[3,"Counter",1136],[3,"Histogram",1136],[15,"f64"],[4,"MetricsError",1136],[3,"Gauge",1136],[3,"Label",1136],[8,"Counter",1699],[8,"Gauge",1699],[8,"Histogram",1699],[8,"Label",1699],[4,"Error",1709],[15,"i64"],[3,"InvalidSignatureKeySnafu",1315],[3,"CustomSnafu",1315],[3,"RequestSnafu",1315],[3,"QuerySnafu",1315],[3,"QueryProposalsSnafu",1315],[3,"Options",1315],[3,"EncodedPublicKey",1710],[3,"MempoolQueryData",1534],[3,"Options",1534],[8,"Resolvable",0],[13,"Custom",216],[13,"Availability",216],[13,"Node",216],[13,"Status",216],[13,"Error",221],[8,"QueryablePayload",222],[13,"InvalidTransactionIndex",737],[13,"Custom",737],[13,"FetchLeaf",737],[13,"FetchBlock",737],[13,"FetchTransaction",737],[13,"Request",737],[8,"Query",949],[13,"NoSuchMetric",1311],[13,"NoSuchSubgroup",1311],[13,"Prometheus",1311],[13,"Custom",1528],[13,"QueryProposals",1528],[13,"Request",1528],[13,"Query",1528],[8,"UpdateStatusData",1534],[13,"Internal",1653],[13,"Request",1653]],"b":[[108,"impl-Display-for-Error"],[109,"impl-Debug-for-Error"],[113,"impl-Display-for-QueryError"],[114,"impl-Debug-for-QueryError"],[115,"impl-From%3CError%3E-for-Error"],[117,"impl-From%3CError%3E-for-Error"],[118,"impl-From%3C(String,+StatusCode)%3E-for-Error"],[119,"impl-From%3CError%3E-for-Error"],[471,"impl-Debug-for-ResourceId%3CT%3E"],[472,"impl-Display-for-ResourceId%3CT%3E"],[474,"impl-Display-for-InconsistentLeafError%3CTypes%3E"],[475,"impl-Debug-for-InconsistentLeafError%3CTypes%3E"],[484,"impl-Debug-for-Error"],[485,"impl-Display-for-Error"],[487,"impl-From%3Cusize%3E-for-ResourceId%3CT%3E"],[488,"impl-From%3CCommitment%3CT%3E%3E-for-ResourceId%3CT%3E"],[501,"impl-From%3C(String,+StatusCode)%3E-for-Error"],[503,"impl-From%3CRequestError%3E-for-Error"],[769,"impl-NodeDataSource%3CTypes%3E-for-ExtensibleDataSource%3CD,+U%3E"],[770,"impl-StatusDataSource-for-ExtensibleDataSource%3CD,+U%3E"],[771,"impl-NodeDataSource%3CTypes%3E-for-FetchingDataSource%3CTypes,+S,+P%3E"],[772,"impl-StatusDataSource-for-FetchingDataSource%3CTypes,+S,+P%3E"],[833,"impl-UpdateNodeData%3CTypes%3E-for-ExtensibleDataSource%3CD,+U%3E"],[834,"impl-UpdateAvailabilityData%3CTypes%3E-for-ExtensibleDataSource%3CD,+U%3E"],[835,"impl-UpdateAvailabilityData%3CTypes%3E-for-FetchingDataSource%3CTypes,+S,+P%3E"],[836,"impl-UpdateNodeData%3CTypes%3E-for-FetchingDataSource%3CTypes,+S,+P%3E"],[935,"impl-UpdateNodeData%3CTypes%3E-for-FileSystemStorage%3CTypes%3E"],[936,"impl-UpdateAvailabilityData%3CTypes%3E-for-FileSystemStorage%3CTypes%3E"],[970,"impl-AsRef%3Cdyn+Error%3E-for-Error"],[971,"impl-AsRef%3Cdyn+Error+%2B+Send+%2B+Sync%3E-for-Error"],[1031,"impl-Debug-for-Error"],[1032,"impl-Display-for-Error"],[1033,"impl-Display-for-Migration"],[1034,"impl-Debug-for-Migration"],[1063,"impl-UpdateAvailabilityData%3CTypes%3E-for-SqlStorage"],[1064,"impl-UpdateNodeData%3CTypes%3E-for-SqlStorage"],[1219,"impl-Debug-for-MetricsError"],[1220,"impl-Display-for-MetricsError"],[1426,"impl-Debug-for-Error"],[1427,"impl-Display-for-Error"],[1435,"impl-From%3CRequestError%3E-for-Error"],[1436,"impl-From%3C(String,+StatusCode)%3E-for-Error"],[1594,"impl-Debug-for-Error"],[1595,"impl-Display-for-Error"],[1599,"impl-From%3CString%3E-for-Error"],[1600,"impl-From%3CRequestError%3E-for-Error"]]}\ }'); if (typeof window !== 'undefined' && window.initSearch) {window.initSearch(searchIndex)}; if (typeof exports !== 'undefined') {exports.searchIndex = searchIndex}; diff --git a/src-files.js b/src-files.js index bf94759b4..e9cd4399d 100644 --- a/src-files.js +++ b/src-files.js @@ -1,4 +1,4 @@ var srcIndex = JSON.parse('{\ -"hotshot_query_service":["",[["availability",[],["data_source.rs","query_data.rs"]],["data_source",[],["buffered_channel.rs","extension.rs","fs.rs","ledger_log.rs","metrics.rs","sql.rs","update.rs"]],["status",[],["data_source.rs","query_data.rs"]]],["api.rs","availability.rs","data_source.rs","error.rs","lib.rs","metrics.rs","resolvable.rs","status.rs"]]\ +"hotshot_query_service":["",[["availability",[],["data_source.rs","fetch.rs","query_data.rs"]],["data_source",[["storage",[],["fs.rs","ledger_log.rs","sql.rs"]]],["extension.rs","fetching.rs","fs.rs","metrics.rs","notifier.rs","sql.rs","storage.rs","update.rs"]],["node",[],["data_source.rs","query_data.rs"]],["status",[],["data_source.rs","query_data.rs"]]],["api.rs","availability.rs","data_source.rs","error.rs","lib.rs","metrics.rs","node.rs","resolvable.rs","status.rs"]]\ }'); createSrcSidebar(); diff --git a/src/hotshot_query_service/availability.rs.html b/src/hotshot_query_service/availability.rs.html index a867cb60c..edefc4e18 100644 --- a/src/hotshot_query_service/availability.rs.html +++ b/src/hotshot_query_service/availability.rs.html @@ -529,157 +529,6 @@ 529 530 531 -532 -533 -534 -535 -536 -537 -538 -539 -540 -541 -542 -543 -544 -545 -546 -547 -548 -549 -550 -551 -552 -553 -554 -555 -556 -557 -558 -559 -560 -561 -562 -563 -564 -565 -566 -567 -568 -569 -570 -571 -572 -573 -574 -575 -576 -577 -578 -579 -580 -581 -582 -583 -584 -585 -586 -587 -588 -589 -590 -591 -592 -593 -594 -595 -596 -597 -598 -599 -600 -601 -602 -603 -604 -605 -606 -607 -608 -609 -610 -611 -612 -613 -614 -615 -616 -617 -618 -619 -620 -621 -622 -623 -624 -625 -626 -627 -628 -629 -630 -631 -632 -633 -634 -635 -636 -637 -638 -639 -640 -641 -642 -643 -644 -645 -646 -647 -648 -649 -650 -651 -652 -653 -654 -655 -656 -657 -658 -659 -660 -661 -662 -663 -664 -665 -666 -667 -668 -669 -670 -671 -672 -673 -674 -675 -676 -677 -678 -679 -680 -681 -682
    // Copyright (c) 2022 Espresso Systems (espressosys.com)
     // This file is part of the HotShot Query Service library.
     //
    @@ -692,21 +541,38 @@
     // You should have received a copy of the GNU General Public License along with this program. If not,
     // see <https://www.gnu.org/licenses/>.
     
    -use crate::{api::load_api, Payload, QueryError, QueryResult, SignatureKey};
    +//! Queries for HotShot chain state.
    +//!
    +//! The availability API provides an objective view of the HotShot blockchain. It provides access
    +//! only to normative data: that is, data which is agreed upon by all honest consensus nodes and
    +//! which is immutable. This means access to core consensus data structures including leaves,
    +//! blocks, and headers, where each query is pure and idempotent. This also means that it is
    +//! possible for a client to verify all of the information provided by this API, by running a
    +//! HotShot light client and downloading the appropriate evidence with each query.
    +//!
    +//! This API does not provide any queries which represent only the _current_ state of the chain or
    +//! may change over time, and it does not provide information for which there is not (yet) agreement
    +//! of a supermajority of consensus nodes. For information about the current dynamic state of
    +//! consensus and uncommitted state, try the [status](crate::status) API. For information about the
    +//! chain which is tabulated by this specific node and not subject to full consensus agreement, try
    +//! the [node](crate::node) API.
    +
    +use crate::{api::load_api, Payload};
     use clap::Args;
     use derive_more::From;
    -use futures::{FutureExt, Stream, StreamExt, TryFutureExt, TryStreamExt};
    -use hotshot::types::SignatureKey as _;
    -use hotshot_types::traits::{node_implementation::NodeType, signature_key::EncodedPublicKey};
    +use futures::{FutureExt, StreamExt, TryFutureExt};
    +use hotshot_types::traits::node_implementation::NodeType;
     use serde::{Deserialize, Serialize};
    -use snafu::{OptionExt, ResultExt, Snafu};
    +use snafu::{OptionExt, Snafu};
     use std::fmt::Display;
     use std::path::PathBuf;
    -use tide_disco::{api::ApiError, method::ReadState, Api, RequestError, RequestParams, StatusCode};
    +use tide_disco::{api::ApiError, method::ReadState, Api, RequestError, StatusCode};
     
     pub(crate) mod data_source;
    +mod fetch;
     pub(crate) mod query_data;
     pub use data_source::*;
    +pub use fetch::Fetch;
     pub use query_data::*;
     
     #[derive(Args, Default)]
    @@ -732,61 +598,27 @@
         Request {
             source: RequestError,
         },
    -    #[snafu(display("error fetching leaf {resource}: {source}"))]
    +    #[snafu(display("leaf {resource} missing or not available"))]
         #[from(ignore)]
    -    QueryLeaf {
    -        source: QueryError,
    +    FetchLeaf {
             resource: String,
         },
    -    #[snafu(display("error streaming leaves: {source}"))]
    -    #[from(ignore)]
    -    StreamLeaf {
    -        source: QueryError,
    -    },
    -    #[snafu(display("error fetching block {resource}: {source}"))]
    +    #[snafu(display("block {resource} missing or not available"))]
         #[from(ignore)]
    -    QueryBlock {
    -        source: QueryError,
    +    FetchBlock {
             resource: String,
         },
    -    #[snafu(display("error streaming blocks: {source}"))]
    -    #[from(ignore)]
    -    StreamBlock {
    -        source: QueryError,
    -    },
    -    #[snafu(display("error fetching transaction {resource}: {source}"))]
    +    #[snafu(display("transaction {resource} missing or not available"))]
         #[from(ignore)]
    -    QueryTransaction {
    -        source: QueryError,
    +    FetchTransaction {
             resource: String,
         },
    -    #[snafu(display("error fetching proposals by {proposer}: {source}"))]
    -    #[from(ignore)]
    -    QueryProposals {
    -        source: QueryError,
    -        proposer: EncodedPublicKey,
    -    },
         #[snafu(display("transaction index {index} out of range for block {height}"))]
         #[from(ignore)]
         InvalidTransactionIndex {
             height: u64,
             index: u64,
         },
    -    #[snafu(display("unable to open leaf stream at {}: {}", height, reason))]
    -    #[from(ignore)]
    -    LeafStream {
    -        height: usize,
    -        reason: String,
    -    },
    -    #[snafu(display("unable to open block stream at {}: {}", height, reason))]
    -    #[from(ignore)]
    -    BlockStream {
    -        height: usize,
    -        reason: String,
    -    },
    -    #[snafu(display("malformed signature key"))]
    -    #[from(ignore)]
    -    InvalidSignatureKey,
         Custom {
             message: String,
             status: StatusCode,
    @@ -803,15 +635,11 @@
     
         pub fn status(&self) -> StatusCode {
             match self {
    -            Self::Request { .. } | Self::InvalidSignatureKey => StatusCode::BadRequest,
    -            Self::QueryLeaf { source, .. }
    -            | Self::StreamLeaf { source, .. }
    -            | Self::QueryBlock { source, .. }
    -            | Self::StreamBlock { source, .. }
    -            | Self::QueryTransaction { source, .. }
    -            | Self::QueryProposals { source, .. } => source.status(),
    +            Self::Request { .. } => StatusCode::BadRequest,
    +            Self::FetchLeaf { .. } | Self::FetchBlock { .. } | Self::FetchTransaction { .. } => {
    +                StatusCode::NotFound
    +            }
                 Self::InvalidTransactionIndex { .. } => StatusCode::NotFound,
    -            Self::LeafStream { .. } | Self::BlockStream { .. } => StatusCode::InternalServerError,
                 Self::Custom { status, .. } => *status,
             }
         }
    @@ -829,41 +657,31 @@
             options.extensions.clone(),
         )?;
         api.with_version("0.0.1".parse().unwrap())
    -        .get("getleaf", |req, state| {
    +        .get("get_leaf", |req, state| {
                 async move {
                     let id = match req.opt_integer_param("height")? {
                         Some(height) => ResourceId::Number(height),
                         None => ResourceId::Hash(req.blob_param("hash")?),
                     };
    -                state.get_leaf(id).await.context(QueryLeafSnafu {
    +                state.get_leaf(id).await.context(FetchLeafSnafu {
                         resource: id.to_string(),
                     })
                 }
                 .boxed()
             })?
    -        .stream("streamleaves", |req, state| {
    +        .stream("stream_leaves", |req, state| {
                 async move {
                     let height = req.integer_param("height")?;
                     state
                         .read(|state| {
    -                        async move {
    -                            handle_stream_errors(
    -                                height,
    -                                state.subscribe_leaves(height).await,
    -                                |height, err| Error::LeafStream {
    -                                    height,
    -                                    reason: err.to_string(),
    -                                },
    -                            )
    -                        }
    -                        .boxed()
    +                        async move { Ok(state.subscribe_leaves(height).await.map(Ok)) }.boxed()
                         })
                         .await
                 }
                 .try_flatten_stream()
                 .boxed()
             })?
    -        .get("getheader", |req, state| {
    +        .get("get_header", |req, state| {
                 async move {
                     let id = match req.opt_integer_param("height")? {
                         Some(height) => ResourceId::Number(height),
    @@ -872,7 +690,7 @@
                     Ok(state
                         .get_block(id)
                         .await
    -                    .context(QueryBlockSnafu {
    +                    .context(FetchBlockSnafu {
                             resource: id.to_string(),
                         })?
                         .header()
    @@ -880,77 +698,60 @@
                 }
                 .boxed()
             })?
    -        .stream("streamheaders", |req, state| {
    +        .stream("stream_headers", |req, state| {
                 async move {
                     let height = req.integer_param("height")?;
    -                state
    +                Ok(state
                         .read(|state| {
                             async move {
    -                            handle_stream_errors(
    -                                height,
    -                                state
    -                                    .subscribe_blocks(height)
    -                                    .await
    -                                    .map(|blocks| blocks.map_ok(|block| block.header().clone())),
    -                                |height, err| Error::BlockStream {
    -                                    height,
    -                                    reason: err.to_string(),
    -                                },
    -                            )
    +                            state
    +                                .subscribe_blocks(height)
    +                                .await
    +                                .map(|block| Ok(block.header))
                             }
                             .boxed()
                         })
    -                    .await
    -            }
    +                    .await)
    +            }
                 .try_flatten_stream()
                 .boxed()
             })?
    -        .get("getblock", |req, state| {
    +        .get("get_block", |req, state| {
                 async move {
                     let id = match req.opt_integer_param("height")? {
                         Some(height) => ResourceId::Number(height),
                         None => ResourceId::Hash(req.blob_param("hash")?),
                     };
    -                state.get_block(id).await.context(QueryBlockSnafu {
    +                state.get_block(id).await.context(FetchBlockSnafu {
                         resource: id.to_string(),
                     })
                 }
                 .boxed()
             })?
    -        .stream("streamblocks", |req, state| {
    +        .stream("stream_blocks", |req, state| {
                 async move {
                     let height = req.integer_param("height")?;
    -                state
    +                Ok(state
                         .read(|state| {
    -                        async move {
    -                            handle_stream_errors(
    -                                height,
    -                                state.subscribe_blocks(height).await,
    -                                |height, err| Error::BlockStream {
    -                                    height,
    -                                    reason: err.to_string(),
    -                                },
    -                            )
    -                        }
    -                        .boxed()
    +                        async move { state.subscribe_blocks(height).await.map(Ok) }.boxed()
                         })
    -                    .await
    -            }
    +                    .await)
    +            }
                 .try_flatten_stream()
                 .boxed()
             })?
    -        .get("gettransaction", |req, state| {
    +        .get("get_transaction", |req, state| {
                 async move {
                     let (block, index) = match req.opt_blob_param("hash")? {
                         Some(hash) => state.get_block_with_transaction(hash).await.context(
    -                        QueryTransactionSnafu {
    +                        FetchTransactionSnafu {
                                 resource: hash.to_string(),
                             },
                         )?,
                         None => {
                             let height = req.integer_param("height")?;
                             let id = ResourceId::Number(height);
    -                        let block = state.get_block(id).await.context(QueryBlockSnafu {
    +                        let block = state.get_block(id).await.context(FetchBlockSnafu {
                                 resource: id.to_string(),
                             })?;
                             let i = req.integer_param("index")?;
    @@ -969,63 +770,10 @@
                         .unwrap())
                 }
                 .boxed()
    -        })?
    -        .get("countproposals", |req, state| {
    -            async move {
    -                let proposer = proposer_param::<Types>(&req, "proposer_id")?;
    -                state
    -                    .count_proposals(&proposer)
    -                    .await
    -                    .context(QueryProposalsSnafu {
    -                        proposer: proposer.to_bytes(),
    -                    })
    -            }
    -            .boxed()
    -        })?
    -        .get("getproposals", |req, state| {
    -            async move {
    -                let proposer = proposer_param::<Types>(&req, "proposer_id")?;
    -                let limit = req.opt_integer_param("count")?;
    -                state
    -                    .get_proposals(&proposer, limit)
    -                    .await
    -                    .context(QueryProposalsSnafu {
    -                        proposer: proposer.to_bytes(),
    -                    })
    -            }
    -            .boxed()
             })?;
         Ok(api)
     }
     
    -fn proposer_param<Types: NodeType>(
    -    req: &RequestParams,
    -    param: &str,
    -) -> Result<SignatureKey<Types>, Error> {
    -    // The HotShot signature key trait temporarily lacks the trait bounds required to convert
    -    // directly from TaggedBase64. As a workaround, we parse the TaggedBase64 as an
    -    // EncodedPublicKey and then decode to the actual signature key type.
    -    //
    -    // This can be simplified after https://github.com/EspressoSystems/HotShot/issues/2374.
    -    let encoded: EncodedPublicKey = req.blob_param(param)?;
    -    SignatureKey::<Types>::from_bytes(&encoded).context(InvalidSignatureKeySnafu)
    -}
    -
    -fn handle_stream_errors<T, S, F>(
    -    height: usize,
    -    stream: QueryResult<S>,
    -    map_err: F,
    -) -> Result<impl Stream<Item = Result<T, Error>>, Error>
    -where
    -    S: Stream<Item = QueryResult<T>>,
    -    F: Fn(usize, QueryError) -> Error,
    -{
    -    Ok(stream
    -        .map_err(|err| map_err(height, err))?
    -        .enumerate()
    -        .map(move |(i, res)| res.map_err(|err| map_err(height + i, err))))
    -}
    -
     #[cfg(test)]
     mod test {
         use super::*;
    @@ -1033,7 +781,7 @@
             data_source::{ExtensibleDataSource, FileSystemDataSource},
             testing::{
                 consensus::{MockDataSource, MockNetwork},
    -            mocks::{mock_transaction, MockTypes},
    +            mocks::{mock_transaction, MockHeader, MockTypes},
                 setup_test,
             },
             Error, Header,
    @@ -1041,8 +789,6 @@
         use async_std::{sync::RwLock, task::spawn};
         use commit::Committable;
         use futures::FutureExt;
    -    use hotshot::types::SignatureKey;
    -    use hotshot_signature_key::bn254::BLSPubKey;
         use portpicker::pick_unused_port;
         use std::collections::HashSet;
         use std::time::Duration;
    @@ -1073,11 +819,7 @@
                         }
                     }
                     Err(Error::Availability {
    -                    source:
    -                        super::Error::QueryBlock {
    -                            source: QueryError::NotFound,
    -                            ..
    -                        },
    +                    source: super::Error::FetchBlock { .. },
                     }) => {
                         tracing::info!(
                             "found end of ledger at height {i}, non-empty blocks are {blocks:?}",
    @@ -1134,50 +876,6 @@
                         .unwrap()
                 );
     
    -            // Check that this block is included as a proposal by the proposer listed in the leaf.
    -            let proposals: Vec<LeafQueryData<MockTypes>> = client
    -                .get(&format!("proposals/{}", leaf.proposer().to_bytes()))
    -                .send()
    -                .await
    -                .unwrap();
    -            assert!(proposals.contains(&leaf));
    -            // Check the `proposals/limit` and `proposals/count` features.
    -            assert!(
    -                client
    -                    .get::<u64>(&format!("proposals/{}/count", leaf.proposer().to_bytes()))
    -                    .send()
    -                    .await
    -                    .unwrap()
    -                    >= proposals.len() as u64
    -            );
    -            // For the limit queries, we just check the count. We don't know exactly which blocks to
    -            // expect in the response, since it returns the most recent `count` blocks which may
    -            // include new empty blocks committed since we started checking.
    -            assert_eq!(
    -                client
    -                    .get::<Vec<LeafQueryData<MockTypes>>>(&format!(
    -                        "proposals/{}/limit/1",
    -                        leaf.proposer().to_bytes()
    -                    ))
    -                    .send()
    -                    .await
    -                    .unwrap()
    -                    .len(),
    -                1
    -            );
    -            assert_eq!(
    -                client
    -                    .get::<Vec<LeafQueryData<MockTypes>>>(&format!(
    -                        "proposals/{}/limit/0",
    -                        leaf.proposer().to_bytes()
    -                    ))
    -                    .send()
    -                    .await
    -                    .unwrap()
    -                    .len(),
    -                0
    -            );
    -
                 // Check that looking up each transaction in the block various ways returns the correct
                 // transaction.
                 for (j, txn_from_block) in block.enumerate() {
    @@ -1351,13 +1049,13 @@
             assert_eq!(client.get::<u64>("ext").send().await.unwrap(), 42);
     
             // Ensure we can still access the built-in functionality.
    -        let (key, _) = BLSPubKey::generated_from_seed_indexed([0; 32], 0);
    -        assert_eq!(
    +        assert_eq!(
                 client
    -                .get::<u64>(&format!("proposals/{}/count", key.to_bytes()))
    +                .get::<MockHeader>("header/0")
                     .send()
                     .await
    -                .unwrap(),
    +                .unwrap()
    +                .block_number,
                 0
             );
         }
    diff --git a/src/hotshot_query_service/availability/data_source.rs.html b/src/hotshot_query_service/availability/data_source.rs.html
    index 460e3daef..010f1f904 100644
    --- a/src/hotshot_query_service/availability/data_source.rs.html
    +++ b/src/hotshot_query_service/availability/data_source.rs.html
    @@ -114,6 +114,32 @@
     114
     115
     116
    +117
    +118
    +119
    +120
    +121
    +122
    +123
    +124
    +125
    +126
    +127
    +128
    +129
    +130
    +131
    +132
    +133
    +134
    +135
    +136
    +137
    +138
    +139
    +140
    +141
    +142
     

    // Copyright (c) 2022 Espresso Systems (espressosys.com)
     // This file is part of the HotShot Query Service library.
     //
    @@ -126,20 +152,20 @@
     // You should have received a copy of the GNU General Public License along with this program. If not,
     // see <https://www.gnu.org/licenses/>.
     
    -use super::query_data::{
    -    BlockQueryData, LeafQueryData, QueryablePayload, TransactionHash, TransactionIndex,
    +use super::{
    +    fetch::Fetch,
    +    query_data::{
    +        BlockQueryData, LeafQueryData, QueryablePayload, TransactionHash, TransactionIndex,
    +    },
     };
    -use crate::{Header, Leaf, Payload, QueryResult, SignatureKey};
    +use crate::{Header, Leaf, Payload};
     use async_trait::async_trait;
     use commit::{Commitment, Committable};
     use derivative::Derivative;
     use derive_more::{Display, From};
    -use futures::stream::Stream;
    +use futures::stream::{BoxStream, Stream, StreamExt};
     use hotshot_types::traits::node_implementation::NodeType;
    -use std::cmp::Ordering;
    -use std::error::Error;
    -use std::fmt::Debug;
    -use std::ops::RangeBounds;
    +use std::{cmp::Ordering, error::Error, fmt::Debug, ops::RangeBounds};
     
     #[derive(Derivative, From, Display)]
     #[derivative(Ord = "feature_allow_slow_enum")]
    @@ -173,55 +199,81 @@
     pub type BlockId<Types> = ResourceId<Header<Types>>;
     pub type LeafId<Types> = ResourceId<Leaf<Types>>;
     
    -#[async_trait]
    +/// An interface for querying a HotShot blockchain.
    +///
    +/// This interface provides expressive queries over all the data which is made available by HotShot
    +/// consensus. The data exposed by this interface consists entirely of _normative_ data: data which
    +/// every correct HotShot node or light client will agree on, and which is guaranteed by consensus
    +/// to be immutable. This immutability has an interesting consequence: all of the methods exposed by
    +/// this trait are _pure_: given equivalent inputs, the same method will always return equivalent
    +/// outputs[^1].
    +///
    +/// This purity property has a further consequence: none of the methods defined here can fail! Even
    +/// if you query for a block at a position past the end of the current chain -- a block which does
    +/// not exist yet -- the query will not fail. It will return an in-progress [`Fetch`] which, when it
    +/// finally does resolve, resolves to the unique block at that position in the chain. All subsequent
    +/// queries for the same position will eventually resolve to the same block.
    +///
    +/// In other words, the abstraction is that of an infinitely long chain which exists statically, in
    +/// its entirety, at all times. In reality, of course, this chain is being produced incrementally
    +/// and has a finite length at any given time. But all this means is that some queries may take a
    +/// long time to resolve while others may resolve immediately.
    +///
    +/// [^1]: The data returned by these methods are wrapped in [`Fetch`], which does not implement
    +///       [`PartialEq]`. So to speak of equivalent outputs, we need to define an equivalence
    +///       relation on [`Fetch<T>`]. The relation we will use is defined when `T: PartialEq`, and
    +///       defines two fetches `f1` and `f2` as equivalent when `f1.await == f2.await`. That is,
    +///       depending on when you call a certain method, you may or may not get a response
    +///       immediately. But whenever you do get the data you requested, it is unique for that
    +///       combination of inputs.
    +#[async_trait]
     pub trait AvailabilityDataSource<Types: NodeType>
     where
         Payload<Types>: QueryablePayload,
     {
    -    type LeafStream: Stream<Item = QueryResult<LeafQueryData<Types>>> + Unpin + Send;
    -    type BlockStream: Stream<Item = QueryResult<BlockQueryData<Types>>> + Unpin + Send;
    -
    -    type LeafRange<'a, R>: 'a + Stream<Item = QueryResult<LeafQueryData<Types>>> + Unpin
    -    where
    -        Self: 'a,
    -        R: RangeBounds<usize> + Send;
    -    type BlockRange<'a, R>: 'a + Stream<Item = QueryResult<BlockQueryData<Types>>> + Unpin
    -    where
    -        Self: 'a,
    -        R: RangeBounds<usize> + Send;
    +    type LeafRange<R>: Stream<Item = Fetch<LeafQueryData<Types>>> + Unpin + Send + 'static
    +    where
    +        R: RangeBounds<usize> + Send;
    +    type BlockRange<R>: Stream<Item = Fetch<BlockQueryData<Types>>> + Unpin + Send + 'static
    +    where
    +        R: RangeBounds<usize> + Send;
     
    -    async fn get_leaf<ID>(&self, id: ID) -> QueryResult<LeafQueryData<Types>>
    +    async fn get_leaf<ID>(&self, id: ID) -> Fetch<LeafQueryData<Types>>
         where
             ID: Into<LeafId<Types>> + Send + Sync;
     
    -    async fn get_block<ID>(&self, id: ID) -> QueryResult<BlockQueryData<Types>>
    +    async fn get_block<ID>(&self, id: ID) -> Fetch<BlockQueryData<Types>>
         where
             ID: Into<BlockId<Types>> + Send + Sync;
     
    -    async fn get_leaf_range<R>(&self, range: R) -> QueryResult<Self::LeafRange<'_, R>>
    +    async fn get_leaf_range<R>(&self, range: R) -> Self::LeafRange<R>
         where
    -        R: RangeBounds<usize> + Send;
    +        R: RangeBounds<usize> + Send + 'static;
     
    -    async fn get_block_range<R>(&self, range: R) -> QueryResult<Self::BlockRange<'_, R>>
    +    async fn get_block_range<R>(&self, range: R) -> Self::BlockRange<R>
         where
    -        R: RangeBounds<usize> + Send;
    +        R: RangeBounds<usize> + Send + 'static;
     
         /// Returns the block containing a transaction with the given `hash` and the transaction's
         /// position in the block.
         async fn get_block_with_transaction(
             &self,
             hash: TransactionHash<Types>,
    -    ) -> QueryResult<(BlockQueryData<Types>, TransactionIndex<Types>)>;
    +    ) -> Fetch<(BlockQueryData<Types>, TransactionIndex<Types>)>;
     
    -    async fn get_proposals(
    -        &self,
    -        proposer: &SignatureKey<Types>,
    -        limit: Option<usize>,
    -    ) -> QueryResult<Vec<LeafQueryData<Types>>>;
    -    async fn count_proposals(&self, proposer: &SignatureKey<Types>) -> QueryResult<usize>;
    +    async fn subscribe_blocks(&self, from: usize) -> BoxStream<'static, BlockQueryData<Types>> {
    +        self.get_block_range(from..)
    +            .await
    +            .then(Fetch::resolve)
    +            .boxed()
    +    }
     
    -    async fn subscribe_leaves(&self, height: usize) -> QueryResult<Self::LeafStream>;
    -    async fn subscribe_blocks(&self, height: usize) -> QueryResult<Self::BlockStream>;
    +    async fn subscribe_leaves(&self, from: usize) -> BoxStream<'static, LeafQueryData<Types>> {
    +        self.get_leaf_range(from..)
    +            .await
    +            .then(Fetch::resolve)
    +            .boxed()
    +    }
     }
     
     #[async_trait]
    diff --git a/src/hotshot_query_service/availability/fetch.rs.html b/src/hotshot_query_service/availability/fetch.rs.html
    new file mode 100644
    index 000000000..6fcd289b3
    --- /dev/null
    +++ b/src/hotshot_query_service/availability/fetch.rs.html
    @@ -0,0 +1,225 @@
    +fetch.rs - source
    1
    +2
    +3
    +4
    +5
    +6
    +7
    +8
    +9
    +10
    +11
    +12
    +13
    +14
    +15
    +16
    +17
    +18
    +19
    +20
    +21
    +22
    +23
    +24
    +25
    +26
    +27
    +28
    +29
    +30
    +31
    +32
    +33
    +34
    +35
    +36
    +37
    +38
    +39
    +40
    +41
    +42
    +43
    +44
    +45
    +46
    +47
    +48
    +49
    +50
    +51
    +52
    +53
    +54
    +55
    +56
    +57
    +58
    +59
    +60
    +61
    +62
    +63
    +64
    +65
    +66
    +67
    +68
    +69
    +70
    +71
    +72
    +73
    +74
    +75
    +76
    +77
    +78
    +79
    +80
    +81
    +82
    +83
    +84
    +85
    +86
    +87
    +88
    +89
    +90
    +91
    +92
    +93
    +94
    +95
    +96
    +97
    +98
    +99
    +100
    +101
    +102
    +103
    +104
    +105
    +106
    +107
    +108
    +109
    +110
    +111
    +112
    +
    // Copyright (c) 2022 Espresso Systems (espressosys.com)
    +// This file is part of the HotShot Query Service library.
    +//
    +// This program is free software: you can redistribute it and/or modify it under the terms of the GNU
    +// General Public License as published by the Free Software Foundation, either version 3 of the
    +// License, or (at your option) any later version.
    +// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
    +// even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    +// General Public License for more details.
    +// You should have received a copy of the GNU General Public License along with this program. If not,
    +// see <https://www.gnu.org/licenses/>.
    +
    +use futures::future::{BoxFuture, FutureExt};
    +use snafu::{Error, ErrorCompat, IntoError, NoneError, OptionExt};
    +use std::future::IntoFuture;
    +
    +/// An in-progress request to fetch some data.
    +///
    +/// A [`Fetch`] represents the period of uncertainty after some data has been requested, before it
    +/// is known whether that data exists locally or must be retrieved from an external source (or
    +/// whether we must wait for the data to be created in the first place).
    +///
    +/// For data that is already available locally, a request for that data may return [`Fetch::Ready`]
    +/// with the data itself. Otherwise, the request will return [`Fetch::Pending`] with a future that
    +/// will resolve once the data is available.
    +///
    +/// Depending on the context, [`Fetch`] can behave a bit like a [`Future`](futures::Future) or a bit
    +/// like a [`Result`]. Therefore, it implements [`IntoFuture`], so it can be awaited (this is the
    +/// same as calling [`resolve`](Self::resolve)) and it implements methods [`context`](Self::context)
    +/// and [`with_context`](Self::with_context), which make it easy to convert a [`Fetch`] to a
    +/// [`Result`], mimicking the methods from Snafu traits [`OptionExt`](snafu::OptionExt) and
    +/// [`ResultExt`](snafu::ResultExt).
    +pub enum Fetch<T> {
    +    Ready(T),
    +    Pending(BoxFuture<'static, T>),
    +}
    +
    +impl<T> Fetch<T> {
    +    /// Get the requested data if it is available immediately.
    +    ///
    +    /// If the requested data is not immediately available, `Err(self)` is returned so that the
    +    /// [`Fetch`] object may be used again.
    +    pub fn try_resolve(self) -> Result<T, Self> {
    +        match self {
    +            Self::Ready(obj) => Ok(obj),
    +            Self::Pending(fut) => Err(Self::Pending(fut)),
    +        }
    +    }
    +
    +    /// Convert this [`Fetch`] to a [`Result`] with the provided error context.
    +    ///
    +    /// The result indicates whether the requested data is immediately available. If it is, [`Ok`]
    +    /// is returned. Otherwise, an error is created from `context` using Snafu.
    +    pub fn context<C, E>(self, context: C) -> Result<T, E>
    +    where
    +        C: IntoError<E, Source = NoneError>,
    +        E: Error + ErrorCompat,
    +    {
    +        self.try_resolve().ok().context(context)
    +    }
    +
    +    /// Convert this [`Fetch`] to a [`Result`] with the provided error context.
    +    ///
    +    /// The result indicates whether the requested data is immediately available. If it is, [`Ok`]
    +    /// is returned. Otherwise, an error is created from `context` using Snafu.
    +    pub fn with_context<F, C, E>(self, context: F) -> Result<T, E>
    +    where
    +        F: FnOnce() -> C,
    +        C: IntoError<E, Source = NoneError>,
    +        E: Error + ErrorCompat,
    +    {
    +        self.try_resolve().ok().with_context(context)
    +    }
    +}
    +
    +impl<T: Send + 'static> Fetch<T> {
    +    /// Wait for the data to become available, if it is not already.
    +    pub async fn resolve(self) -> T {
    +        self.await
    +    }
    +}
    +
    +impl<T: 'static> Fetch<T> {
    +    /// Transform the result of this fetch.
    +    ///
    +    /// If the requested data is already available, `f` will be applied immediately. Otherwise, `f`
    +    /// will be saved and applied after the pending future resolves.
    +    pub fn map<F, U>(self, f: F) -> Fetch<U>
    +    where
    +        F: 'static + Send + FnOnce(T) -> U,
    +    {
    +        match self {
    +            Self::Ready(obj) => Fetch::Ready(f(obj)),
    +            Self::Pending(fut) => Fetch::Pending(fut.map(f).boxed()),
    +        }
    +    }
    +}
    +
    +impl<T: Send + 'static> IntoFuture for Fetch<T> {
    +    type Output = T;
    +    type IntoFuture = BoxFuture<'static, Self::Output>;
    +
    +    fn into_future(self) -> Self::IntoFuture {
    +        async move {
    +            match self {
    +                Self::Ready(obj) => obj,
    +                Self::Pending(fut) => fut.await,
    +            }
    +        }
    +        .boxed()
    +    }
    +}
    +
    \ No newline at end of file diff --git a/src/hotshot_query_service/availability/query_data.rs.html b/src/hotshot_query_service/availability/query_data.rs.html index 394f24a32..1e97979ee 100644 --- a/src/hotshot_query_service/availability/query_data.rs.html +++ b/src/hotshot_query_service/availability/query_data.rs.html @@ -395,6 +395,13 @@ 395 396 397 +398 +399 +400 +401 +402 +403 +404
    // Copyright (c) 2022 Espresso Systems (espressosys.com)
     // This file is part of the HotShot Query Service library.
     //
    @@ -666,8 +673,8 @@
         /// expensive, and may be omitted in optimized builds. The responsibility of ensuring
         /// consistency between `leaf` and `payload` ultimately falls on the caller.
         pub fn new(
    -        leaf: Leaf<Types>,
    -        qc: QuorumCertificate<Types>,
    +        leaf: &Leaf<Types>,
    +        qc: &QuorumCertificate<Types>,
             payload: Payload<Types>,
         ) -> Result<Self, InconsistentLeafError<Types>> {
             ensure!(
    @@ -679,7 +686,7 @@
             );
             Ok(Self {
                 hash: leaf.block_header.commit(),
    -            header: leaf.block_header,
    +            header: leaf.block_header.clone(),
                 size: payload_size::<Types>(&payload),
                 payload,
             })
    @@ -737,6 +744,13 @@
             })
         }
     
    +    pub fn transaction_by_hash(
    +        &self,
    +        hash: Commitment<Transaction<Types>>,
    +    ) -> Option<TransactionIndex<Types>> {
    +        self.payload().by_hash(self.metadata(), hash)
    +    }
    +
         pub fn len(&self) -> usize {
             self.payload.len(self.metadata())
         }
    diff --git a/src/hotshot_query_service/data_source.rs.html b/src/hotshot_query_service/data_source.rs.html
    index d707308f8..680256937 100644
    --- a/src/hotshot_query_service/data_source.rs.html
    +++ b/src/hotshot_query_service/data_source.rs.html
    @@ -511,6 +511,41 @@
     511
     512
     513
    +514
    +515
    +516
    +517
    +518
    +519
    +520
    +521
    +522
    +523
    +524
    +525
    +526
    +527
    +528
    +529
    +530
    +531
    +532
    +533
    +534
    +535
    +536
    +537
    +538
    +539
    +540
    +541
    +542
    +543
    +544
    +545
    +546
    +547
    +548
     

    // Copyright (c) 2022 Espresso Systems (espressosys.com)
     // This file is part of the HotShot Query Service library.
     //
    @@ -525,12 +560,12 @@
     
     //! Persistent storage and sources of data consumed by APIs.
     //!
    -//! Naturally, an archival query service such as this is heavily dependent on a persistent storage
    -//! implementation. The APIs provided by this query service are generic over the specific type of
    -//! the persistence layer, which we call a _data source_. This module provides the following
    -//! concrete persistence implementations:
    +//! The APIs provided by this query service are generic over the implementation which actually
    +//! retrieves data in answer to queries. We call this implementation a _data source_. This module
    +//! defines a data source and provides several pre-built implementations:
     //! * [`FileSystemDataSource`]
     //! * [`SqlDataSource`]
    +//! * [`FetchingDataSource`], a generalization of the above
     //! * [`MetricsDataSource`]
     //!
     //! The user can choose which data source to use when initializing the query service.
    @@ -539,15 +574,17 @@
     //! * [`ExtensibleDataSource`]
     //!
     
    -mod buffered_channel;
    -mod extension;
    +mod extension;
    +mod fetching;
     mod fs;
    -mod ledger_log;
     mod metrics;
    +mod notifier;
     pub mod sql;
    +pub mod storage;
     mod update;
     
     pub use extension::ExtensibleDataSource;
    +pub use fetching::FetchingDataSource;
     #[cfg(feature = "file-system-data-source")]
     pub use fs::FileSystemDataSource;
     #[cfg(feature = "metrics-data-source")]
    @@ -561,36 +598,75 @@
     #[espresso_macros::generic_tests]
     pub mod availability_tests {
         use crate::{
    -        availability::{payload_size, BlockQueryData, LeafQueryData},
    +        availability::{
    +            payload_size, BlockQueryData, Fetch, LeafQueryData, UpdateAvailabilityData,
    +        },
    +        node::NodeDataSource,
             testing::{
                 consensus::MockNetwork,
                 mocks::{mock_transaction, MockPayload, MockTypes, TestableDataSource},
                 setup_test,
             },
    -        Leaf, QueryError,
    +        Leaf,
         };
         use async_std::sync::RwLock;
         use commit::Committable;
    -    use futures::{StreamExt, TryStreamExt};
    +    use futures::{
    +        future,
    +        stream::{BoxStream, StreamExt},
    +    };
         use hotshot_types::simple_certificate::QuorumCertificate;
         use std::collections::{HashMap, HashSet};
    +    use std::fmt::Debug;
         use std::ops::{Bound, RangeBounds};
     
    +    /// Apply an upper bound to a range based on the currently available block height.
    +    async fn bound_range<R, D>(ds: &D, range: R) -> impl RangeBounds<usize>
    +    where
    +        D: TestableDataSource,
    +        R: RangeBounds<usize>,
    +    {
    +        let start = range.start_bound().cloned();
    +        let mut end = range.end_bound().cloned();
    +        if end == Bound::Unbounded {
    +            end = Bound::Excluded(NodeDataSource::block_height(ds).await.unwrap());
    +        }
    +        (start, end)
    +    }
    +
    +    /// Get a stream of blocks, implicitly terminating at the current block height.
    +    async fn block_range<R, D>(ds: &D, range: R) -> BoxStream<'static, BlockQueryData<MockTypes>>
    +    where
    +        D: TestableDataSource,
    +        R: RangeBounds<usize> + Send + 'static,
    +    {
    +        ds.get_block_range(bound_range(ds, range).await)
    +            .await
    +            .then(Fetch::resolve)
    +            .boxed()
    +    }
    +
    +    /// Get a stream of leaves, implicitly terminating at the current block height.
    +    async fn leaf_range<R, D>(ds: &D, range: R) -> BoxStream<'static, LeafQueryData<MockTypes>>
    +    where
    +        D: TestableDataSource,
    +        R: RangeBounds<usize> + Send + 'static,
    +    {
    +        ds.get_leaf_range(bound_range(ds, range).await)
    +            .await
    +            .then(Fetch::resolve)
    +            .boxed()
    +    }
    +
         async fn get_non_empty_blocks(
             ds: &RwLock<impl TestableDataSource>,
         ) -> Vec<(LeafQueryData<MockTypes>, BlockQueryData<MockTypes>)> {
             let ds = ds.read().await;
             // Ignore the genesis block (start from height 1).
    -        ds.get_leaf_range(1..)
    +        leaf_range(&*ds, 1..)
                 .await
    -            .unwrap()
    -            .zip(ds.get_block_range(..).await.unwrap())
    -            .filter_map(|entry| async move {
    -                match entry {
    -                    (Ok(leaf), Ok(block)) if !block.is_empty() => Some((leaf, block)),
    -                    _ => None,
    -                }
    -            })
    +            .zip(block_range(&*ds, 1..).await)
    +            .filter(|(_, block)| future::ready(!block.is_empty()))
                 .collect()
                 .await
         }
    @@ -601,22 +677,21 @@
             // Check the consistency of every block/leaf pair. Keep track of transactions we've seen so
             // we can detect duplicates.
             let mut seen_transactions = HashMap::new();
    -        let mut leaves = ds.get_leaf_range(..).await.unwrap().enumerate();
    +        let mut leaves = leaf_range(&*ds, ..).await.enumerate();
             while let Some((i, leaf)) = leaves.next().await {
    -            let leaf = leaf.unwrap();
                 assert_eq!(leaf.height(), i as u64);
                 assert_eq!(leaf.hash(), leaf.leaf().commit());
     
                 // Check indices.
    -            assert_eq!(leaf, ds.get_leaf(i).await.unwrap());
    -            assert_eq!(leaf, ds.get_leaf(leaf.hash()).await.unwrap());
    +            assert_eq!(leaf, ds.get_leaf(i).await.await);
    +            assert_eq!(leaf, ds.get_leaf(leaf.hash()).await.await);
                 assert!(ds
                     .get_proposals(&leaf.proposer(), None)
                     .await
                     .unwrap()
                     .contains(&leaf));
     
    -            let Ok(block) = ds.get_block(i).await else {
    +            let Ok(block) = ds.get_block(i).await.try_resolve() else {
                     continue;
                 };
                 assert_eq!(leaf.block_hash(), block.hash());
    @@ -625,8 +700,8 @@
                 assert_eq!(block.size(), payload_size::<MockTypes>(block.payload()));
     
                 // Check indices.
    -            assert_eq!(block, ds.get_block(i).await.unwrap());
    -            assert_eq!(ds.get_block(block.hash()).await.unwrap().height(), i as u64);
    +            assert_eq!(block, ds.get_block(i).await.await);
    +            assert_eq!(ds.get_block(block.hash()).await.await.height(), i as u64);
     
                 for (j, txn) in block.enumerate() {
                     // We should be able to look up the transaction by hash unless it is a duplicate.
    @@ -635,17 +710,15 @@
                     let ix = seen_transactions
                         .entry(txn.commit())
                         .or_insert((i as u64, j));
    -                let (block, pos) = ds.get_block_with_transaction(txn.commit()).await.unwrap();
    +                let (block, pos) = ds.get_block_with_transaction(txn.commit()).await.await;
                     assert_eq!((block.height(), pos), *ix);
                 }
             }
     
             // Validate the list of proposals for every distinct proposer ID in the chain.
    -        for proposer in ds
    -            .get_leaf_range(..)
    +        for proposer in leaf_range(&*ds, ..)
                 .await
    -            .unwrap()
    -            .filter_map(|res| async move { res.ok().map(|leaf| leaf.proposer()) })
    +            .map(|leaf| leaf.proposer())
                 .collect::<HashSet<_>>()
                 .await
             {
    @@ -687,15 +760,7 @@
     
             // Submit a few blocks and make sure each one gets reflected in the query service and
             // preserves the consistency of the data and indices.
    -        let mut blocks = {
    -            ds.read()
    -                .await
    -                .subscribe_blocks(0)
    -                .await
    -                .unwrap()
    -                .map(Result::unwrap)
    -                .enumerate()
    -        };
    +        let mut blocks = { ds.read().await.subscribe_blocks(0).await.enumerate() };
             for nonce in 0..3 {
                 let txn = mock_transaction(vec![nonce]);
                 network.submit_transaction(txn).await;
    @@ -710,7 +775,7 @@
                     tracing::info!("block {i} is empty");
                 };
     
    -            assert_eq!(ds.read().await.get_block(i).await.unwrap(), block);
    +            assert_eq!(ds.read().await.get_block(i).await.await, block);
                 validate(&ds).await;
             }
     
    @@ -722,38 +787,14 @@
                 let ds = ds.read().await;
                 let storage = D::connect(network.storage()).await;
                 assert_eq!(
    -                ds.get_block_range(..)
    -                    .await
    -                    .unwrap()
    -                    .try_collect::<Vec<_>>()
    -                    .await
    -                    .unwrap(),
    -                storage
    -                    .get_block_range(..)
    -                    .await
    -                    .unwrap()
    -                    .try_collect::<Vec<_>>()
    -                    .await
    -                    .unwrap()
    -            );
    +                block_range(&*ds, ..).await.collect::<Vec<_>>().await,
    +                block_range(&storage, ..).await.collect::<Vec<_>>().await
    +            );
                 assert_eq!(
    -                ds.get_leaf_range(..)
    -                    .await
    -                    .unwrap()
    -                    .try_collect::<Vec<_>>()
    -                    .await
    -                    .unwrap(),
    -                storage
    -                    .get_leaf_range(..)
    -                    .await
    -                    .unwrap()
    -                    .try_collect::<Vec<_>>()
    -                    .await
    -                    .unwrap()
    -            );
    +                leaf_range(&*ds, ..).await.collect::<Vec<_>>().await,
    +                leaf_range(&storage, ..).await.collect::<Vec<_>>().await
    +            );
             }
    -
    -        network.shut_down().await;
         }
     
         #[async_std::test]
    @@ -768,7 +809,9 @@
             // change during the test.
             let (ds, block_height) = loop {
                 let ds = ds.read().await;
    -            let block_height = ds.block_height().await.unwrap();
    +            let block_height = NodeDataSource::<MockTypes>::block_height(&*ds)
    +                .await
    +                .unwrap();
                 if block_height >= 3 {
                     break (ds, block_height as u64);
                 }
    @@ -790,18 +833,33 @@
         async fn do_range_test<D, R, I>(ds: &D, range: R, expected_indices: I)
         where
             D: TestableDataSource,
    -        R: RangeBounds<usize> + Clone + Send,
    +        R: RangeBounds<usize> + Clone + Debug + Send + 'static,
             I: IntoIterator<Item = u64>,
         {
    -        let mut leaves = ds.get_leaf_range(range.clone()).await.unwrap();
    -        let mut blocks = ds.get_block_range(range).await.unwrap();
    +        tracing::info!("testing range {range:?}");
    +
    +        let mut leaves = ds.get_leaf_range(range.clone()).await;
    +        let mut blocks = ds.get_block_range(range.clone()).await;
     
             for i in expected_indices {
    -            let leaf = leaves.next().await.unwrap().unwrap();
    -            let block = blocks.next().await.unwrap().unwrap();
    +            let leaf = leaves.next().await.unwrap().await;
    +            let block = blocks.next().await.unwrap().await;
                 assert_eq!(leaf.height(), i);
                 assert_eq!(block.height(), i);
             }
    +
    +        if range.end_bound() == Bound::Unbounded {
    +            // If the range is unbounded, the stream should continue, yielding pending futures for
    +            // the objects which are not currently available.
    +            let fetch_leaf = leaves.next().await.unwrap();
    +            let fetch_block = blocks.next().await.unwrap();
    +            fetch_leaf.try_resolve().unwrap_err();
    +            fetch_block.try_resolve().unwrap_err();
    +        } else {
    +            // If the range is bounded, it should end where expected.
    +            assert!(leaves.next().await.is_none());
    +            assert!(blocks.next().await.is_none());
    +        }
         }
     
         // A wrapper around a range that turns the lower bound from inclusive to exclusive.
    @@ -837,28 +895,34 @@
             leaf.block_header.block_number += 1;
             qc.data.leaf_commit = leaf.commit();
     
    -        let block = BlockQueryData::new(leaf.clone(), qc.clone(), MockPayload::genesis()).unwrap();
    +        let block = BlockQueryData::new(&leaf, &qc, MockPayload::genesis()).unwrap();
             let leaf = LeafQueryData::new(leaf, qc).unwrap();
     
             // Insert, but do not commit, some data and check that we can read it back.
    -        ds.insert_leaf(leaf.clone()).await.unwrap();
    +        UpdateAvailabilityData::<MockTypes>::insert_leaf(&mut ds, leaf.clone())
    +            .await
    +            .unwrap();
             ds.insert_block(block.clone()).await.unwrap();
     
    -        assert_eq!(ds.block_height().await.unwrap(), 2);
    -        assert_eq!(leaf, ds.get_leaf(1).await.unwrap());
    -        assert_eq!(block, ds.get_block(1).await.unwrap());
    +        assert_eq!(
    +            NodeDataSource::<MockTypes>::block_height(&ds)
    +                .await
    +                .unwrap(),
    +            2
    +        );
    +        assert_eq!(leaf, ds.get_leaf(1).await.await);
    +        assert_eq!(block, ds.get_block(1).await.await);
     
             // Revert the changes.
             ds.revert().await;
    -        assert_eq!(ds.block_height().await.unwrap(), 1);
    -        assert!(matches!(
    -            ds.get_leaf(1).await.unwrap_err(),
    -            QueryError::NotFound
    -        ));
    -        assert!(matches!(
    -            ds.get_block(1).await.unwrap_err(),
    -            QueryError::NotFound
    -        ));
    +        assert_eq!(
    +            NodeDataSource::<MockTypes>::block_height(&ds)
    +                .await
    +                .unwrap(),
    +            1
    +        );
    +        ds.get_leaf(1).await.try_resolve().unwrap_err();
    +        ds.get_block(1).await.try_resolve().unwrap_err();
         }
     
         #[async_std::test]
    @@ -876,31 +940,37 @@
             leaf.block_header.block_number += 1;
             qc.data.leaf_commit = leaf.commit();
     
    -        let block = BlockQueryData::new(leaf.clone(), qc.clone(), MockPayload::genesis()).unwrap();
    +        let block = BlockQueryData::new(&leaf, &qc, MockPayload::genesis()).unwrap();
             let leaf = LeafQueryData::new(leaf, qc).unwrap();
     
             // Insert some data and check that we can read it back.
    -        ds.insert_leaf(leaf.clone()).await.unwrap();
    +        UpdateAvailabilityData::<MockTypes>::insert_leaf(&mut ds, leaf.clone())
    +            .await
    +            .unwrap();
             ds.insert_block(block.clone()).await.unwrap();
             ds.commit().await.unwrap();
     
    -        assert_eq!(ds.block_height().await.unwrap(), 2);
    -        assert_eq!(leaf, ds.get_leaf(1).await.unwrap());
    -        assert_eq!(block, ds.get_block(1).await.unwrap());
    +        assert_eq!(
    +            NodeDataSource::<MockTypes>::block_height(&ds)
    +                .await
    +                .unwrap(),
    +            2
    +        );
    +        assert_eq!(leaf, ds.get_leaf(1).await.await);
    +        assert_eq!(block, ds.get_block(1).await.await);
     
             drop(ds);
     
             // Reset and check that the changes are gone.
             let ds = D::reset(&storage).await;
    -        assert_eq!(ds.block_height().await.unwrap(), 1);
    -        assert!(matches!(
    -            ds.get_leaf(1).await.unwrap_err(),
    -            QueryError::NotFound
    -        ));
    -        assert!(matches!(
    -            ds.get_block(1).await.unwrap_err(),
    -            QueryError::NotFound
    -        ));
    +        assert_eq!(
    +            NodeDataSource::<MockTypes>::block_height(&ds)
    +                .await
    +                .unwrap(),
    +            1
    +        );
    +        ds.get_leaf(1).await.try_resolve().unwrap_err();
    +        ds.get_block(1).await.try_resolve().unwrap_err();
         }
     }
     
    diff --git a/src/hotshot_query_service/data_source/buffered_channel.rs.html b/src/hotshot_query_service/data_source/buffered_channel.rs.html
    deleted file mode 100644
    index 2c3c0d3a7..000000000
    --- a/src/hotshot_query_service/data_source/buffered_channel.rs.html
    +++ /dev/null
    @@ -1,171 +0,0 @@
    -buffered_channel.rs - source
    1
    -2
    -3
    -4
    -5
    -6
    -7
    -8
    -9
    -10
    -11
    -12
    -13
    -14
    -15
    -16
    -17
    -18
    -19
    -20
    -21
    -22
    -23
    -24
    -25
    -26
    -27
    -28
    -29
    -30
    -31
    -32
    -33
    -34
    -35
    -36
    -37
    -38
    -39
    -40
    -41
    -42
    -43
    -44
    -45
    -46
    -47
    -48
    -49
    -50
    -51
    -52
    -53
    -54
    -55
    -56
    -57
    -58
    -59
    -60
    -61
    -62
    -63
    -64
    -65
    -66
    -67
    -68
    -69
    -70
    -71
    -72
    -73
    -74
    -75
    -76
    -77
    -78
    -79
    -80
    -81
    -82
    -83
    -84
    -85
    -
    // Copyright (c) 2022 Espresso Systems (espressosys.com)
    -// This file is part of the HotShot Query Service library.
    -//
    -// This program is free software: you can redistribute it and/or modify it under the terms of the GNU
    -// General Public License as published by the Free Software Foundation, either version 3 of the
    -// License, or (at your option) any later version.
    -// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
    -// even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    -// General Public License for more details.
    -// You should have received a copy of the GNU General Public License along with this program. If not,
    -// see <https://www.gnu.org/licenses/>.
    -
    -#![cfg(feature = "sql-data-source")]
    -
    -//! Async channel with message buffering.
    -//!
    -//! A buffered channel is an async, in-memory broadcast channel which buffers messages before
    -//! delivering them. Unlike a typical channel, sending a message only buffers the message in the
    -//! sender. Receivers are not notified immediately. Only when [`flush`](BufferedChannel::flush) is
    -//! called are all buffered messages delivered to receivers. [`clear`](BufferedChannel::clear) can
    -//! also be used to drop all buffered messages without ever notifying receivers.
    -
    -use async_compatibility_layer::async_primitives::broadcast::{channel, BroadcastSender};
    -use futures::stream::{self, Stream};
    -
    -/// An async channel with message buffering.
    -#[derive(Debug)]
    -pub(super) struct BufferedChannel<T> {
    -    pending: Vec<T>,
    -    inner: BroadcastSender<T>,
    -}
    -
    -impl<T: Clone> BufferedChannel<T> {
    -    /// Create a buffered channel.
    -    pub(super) fn init() -> Self {
    -        Self {
    -            pending: vec![],
    -            inner: channel().0,
    -        }
    -    }
    -
    -    /// Subscribe to future messages sent on this channel.
    -    ///
    -    /// Messages queued and flushed via this sender will be delivered to all subscribers which exist
    -    /// at the time the messages are flushed.
    -    pub(super) async fn subscribe(&self) -> impl Stream<Item = T> {
    -        stream::unfold(self.inner.handle_async().await, |mut handle| async move {
    -            match handle.recv_async().await {
    -                Ok(msg) => Some((msg, handle)),
    -                Err(_) => {
    -                    // An error in receive means the send end of the channel has been disconnected,
    -                    // which means the stream is over.
    -                    None
    -                }
    -            }
    -        })
    -    }
    -
    -    /// Push a message into the buffered channel
    -    ///
    -    /// The message is not sent immediately, but will be delivered to receivers after
    -    /// [`flush`](Self::flush) is called.
    -    pub(super) fn push(&mut self, msg: T) {
    -        self.pending.push(msg);
    -    }
    -
    -    /// Flush buffered messages.
    -    ///
    -    /// Deliver pending messages to active receivers. All messages which were [pushed](Self::push)
    -    /// since the last [`flush`](Self::flush) or [`clear`](Self::clear) will be delivered.
    -    pub(super) async fn flush(&mut self) {
    -        for msg in std::mem::take(&mut self.pending) {
    -            // Ignore errors on sending, it just means all listeners have dropped their handles.
    -            self.inner.send_async(msg).await.ok();
    -        }
    -    }
    -
    -    /// Drop pending messages.
    -    ///
    -    /// All messages which were [pushed](Self::push) since the last [`flush`](Self::flush) or
    -    /// [`clear`](Self::clear) will be dropped.
    -    pub(super) fn clear(&mut self) {
    -        self.pending.clear();
    -    }
    -}
    -
    \ No newline at end of file diff --git a/src/hotshot_query_service/data_source/extension.rs.html b/src/hotshot_query_service/data_source/extension.rs.html index fa4c6077c..679ba5cfe 100644 --- a/src/hotshot_query_service/data_source/extension.rs.html +++ b/src/hotshot_query_service/data_source/extension.rs.html @@ -271,6 +271,22 @@ 271 272 273 +274 +275 +276 +277 +278 +279 +280 +281 +282 +283 +284 +285 +286 +287 +288 +289
    // Copyright (c) 2022 Espresso Systems (espressosys.com)
     // This file is part of the HotShot Query Service library.
     //
    @@ -286,10 +302,11 @@
     use super::VersionedDataSource;
     use crate::{
         availability::{
    -        AvailabilityDataSource, BlockId, BlockQueryData, LeafId, LeafQueryData, QueryablePayload,
    -        TransactionHash, TransactionIndex, UpdateAvailabilityData,
    +        AvailabilityDataSource, BlockId, BlockQueryData, Fetch, LeafId, LeafQueryData,
    +        QueryablePayload, TransactionHash, TransactionIndex, UpdateAvailabilityData,
         },
         metrics::PrometheusMetrics,
    +    node::{NodeDataSource, UpdateNodeData},
         status::StatusDataSource,
         Payload, QueryResult, SignatureKey,
     };
    @@ -403,48 +420,73 @@
         Types: NodeType,
         Payload<Types>: QueryablePayload,
     {
    -    type LeafStream = D::LeafStream;
    -    type BlockStream = D::BlockStream;
    -
    -    type LeafRange<'a, R> = D::LeafRange<'a, R>
    +    type LeafRange<R> = D::LeafRange<R>
         where
    -        Self: 'a,
    -        R: RangeBounds<usize> + Send;
    -    type BlockRange<'a, R> = D::BlockRange<'a, R>
    +        R: RangeBounds<usize> + Send;
    +    type BlockRange<R> = D::BlockRange<R>
         where
    -        Self: 'a,
    -        R: RangeBounds<usize> + Send;
    +        R: RangeBounds<usize> + Send;
     
    -    async fn get_leaf<ID>(&self, id: ID) -> QueryResult<LeafQueryData<Types>>
    +    async fn get_leaf<ID>(&self, id: ID) -> Fetch<LeafQueryData<Types>>
         where
             ID: Into<LeafId<Types>> + Send + Sync,
         {
             self.data_source.get_leaf(id).await
         }
    -    async fn get_block<ID>(&self, id: ID) -> QueryResult<BlockQueryData<Types>>
    +    async fn get_block<ID>(&self, id: ID) -> Fetch<BlockQueryData<Types>>
         where
             ID: Into<BlockId<Types>> + Send + Sync,
         {
             self.data_source.get_block(id).await
         }
    -    async fn get_leaf_range<R>(&self, range: R) -> QueryResult<Self::LeafRange<'_, R>>
    +    async fn get_leaf_range<R>(&self, range: R) -> Self::LeafRange<R>
         where
    -        R: RangeBounds<usize> + Send,
    +        R: RangeBounds<usize> + Send + 'static,
         {
             self.data_source.get_leaf_range(range).await
         }
    -    async fn get_block_range<R>(&self, range: R) -> QueryResult<Self::BlockRange<'_, R>>
    +    async fn get_block_range<R>(&self, range: R) -> Self::BlockRange<R>
         where
    -        R: RangeBounds<usize> + Send,
    +        R: RangeBounds<usize> + Send + 'static,
         {
             self.data_source.get_block_range(range).await
         }
         async fn get_block_with_transaction(
             &self,
             hash: TransactionHash<Types>,
    -    ) -> QueryResult<(BlockQueryData<Types>, TransactionIndex<Types>)> {
    +    ) -> Fetch<(BlockQueryData<Types>, TransactionIndex<Types>)> {
             self.data_source.get_block_with_transaction(hash).await
         }
    +}
    +
    +#[async_trait]
    +impl<D, U, Types> UpdateAvailabilityData<Types> for ExtensibleDataSource<D, U>
    +where
    +    D: UpdateAvailabilityData<Types> + Send + Sync,
    +    U: Send + Sync,
    +    Types: NodeType,
    +{
    +    type Error = D::Error;
    +
    +    async fn insert_leaf(&mut self, leaf: LeafQueryData<Types>) -> Result<(), Self::Error> {
    +        self.data_source.insert_leaf(leaf).await
    +    }
    +
    +    async fn insert_block(&mut self, block: BlockQueryData<Types>) -> Result<(), Self::Error> {
    +        self.data_source.insert_block(block).await
    +    }
    +}
    +
    +#[async_trait]
    +impl<D, U, Types> NodeDataSource<Types> for ExtensibleDataSource<D, U>
    +where
    +    D: NodeDataSource<Types> + Send + Sync,
    +    U: Send + Sync,
    +    Types: NodeType,
    +{
    +    async fn block_height(&self) -> QueryResult<usize> {
    +        self.data_source.block_height().await
    +    }
         async fn get_proposals(
             &self,
             proposer: &SignatureKey<Types>,
    @@ -455,18 +497,12 @@
         async fn count_proposals(&self, proposer: &SignatureKey<Types>) -> QueryResult<usize> {
             self.data_source.count_proposals(proposer).await
         }
    -    async fn subscribe_leaves(&self, height: usize) -> QueryResult<Self::LeafStream> {
    -        self.data_source.subscribe_leaves(height).await
    -    }
    -    async fn subscribe_blocks(&self, height: usize) -> QueryResult<Self::BlockStream> {
    -        self.data_source.subscribe_blocks(height).await
    -    }
     }
     
     #[async_trait]
    -impl<D, U, Types> UpdateAvailabilityData<Types> for ExtensibleDataSource<D, U>
    +impl<D, U, Types> UpdateNodeData<Types> for ExtensibleDataSource<D, U>
     where
    -    D: UpdateAvailabilityData<Types> + Send + Sync,
    +    D: UpdateNodeData<Types> + Send + Sync,
         U: Send + Sync,
         Types: NodeType,
     {
    @@ -475,10 +511,6 @@
         async fn insert_leaf(&mut self, leaf: LeafQueryData<Types>) -> Result<(), Self::Error> {
             self.data_source.insert_leaf(leaf).await
         }
    -
    -    async fn insert_block(&mut self, block: BlockQueryData<Types>) -> Result<(), Self::Error> {
    -        self.data_source.insert_block(block).await
    -    }
     }
     
     #[async_trait]
    diff --git a/src/hotshot_query_service/data_source/fetching.rs.html b/src/hotshot_query_service/data_source/fetching.rs.html
    new file mode 100644
    index 000000000..2bb6b0e06
    --- /dev/null
    +++ b/src/hotshot_query_service/data_source/fetching.rs.html
    @@ -0,0 +1,1785 @@
    +fetching.rs - source
    1
    +2
    +3
    +4
    +5
    +6
    +7
    +8
    +9
    +10
    +11
    +12
    +13
    +14
    +15
    +16
    +17
    +18
    +19
    +20
    +21
    +22
    +23
    +24
    +25
    +26
    +27
    +28
    +29
    +30
    +31
    +32
    +33
    +34
    +35
    +36
    +37
    +38
    +39
    +40
    +41
    +42
    +43
    +44
    +45
    +46
    +47
    +48
    +49
    +50
    +51
    +52
    +53
    +54
    +55
    +56
    +57
    +58
    +59
    +60
    +61
    +62
    +63
    +64
    +65
    +66
    +67
    +68
    +69
    +70
    +71
    +72
    +73
    +74
    +75
    +76
    +77
    +78
    +79
    +80
    +81
    +82
    +83
    +84
    +85
    +86
    +87
    +88
    +89
    +90
    +91
    +92
    +93
    +94
    +95
    +96
    +97
    +98
    +99
    +100
    +101
    +102
    +103
    +104
    +105
    +106
    +107
    +108
    +109
    +110
    +111
    +112
    +113
    +114
    +115
    +116
    +117
    +118
    +119
    +120
    +121
    +122
    +123
    +124
    +125
    +126
    +127
    +128
    +129
    +130
    +131
    +132
    +133
    +134
    +135
    +136
    +137
    +138
    +139
    +140
    +141
    +142
    +143
    +144
    +145
    +146
    +147
    +148
    +149
    +150
    +151
    +152
    +153
    +154
    +155
    +156
    +157
    +158
    +159
    +160
    +161
    +162
    +163
    +164
    +165
    +166
    +167
    +168
    +169
    +170
    +171
    +172
    +173
    +174
    +175
    +176
    +177
    +178
    +179
    +180
    +181
    +182
    +183
    +184
    +185
    +186
    +187
    +188
    +189
    +190
    +191
    +192
    +193
    +194
    +195
    +196
    +197
    +198
    +199
    +200
    +201
    +202
    +203
    +204
    +205
    +206
    +207
    +208
    +209
    +210
    +211
    +212
    +213
    +214
    +215
    +216
    +217
    +218
    +219
    +220
    +221
    +222
    +223
    +224
    +225
    +226
    +227
    +228
    +229
    +230
    +231
    +232
    +233
    +234
    +235
    +236
    +237
    +238
    +239
    +240
    +241
    +242
    +243
    +244
    +245
    +246
    +247
    +248
    +249
    +250
    +251
    +252
    +253
    +254
    +255
    +256
    +257
    +258
    +259
    +260
    +261
    +262
    +263
    +264
    +265
    +266
    +267
    +268
    +269
    +270
    +271
    +272
    +273
    +274
    +275
    +276
    +277
    +278
    +279
    +280
    +281
    +282
    +283
    +284
    +285
    +286
    +287
    +288
    +289
    +290
    +291
    +292
    +293
    +294
    +295
    +296
    +297
    +298
    +299
    +300
    +301
    +302
    +303
    +304
    +305
    +306
    +307
    +308
    +309
    +310
    +311
    +312
    +313
    +314
    +315
    +316
    +317
    +318
    +319
    +320
    +321
    +322
    +323
    +324
    +325
    +326
    +327
    +328
    +329
    +330
    +331
    +332
    +333
    +334
    +335
    +336
    +337
    +338
    +339
    +340
    +341
    +342
    +343
    +344
    +345
    +346
    +347
    +348
    +349
    +350
    +351
    +352
    +353
    +354
    +355
    +356
    +357
    +358
    +359
    +360
    +361
    +362
    +363
    +364
    +365
    +366
    +367
    +368
    +369
    +370
    +371
    +372
    +373
    +374
    +375
    +376
    +377
    +378
    +379
    +380
    +381
    +382
    +383
    +384
    +385
    +386
    +387
    +388
    +389
    +390
    +391
    +392
    +393
    +394
    +395
    +396
    +397
    +398
    +399
    +400
    +401
    +402
    +403
    +404
    +405
    +406
    +407
    +408
    +409
    +410
    +411
    +412
    +413
    +414
    +415
    +416
    +417
    +418
    +419
    +420
    +421
    +422
    +423
    +424
    +425
    +426
    +427
    +428
    +429
    +430
    +431
    +432
    +433
    +434
    +435
    +436
    +437
    +438
    +439
    +440
    +441
    +442
    +443
    +444
    +445
    +446
    +447
    +448
    +449
    +450
    +451
    +452
    +453
    +454
    +455
    +456
    +457
    +458
    +459
    +460
    +461
    +462
    +463
    +464
    +465
    +466
    +467
    +468
    +469
    +470
    +471
    +472
    +473
    +474
    +475
    +476
    +477
    +478
    +479
    +480
    +481
    +482
    +483
    +484
    +485
    +486
    +487
    +488
    +489
    +490
    +491
    +492
    +493
    +494
    +495
    +496
    +497
    +498
    +499
    +500
    +501
    +502
    +503
    +504
    +505
    +506
    +507
    +508
    +509
    +510
    +511
    +512
    +513
    +514
    +515
    +516
    +517
    +518
    +519
    +520
    +521
    +522
    +523
    +524
    +525
    +526
    +527
    +528
    +529
    +530
    +531
    +532
    +533
    +534
    +535
    +536
    +537
    +538
    +539
    +540
    +541
    +542
    +543
    +544
    +545
    +546
    +547
    +548
    +549
    +550
    +551
    +552
    +553
    +554
    +555
    +556
    +557
    +558
    +559
    +560
    +561
    +562
    +563
    +564
    +565
    +566
    +567
    +568
    +569
    +570
    +571
    +572
    +573
    +574
    +575
    +576
    +577
    +578
    +579
    +580
    +581
    +582
    +583
    +584
    +585
    +586
    +587
    +588
    +589
    +590
    +591
    +592
    +593
    +594
    +595
    +596
    +597
    +598
    +599
    +600
    +601
    +602
    +603
    +604
    +605
    +606
    +607
    +608
    +609
    +610
    +611
    +612
    +613
    +614
    +615
    +616
    +617
    +618
    +619
    +620
    +621
    +622
    +623
    +624
    +625
    +626
    +627
    +628
    +629
    +630
    +631
    +632
    +633
    +634
    +635
    +636
    +637
    +638
    +639
    +640
    +641
    +642
    +643
    +644
    +645
    +646
    +647
    +648
    +649
    +650
    +651
    +652
    +653
    +654
    +655
    +656
    +657
    +658
    +659
    +660
    +661
    +662
    +663
    +664
    +665
    +666
    +667
    +668
    +669
    +670
    +671
    +672
    +673
    +674
    +675
    +676
    +677
    +678
    +679
    +680
    +681
    +682
    +683
    +684
    +685
    +686
    +687
    +688
    +689
    +690
    +691
    +692
    +693
    +694
    +695
    +696
    +697
    +698
    +699
    +700
    +701
    +702
    +703
    +704
    +705
    +706
    +707
    +708
    +709
    +710
    +711
    +712
    +713
    +714
    +715
    +716
    +717
    +718
    +719
    +720
    +721
    +722
    +723
    +724
    +725
    +726
    +727
    +728
    +729
    +730
    +731
    +732
    +733
    +734
    +735
    +736
    +737
    +738
    +739
    +740
    +741
    +742
    +743
    +744
    +745
    +746
    +747
    +748
    +749
    +750
    +751
    +752
    +753
    +754
    +755
    +756
    +757
    +758
    +759
    +760
    +761
    +762
    +763
    +764
    +765
    +766
    +767
    +768
    +769
    +770
    +771
    +772
    +773
    +774
    +775
    +776
    +777
    +778
    +779
    +780
    +781
    +782
    +783
    +784
    +785
    +786
    +787
    +788
    +789
    +790
    +791
    +792
    +793
    +794
    +795
    +796
    +797
    +798
    +799
    +800
    +801
    +802
    +803
    +804
    +805
    +806
    +807
    +808
    +809
    +810
    +811
    +812
    +813
    +814
    +815
    +816
    +817
    +818
    +819
    +820
    +821
    +822
    +823
    +824
    +825
    +826
    +827
    +828
    +829
    +830
    +831
    +832
    +833
    +834
    +835
    +836
    +837
    +838
    +839
    +840
    +841
    +842
    +843
    +844
    +845
    +846
    +847
    +848
    +849
    +850
    +851
    +852
    +853
    +854
    +855
    +856
    +857
    +858
    +859
    +860
    +861
    +862
    +863
    +864
    +865
    +866
    +867
    +868
    +869
    +870
    +871
    +872
    +873
    +874
    +875
    +876
    +877
    +878
    +879
    +880
    +881
    +882
    +883
    +884
    +885
    +886
    +887
    +888
    +889
    +890
    +891
    +892
    +
    // Copyright (c) 2022 Espresso Systems (espressosys.com)
    +// This file is part of the HotShot Query Service library.
    +//
    +// This program is free software: you can redistribute it and/or modify it under the terms of the GNU
    +// General Public License as published by the Free Software Foundation, either version 3 of the
    +// License, or (at your option) any later version.
    +// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
    +// even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    +// General Public License for more details.
    +// You should have received a copy of the GNU General Public License along with this program. If not,
    +// see <https://www.gnu.org/licenses/>.
    +
    +use super::{notifier::Notifier, storage::AvailabilityStorage, VersionedDataSource};
    +use crate::{
    +    availability::{
    +        AvailabilityDataSource, BlockId, BlockQueryData, Fetch, LeafId, LeafQueryData,
    +        QueryablePayload, ResourceId, TransactionHash, TransactionIndex, UpdateAvailabilityData,
    +    },
    +    metrics::PrometheusMetrics,
    +    node::{NodeDataSource, UpdateNodeData},
    +    status::StatusDataSource,
    +    Payload, QueryResult, SignatureKey,
    +};
    +use async_std::{
    +    sync::{Arc, RwLock, RwLockReadGuard, RwLockWriteGuard},
    +    task::spawn,
    +};
    +use async_trait::async_trait;
    +use derivative::Derivative;
    +use derive_more::{Display, From};
    +use futures::{
    +    future::{join_all, BoxFuture, FutureExt},
    +    stream::{self, BoxStream, Stream, StreamExt},
    +};
    +use hotshot_types::traits::node_implementation::NodeType;
    +use std::{
    +    cmp::{min, Ordering},
    +    fmt::{Debug, Display},
    +    future::IntoFuture,
    +    ops::{Bound, Deref, DerefMut, Range, RangeBounds},
    +};
    +
    +/// The number of items to process at a time when loading a range or stream.
    +///
    +/// This determines:
    +/// * The number of objects to load from storage in a single request
    +/// * The number of objects to buffer in memory per request/stream
    +/// * The number of concurrent notification subscriptions per request/stream
    +const RANGE_CHUNK_SIZE: usize = 25;
    +
    +/// The most basic kind of data source.
    +///
    +/// A data source is constructed modularly by combining a [storage](super::storage) implementation
    +/// with a [fetcher](super::fetcher). The former allows the query service to store the data it has
    +/// persistently in an easily accessible storage medium, such as the local file system or a
    +/// database. This allows it to answer queries efficiently and to maintain its state across
    +/// restarts. The latter allows the query service to fetch data that is missing from its storage
    +/// from an external data availability provider, such as the Tiramisu DA network or another instance
    +/// of the query service.
    +///
    +/// These two components of a data source are combined in [`FetchingDataSource`], which is the
    +/// lowest level kind of data source available. It simply uses the storage implementation to fetch
    +/// data when available, and fills in everything else using the fetcher. Various kinds of data
    +/// sources can be constructed out of [`FetchingDataSource`] by changing the storage and fetcher
    +/// implementations used, and more complex data sources can be built on top using data source
    +/// combinators.
    +#[derive(Derivative)]
    +#[derivative(Clone(bound = ""), Debug(bound = "S: Debug, P: Debug"))]
    +pub struct FetchingDataSource<Types, S, P>
    +where
    +    Types: NodeType,
    +{
    +    // The fetcher manages retrieval of resources from both local storage and a remote provider. It
    +    // encapsulates the data which may need to be shared with a long-lived task or future that
    +    // implements the asynchronous fetching of a particular object. This is why it gets its own
    +    // type, wrapped in an [`Arc`] for easy, efficient cloning.
    +    fetcher: Arc<Fetcher<Types, S, P>>,
    +    // The rest of the data we need for implementing data source traits but not for fetching.
    +    metrics: PrometheusMetrics,
    +}
    +
    +impl<Types, S, P> FetchingDataSource<Types, S, P>
    +where
    +    Types: NodeType,
    +    Payload<Types>: QueryablePayload,
    +    S: NodeDataSource<Types>
    +        + UpdateNodeData<Types>
    +        + AvailabilityStorage<Types>
    +        + VersionedDataSource,
    +    P: Send + Sync,
    +{
    +    /// Create a data source with local storage and a remote data availability provider.
    +    pub async fn new(storage: S, provider: P) -> anyhow::Result<Self> {
    +        let mut ds = Self {
    +            fetcher: Arc::new(Fetcher::new(storage, provider)),
    +            metrics: Default::default(),
    +        };
    +
    +        if NodeDataSource::block_height(&ds).await? == 0 {
    +            // HotShot doesn't emit an event for the genesis block, so we need to manually ensure it
    +            // is present.
    +            ds.insert_genesis().await?;
    +        }
    +
    +        Ok(ds)
    +    }
    +
    +    async fn insert_genesis(&mut self) -> anyhow::Result<()> {
    +        UpdateAvailabilityData::insert_leaf(self, LeafQueryData::genesis()).await?;
    +        UpdateNodeData::insert_leaf(self, LeafQueryData::genesis()).await?;
    +        self.insert_block(BlockQueryData::genesis()).await?;
    +        self.commit().await?;
    +        Ok(())
    +    }
    +}
    +
    +#[derive(From)]
    +pub struct StorageReadGuard<'a, Types, S>
    +where
    +    Types: NodeType,
    +{
    +    inner: RwLockReadGuard<'a, NotifyStorage<Types, S>>,
    +}
    +
    +impl<'a, Types, S> Deref for StorageReadGuard<'a, Types, S>
    +where
    +    Types: NodeType,
    +{
    +    type Target = S;
    +
    +    fn deref(&self) -> &Self::Target {
    +        &self.inner.storage
    +    }
    +}
    +
    +#[derive(From)]
    +pub struct StorageWriteGuard<'a, Types, S>
    +where
    +    Types: NodeType,
    +{
    +    inner: RwLockWriteGuard<'a, NotifyStorage<Types, S>>,
    +}
    +
    +impl<'a, Types, S> Deref for StorageWriteGuard<'a, Types, S>
    +where
    +    Types: NodeType,
    +{
    +    type Target = S;
    +
    +    fn deref(&self) -> &Self::Target {
    +        &self.inner.storage
    +    }
    +}
    +
    +impl<'a, Types, S> DerefMut for StorageWriteGuard<'a, Types, S>
    +where
    +    Types: NodeType,
    +{
    +    fn deref_mut(&mut self) -> &mut Self::Target {
    +        &mut self.inner.storage
    +    }
    +}
    +
    +impl<Types, S, P> FetchingDataSource<Types, S, P>
    +where
    +    Types: NodeType,
    +{
    +    /// Obtain direct, read-only access to the underlying local storage.
    +    pub async fn storage(&self) -> StorageReadGuard<Types, S> {
    +        self.fetcher.storage.read().await.into()
    +    }
    +
    +    /// Obtain direct, mutable access the underlying local storage.
    +    pub async fn storage_mut(&self) -> StorageWriteGuard<Types, S> {
    +        self.fetcher.storage.write().await.into()
    +    }
    +}
    +
    +#[async_trait]
    +impl<Types, S, P> StatusDataSource for FetchingDataSource<Types, S, P>
    +where
    +    Types: NodeType,
    +    S: NodeDataSource<Types> + Send + Sync,
    +    P: Send + Sync,
    +{
    +    async fn block_height(&self) -> QueryResult<usize> {
    +        NodeDataSource::block_height(&*self.storage().await).await
    +    }
    +
    +    fn metrics(&self) -> &PrometheusMetrics {
    +        &self.metrics
    +    }
    +}
    +
    +#[async_trait]
    +impl<Types, S, P> AvailabilityDataSource<Types> for FetchingDataSource<Types, S, P>
    +where
    +    Types: NodeType,
    +    Payload<Types>: QueryablePayload,
    +    S: AvailabilityStorage<Types> + 'static,
    +    P: Send + Sync + 'static,
    +{
    +    type LeafRange<R> = BoxStream<'static, Fetch<LeafQueryData<Types>>>
    +    where
    +        R: RangeBounds<usize> + Send;
    +    type BlockRange<R> = BoxStream<'static, Fetch<BlockQueryData<Types>>>
    +    where
    +        R: RangeBounds<usize> + Send;
    +
    +    async fn get_leaf<ID>(&self, id: ID) -> Fetch<LeafQueryData<Types>>
    +    where
    +        ID: Into<LeafId<Types>> + Send + Sync,
    +    {
    +        self.fetcher.get(id.into()).await
    +    }
    +
    +    async fn get_block<ID>(&self, id: ID) -> Fetch<BlockQueryData<Types>>
    +    where
    +        ID: Into<BlockId<Types>> + Send + Sync,
    +    {
    +        self.fetcher.get(id.into()).await
    +    }
    +
    +    async fn get_leaf_range<R>(&self, range: R) -> Self::LeafRange<R>
    +    where
    +        R: RangeBounds<usize> + Send + 'static,
    +    {
    +        self.fetcher.clone().get_range(range)
    +    }
    +
    +    async fn get_block_range<R>(&self, range: R) -> Self::BlockRange<R>
    +    where
    +        R: RangeBounds<usize> + Send + 'static,
    +    {
    +        self.fetcher.clone().get_range(range)
    +    }
    +
    +    async fn get_block_with_transaction(
    +        &self,
    +        hash: TransactionHash<Types>,
    +    ) -> Fetch<(BlockQueryData<Types>, TransactionIndex<Types>)> {
    +        self.fetcher.get(hash).await
    +    }
    +}
    +
    +#[async_trait]
    +impl<Types, S, P> UpdateAvailabilityData<Types> for FetchingDataSource<Types, S, P>
    +where
    +    Types: NodeType,
    +    Payload<Types>: QueryablePayload,
    +    S: UpdateAvailabilityData<Types> + Send + Sync,
    +    P: Send + Sync,
    +{
    +    type Error = S::Error;
    +
    +    async fn insert_leaf(&mut self, leaf: LeafQueryData<Types>) -> Result<(), Self::Error> {
    +        leaf.store(&mut *self.fetcher.storage.write().await).await
    +    }
    +
    +    async fn insert_block(&mut self, block: BlockQueryData<Types>) -> Result<(), Self::Error> {
    +        block.store(&mut *self.fetcher.storage.write().await).await
    +    }
    +}
    +
    +#[async_trait]
    +impl<Types, S, P> NodeDataSource<Types> for FetchingDataSource<Types, S, P>
    +where
    +    Types: NodeType,
    +    S: NodeDataSource<Types> + Send + Sync,
    +    P: Send + Sync,
    +{
    +    async fn block_height(&self) -> QueryResult<usize> {
    +        self.storage().await.block_height().await
    +    }
    +
    +    async fn get_proposals(
    +        &self,
    +        proposer: &SignatureKey<Types>,
    +        limit: Option<usize>,
    +    ) -> QueryResult<Vec<LeafQueryData<Types>>> {
    +        self.storage().await.get_proposals(proposer, limit).await
    +    }
    +
    +    async fn count_proposals(&self, proposer: &SignatureKey<Types>) -> QueryResult<usize> {
    +        self.storage().await.count_proposals(proposer).await
    +    }
    +}
    +
    +#[async_trait]
    +impl<Types, S, P> UpdateNodeData<Types> for FetchingDataSource<Types, S, P>
    +where
    +    Types: NodeType,
    +    S: UpdateNodeData<Types> + Send + Sync,
    +    P: Send + Sync,
    +{
    +    type Error = S::Error;
    +
    +    async fn insert_leaf(&mut self, leaf: LeafQueryData<Types>) -> Result<(), Self::Error> {
    +        self.fetcher
    +            .storage
    +            .write()
    +            .await
    +            .storage
    +            .insert_leaf(leaf)
    +            .await
    +    }
    +}
    +
    +#[async_trait]
    +impl<Types, S, P> VersionedDataSource for FetchingDataSource<Types, S, P>
    +where
    +    Types: NodeType,
    +    S: VersionedDataSource + Send + Sync,
    +    P: Send + Sync,
    +{
    +    type Error = S::Error;
    +
    +    async fn commit(&mut self) -> Result<(), Self::Error> {
    +        self.storage_mut().await.commit().await
    +    }
    +
    +    async fn revert(&mut self) {
    +        self.storage_mut().await.revert().await
    +    }
    +}
    +
    +/// Asynchronous retrieval and storage of [`Fetchable`] resources.
    +#[derive(Debug)]
    +struct Fetcher<Types, S, P>
    +where
    +    Types: NodeType,
    +{
    +    storage: RwLock<NotifyStorage<Types, S>>,
    +    _provider: P,
    +}
    +
    +#[derive(Debug)]
    +struct NotifyStorage<Types, S>
    +where
    +    Types: NodeType,
    +{
    +    storage: S,
    +    block_notifier: Notifier<BlockQueryData<Types>>,
    +    leaf_notifier: Notifier<LeafQueryData<Types>>,
    +}
    +
    +impl<Types, S, P> Fetcher<Types, S, P>
    +where
    +    Types: NodeType,
    +{
    +    fn new(storage: S, provider: P) -> Self {
    +        Self {
    +            storage: RwLock::new(NotifyStorage {
    +                storage,
    +                block_notifier: Notifier::new(),
    +                leaf_notifier: Notifier::new(),
    +            }),
    +            _provider: provider,
    +        }
    +    }
    +}
    +
    +impl<Types, S, P> Fetcher<Types, S, P>
    +where
    +    Types: NodeType,
    +    Payload<Types>: QueryablePayload,
    +    S: AvailabilityStorage<Types> + 'static,
    +    P: Send + Sync + 'static,
    +{
    +    async fn get<T, R>(self: &Arc<Self>, req: R) -> Fetch<T>
    +    where
    +        T: Fetchable<Types>,
    +        R: Into<T::Request> + Send,
    +    {
    +        let req = req.into();
    +        // Hold a read lock on `storage` while we run `ok_or_fetch`. This means that no
    +        // notifications are sent in between checking local storage and triggering a fetch if
    +        // necessary, since sending notifications requires a write lock. Hence, we will not miss a
    +        // notification.
    +        let storage = self.storage.read().await;
    +        self.ok_or_fetch(&storage, req, T::load(&storage.storage, req).await)
    +            .await
    +    }
    +
    +    /// Get a range of objects from local storage or a provider.
    +    ///
    +    /// Convert a finite stream of fallible local storage lookups into a (possibly infinite) stream
    +    /// of infallible fetches. Objects in `range` are loaded from local storage. Any gaps or missing
    +    /// objects are filled by fetching from a provider. Items in the resulting stream are futures
    +    /// that will never fail to produce a resource, although they may block indefinitely if the
    +    /// resource needs to be fetched.
    +    ///
    +    /// Objects are loaded and fetched in chunks, which strikes a good balance of limiting the total
    +    /// number of storage and network requests, while also keeping the amount of simultaneous
    +    /// resource consumption bounded.
    +    fn get_range<R, T>(self: Arc<Self>, range: R) -> BoxStream<'static, Fetch<T>>
    +    where
    +        R: RangeBounds<usize> + Send + 'static,
    +        T: RangedFetchable<Types>,
    +    {
    +        stream::iter(range_chunks(range))
    +            .then(move |chunk| self.clone().get_chunk(chunk))
    +            .flatten()
    +            .boxed()
    +    }
    +
    +    /// Get a range of objects from local storage or a provider.
    +    ///
    +    /// This method is similar to `get_range`, except that:
    +    /// * It fetches all desired objects together, as a single chunk
    +    /// * It loads the object or triggers fetches right now rather than providing a lazy stream
    +    ///   which only fetches objects when polled.
    +    async fn get_chunk<T>(self: Arc<Self>, chunk: Range<usize>) -> impl Stream<Item = Fetch<T>>
    +    where
    +        T: RangedFetchable<Types>,
    +    {
    +        let storage = self.storage.read().await;
    +        let ts = T::load_range(&storage.storage, chunk.clone())
    +            .await
    +            .unwrap_or_default();
    +        // Log and discard error information; we want a list of Option where None indicates an
    +        // object that needs to be fetched.
    +        let ts = ts.into_iter().map(ResultExt::ok_or_trace);
    +        // Storage may return fewer objects than asked for if we hit the end of the current chain.
    +        // Pad out to the end of the chunk with None, indicating that objects we don't have yet must
    +        // be fetched.
    +        let padding = std::iter::repeat(None).take(chunk.len() - ts.len());
    +        let ts = ts.chain(padding);
    +        // Kick off a fetch for each missing object.
    +        let fetcher = &self;
    +        let ts = ts
    +            .enumerate()
    +            .map(|(i, opt)| fetcher.some_or_fetch(&storage, chunk.start + i, opt));
    +
    +        // We `join_all` here because we want this iterator to be evaluated eagerly for two reasons:
    +        // 1. It borrows from `self`, which is local to this future. This avoids having to clone
    +        //    `self` for every entry, instead we clone it for every chunk.
    +        // 2. We evaluate all the `some_or_fetch` calls eagerly, so the fetches are triggered as
    +        //    soon as we evaluate the chunk. This ensures we don't miss any notifications, since we
    +        //    load from storage and subscribe to notifications for missing objects all while we have
    +        //    a read lock on `self.storage`. No notifications can be sent during this time since
    +        //    sending a notification requires a write lock.
    +        stream::iter(join_all(ts).await)
    +    }
    +
    +    async fn ok_or_fetch<R, T>(
    +        self: &Arc<Self>,
    +        storage: &RwLockReadGuard<'_, NotifyStorage<Types, S>>,
    +        req: R,
    +        res: QueryResult<T>,
    +    ) -> Fetch<T>
    +    where
    +        R: Into<T::Request> + Send,
    +        T: Fetchable<Types> + Send + Sync + 'static,
    +    {
    +        self.some_or_fetch(storage, req, res.ok_or_trace()).await
    +    }
    +
    +    async fn some_or_fetch<R, T>(
    +        self: &Arc<Self>,
    +        storage: &RwLockReadGuard<'_, NotifyStorage<Types, S>>,
    +        req: R,
    +        res: Option<T>,
    +    ) -> Fetch<T>
    +    where
    +        R: Into<T::Request> + Send,
    +        T: Fetchable<Types> + Send + Sync + 'static,
    +    {
    +        match res {
    +            Some(t) => Fetch::Ready(t),
    +            None => self.fetch(storage, req).await,
    +        }
    +    }
    +
    +    async fn fetch<R, T>(
    +        self: &Arc<Self>,
    +        storage: &RwLockReadGuard<'_, NotifyStorage<Types, S>>,
    +        req: R,
    +    ) -> Fetch<T>
    +    where
    +        R: Into<T::Request>,
    +        T: Fetchable<Types>,
    +    {
    +        let req = req.into();
    +        tracing::debug!("fetching resource {req:?}");
    +
    +        // Subscribe to notifications so we are alerted when we get the resource.
    +        let fut = T::passive_fetch(&**storage, req)
    +            .await
    +            .then(move |opt| async move {
    +                match opt {
    +                    Some(t) => t,
    +                    None => {
    +                        // If `passive_fetch` returns `None`, it means the notifier was dropped
    +                        // without ever sending a notification. In this case, the correct behavior
    +                        // is actually to block forever (unless the `Fetch` itself is dropped),
    +                        // since the semantics of `Fetch` are to never fail. This is analogous to
    +                        // fetching an object which doesn't actually exist: the `Fetch` will never
    +                        // return.
    +                        //
    +                        // However, for ease of debugging, and since this is never expected to
    +                        // happen in normal usage, we panic instead. This should only happen in two
    +                        // cases:
    +                        // * The server was shut down (dropping the notifier) without cleaning up
    +                        //   some background tasks. This will not affect runtime behavior, but
    +                        //   should be fixed if it happens.
    +                        // * There is a very unexpected runtime bug resulting in the notifier being
    +                        //   dropped. If this happens, things are very broken in any case, and it is
    +                        //   better to panic loudly than simply block forever.
    +                        panic!("notifier dropped without satisfying request {req:?}");
    +                    }
    +                }
    +            });
    +
    +        // Trigger an active fetch from a remote provider if possible.
    +        if let Some(active) = T::active_fetch(self, req).await {
    +            let fetcher = self.clone();
    +            spawn(async move {
    +                tracing::info!("spawned active fetch for {req:?}");
    +                let obj = active.await;
    +                tracing::info!("fetched object {req:?}");
    +
    +                // Store the resource in local storage, so we can avoid fetching it in the future.
    +                let mut storage = fetcher.storage.write().await;
    +                if let Err(err) = obj.store(&mut *storage).await {
    +                    // It is unfortunate if this fails, but we can still proceed by returning the
    +                    // resource that we fetched, keeping it in memory. Simply log the error and move
    +                    // on.
    +                    tracing::warn!("failed to store fetched resource {req:?}: {err}");
    +                }
    +            });
    +        }
    +
    +        // Wait for the object to arrive.
    +        Fetch::Pending(fut.boxed())
    +    }
    +}
    +
    +/// Objects which can be fetched from a remote DA provider and cached in local storage.
    +///
    +/// This trait lets us abstract over leaves, blocks, and other types that can be fetched. Thus, the
    +/// logistics of fetching are shared between all objects, and only the low-level particulars are
    +/// type-specific.
    +#[async_trait]
    +trait Fetchable<Types>: Clone + Send + Sync + 'static
    +where
    +    Types: NodeType,
    +    Payload<Types>: QueryablePayload,
    +{
    +    /// A succinct specification of the object to be fetched.
    +    type Request: Copy + Debug + Send + Sync + 'static;
    +
    +    /// Does this object satisfy the given request?
    +    fn satisfies(&self, req: Self::Request) -> bool;
    +
    +    /// Create a future for fetching the object from a remote provider, if possible.
    +    ///
    +    /// An active fetch will only be triggered if:
    +    /// * There is not already an active fetch in progress for the same object
    +    /// * The requested object is known to exist. For example, we will trigger a fetch of a block
    +    ///   with a height less than the current block height, but not greater, since the latter might
    +    ///   not exist yet, and we should receive it passively once it is produced. Or, we will fetch a
    +    ///   leaf by height but not by hash, since we can't guarantee that a leaf with an arbitrary
    +    ///   hash exists.
    +    ///
    +    /// If we do not trigger an active fetch for an object, but the object does in fact exist, we
    +    /// will still eventually receive it passively, since we will eventually receive all blocks and
    +    /// leaves that are ever produced.
    +    async fn active_fetch<S, P>(
    +        _fetcher: &Fetcher<Types, S, P>,
    +        _req: Self::Request,
    +    ) -> Option<BoxFuture<'static, Self>>
    +    where
    +        S: AvailabilityStorage<Types>,
    +    {
    +        // TODO implement active fetching
    +        None
    +    }
    +
    +    /// Wait for someone else to fetch the object.
    +    async fn passive_fetch<S>(
    +        storage: &NotifyStorage<Types, S>,
    +        req: Self::Request,
    +    ) -> BoxFuture<'static, Option<Self>>
    +    where
    +        S: AvailabilityStorage<Types>;
    +
    +    /// Cache the object in local storage.
    +    async fn store<S>(self, storage: &mut NotifyStorage<Types, S>) -> Result<(), S::Error>
    +    where
    +        S: UpdateAvailabilityData<Types> + Send + Sync;
    +
    +    /// Load an object from local storage.
    +    async fn load<S>(storage: &S, req: Self::Request) -> QueryResult<Self>
    +    where
    +        S: AvailabilityStorage<Types>;
    +}
    +
    +#[async_trait]
    +trait RangedFetchable<Types>: Fetchable<Types, Request = Self::RangedRequest>
    +where
    +    Types: NodeType,
    +    Payload<Types>: QueryablePayload,
    +{
    +    type RangedRequest: From<usize> + Send;
    +
    +    /// Load a range of these objects from local storage.
    +    async fn load_range<S, R>(storage: &S, range: R) -> QueryResult<Vec<QueryResult<Self>>>
    +    where
    +        S: AvailabilityStorage<Types>,
    +        R: RangeBounds<usize> + Send + 'static;
    +}
    +
    +#[async_trait]
    +impl<Types> Fetchable<Types> for LeafQueryData<Types>
    +where
    +    Types: NodeType,
    +    Payload<Types>: QueryablePayload,
    +{
    +    type Request = LeafId<Types>;
    +
    +    fn satisfies(&self, req: Self::Request) -> bool {
    +        match req {
    +            ResourceId::Number(n) => self.height() == n as u64,
    +            ResourceId::Hash(h) => self.hash() == h,
    +        }
    +    }
    +
    +    async fn passive_fetch<S>(
    +        storage: &NotifyStorage<Types, S>,
    +        req: Self::Request,
    +    ) -> BoxFuture<'static, Option<Self>>
    +    where
    +        S: AvailabilityStorage<Types>,
    +    {
    +        storage
    +            .leaf_notifier
    +            .wait_for(move |leaf| leaf.satisfies(req))
    +            .await
    +            .into_future()
    +            .boxed()
    +    }
    +
    +    async fn store<S>(self, storage: &mut NotifyStorage<Types, S>) -> Result<(), S::Error>
    +    where
    +        S: UpdateAvailabilityData<Types> + Send + Sync,
    +    {
    +        storage.leaf_notifier.notify(&self);
    +        storage.storage.insert_leaf(self).await
    +    }
    +
    +    async fn load<S>(storage: &S, req: Self::Request) -> QueryResult<Self>
    +    where
    +        S: AvailabilityStorage<Types>,
    +    {
    +        storage.get_leaf(req).await
    +    }
    +}
    +
    +#[async_trait]
    +impl<Types> RangedFetchable<Types> for LeafQueryData<Types>
    +where
    +    Types: NodeType,
    +    Payload<Types>: QueryablePayload,
    +{
    +    type RangedRequest = LeafId<Types>;
    +
    +    async fn load_range<S, R>(storage: &S, range: R) -> QueryResult<Vec<QueryResult<Self>>>
    +    where
    +        S: AvailabilityStorage<Types>,
    +        R: RangeBounds<usize> + Send + 'static,
    +    {
    +        storage.get_leaf_range(range).await
    +    }
    +}
    +
    +/// A request to fetch a block.
    +///
    +/// Blocks can be requested either directly by their [`BlockId`], or indirectly, by requesting a
    +/// block containing a particular transaction.
    +#[derive(Derivative, From, Display)]
    +#[derivative(Ord = "feature_allow_slow_enum")]
    +#[derivative(
    +    Copy(bound = ""),
    +    Debug(bound = ""),
    +    PartialEq(bound = ""),
    +    Eq(bound = ""),
    +    Ord(bound = ""),
    +    Hash(bound = "")
    +)]
    +pub enum BlockRequest<Types>
    +where
    +    Types: NodeType,
    +{
    +    Id(BlockId<Types>),
    +    WithTransaction(TransactionHash<Types>),
    +}
    +
    +impl<Types> From<usize> for BlockRequest<Types>
    +where
    +    Types: NodeType,
    +{
    +    fn from(i: usize) -> Self {
    +        Self::Id(i.into())
    +    }
    +}
    +
    +impl<Types> Clone for BlockRequest<Types>
    +where
    +    Types: NodeType,
    +{
    +    fn clone(&self) -> Self {
    +        *self
    +    }
    +}
    +
    +impl<Types> PartialOrd for BlockRequest<Types>
    +where
    +    Types: NodeType,
    +{
    +    fn partial_cmp(&self, other: &Self) -> Option<Ordering> {
    +        Some(self.cmp(other))
    +    }
    +}
    +
    +#[async_trait]
    +impl<Types> Fetchable<Types> for BlockQueryData<Types>
    +where
    +    Types: NodeType,
    +    Payload<Types>: QueryablePayload,
    +{
    +    type Request = BlockRequest<Types>;
    +
    +    fn satisfies(&self, req: Self::Request) -> bool {
    +        match req {
    +            BlockRequest::Id(ResourceId::Number(n)) => self.height() == n as u64,
    +            BlockRequest::Id(ResourceId::Hash(h)) => self.hash() == h,
    +            BlockRequest::WithTransaction(h) => self.transaction_by_hash(h).is_some(),
    +        }
    +    }
    +
    +    async fn passive_fetch<S>(
    +        storage: &NotifyStorage<Types, S>,
    +        req: Self::Request,
    +    ) -> BoxFuture<'static, Option<Self>>
    +    where
    +        S: AvailabilityStorage<Types>,
    +    {
    +        storage
    +            .block_notifier
    +            .wait_for(move |block| block.satisfies(req))
    +            .await
    +            .into_future()
    +            .boxed()
    +    }
    +
    +    async fn store<S>(self, storage: &mut NotifyStorage<Types, S>) -> Result<(), S::Error>
    +    where
    +        S: UpdateAvailabilityData<Types> + Send + Sync,
    +    {
    +        storage.block_notifier.notify(&self);
    +        storage.storage.insert_block(self).await
    +    }
    +
    +    async fn load<S>(storage: &S, req: Self::Request) -> QueryResult<Self>
    +    where
    +        S: AvailabilityStorage<Types>,
    +    {
    +        match req {
    +            BlockRequest::Id(id) => storage.get_block(id).await,
    +            BlockRequest::WithTransaction(h) => Ok(storage.get_block_with_transaction(h).await?.0),
    +        }
    +    }
    +}
    +
    +#[async_trait]
    +impl<Types> RangedFetchable<Types> for BlockQueryData<Types>
    +where
    +    Types: NodeType,
    +    Payload<Types>: QueryablePayload,
    +{
    +    type RangedRequest = BlockRequest<Types>;
    +
    +    async fn load_range<S, R>(storage: &S, range: R) -> QueryResult<Vec<QueryResult<Self>>>
    +    where
    +        S: AvailabilityStorage<Types>,
    +        R: RangeBounds<usize> + Send + 'static,
    +    {
    +        storage.get_block_range(range).await
    +    }
    +}
    +
    +#[async_trait]
    +impl<Types> Fetchable<Types> for (BlockQueryData<Types>, TransactionIndex<Types>)
    +where
    +    Types: NodeType,
    +    Payload<Types>: QueryablePayload,
    +{
    +    type Request = TransactionHash<Types>;
    +
    +    fn satisfies(&self, req: Self::Request) -> bool {
    +        self.0.transaction_by_hash(req).is_some()
    +    }
    +
    +    async fn passive_fetch<S>(
    +        storage: &NotifyStorage<Types, S>,
    +        req: Self::Request,
    +    ) -> BoxFuture<'static, Option<Self>>
    +    where
    +        S: AvailabilityStorage<Types>,
    +    {
    +        let wait_block = storage
    +            .block_notifier
    +            .wait_for(move |block| block.satisfies(req.into()))
    +            .await;
    +
    +        async move {
    +            let block = wait_block.await?;
    +
    +            // This `unwrap` is safe, `wait_for` only returns blocks which satisfy the request, and
    +            // in this case that means the block must contain the requested transaction.
    +            let ix = block.transaction_by_hash(req).unwrap();
    +
    +            Some((block, ix))
    +        }
    +        .boxed()
    +    }
    +
    +    async fn store<S>(self, storage: &mut NotifyStorage<Types, S>) -> Result<(), S::Error>
    +    where
    +        S: UpdateAvailabilityData<Types> + Send + Sync,
    +    {
    +        storage.block_notifier.notify(&self.0);
    +        storage.storage.insert_block(self.0).await
    +    }
    +
    +    async fn load<S>(storage: &S, req: Self::Request) -> QueryResult<Self>
    +    where
    +        S: AvailabilityStorage<Types>,
    +    {
    +        storage.get_block_with_transaction(req).await
    +    }
    +}
    +
    +/// Break a range into fixed-size chunks.
    +fn range_chunks<R>(range: R) -> impl Iterator<Item = Range<usize>>
    +where
    +    R: RangeBounds<usize>,
    +{
    +    // Transform range to explicit start (inclusive) and end (exclusive) bounds.
    +    let mut start = match range.start_bound() {
    +        Bound::Included(i) => *i,
    +        Bound::Excluded(i) => *i + 1,
    +        Bound::Unbounded => 0,
    +    };
    +    let end = match range.end_bound() {
    +        Bound::Included(i) => *i + 1,
    +        Bound::Excluded(i) => *i,
    +        Bound::Unbounded => usize::MAX,
    +    };
    +    std::iter::from_fn(move || {
    +        let chunk_end = min(start + RANGE_CHUNK_SIZE, end);
    +        if chunk_end == start {
    +            return None;
    +        }
    +
    +        let chunk = start..chunk_end;
    +        start = chunk_end;
    +        Some(chunk)
    +    })
    +}
    +
    +trait ResultExt<T, E> {
    +    fn ok_or_trace(self) -> Option<T>
    +    where
    +        E: Display;
    +}
    +
    +impl<T, E> ResultExt<T, E> for Result<T, E> {
    +    fn ok_or_trace(self) -> Option<T>
    +    where
    +        E: Display,
    +    {
    +        match self {
    +            Ok(t) => Some(t),
    +            Err(err) => {
    +                tracing::warn!("error load resource from local storage, will try to fetch: {err}");
    +                None
    +            }
    +        }
    +    }
    +}
    +
    \ No newline at end of file diff --git a/src/hotshot_query_service/data_source/fs.rs.html b/src/hotshot_query_service/data_source/fs.rs.html index 36e0b989d..f5363fc79 100644 --- a/src/hotshot_query_service/data_source/fs.rs.html +++ b/src/hotshot_query_service/data_source/fs.rs.html @@ -249,387 +249,6 @@ 249 250 251 -252 -253 -254 -255 -256 -257 -258 -259 -260 -261 -262 -263 -264 -265 -266 -267 -268 -269 -270 -271 -272 -273 -274 -275 -276 -277 -278 -279 -280 -281 -282 -283 -284 -285 -286 -287 -288 -289 -290 -291 -292 -293 -294 -295 -296 -297 -298 -299 -300 -301 -302 -303 -304 -305 -306 -307 -308 -309 -310 -311 -312 -313 -314 -315 -316 -317 -318 -319 -320 -321 -322 -323 -324 -325 -326 -327 -328 -329 -330 -331 -332 -333 -334 -335 -336 -337 -338 -339 -340 -341 -342 -343 -344 -345 -346 -347 -348 -349 -350 -351 -352 -353 -354 -355 -356 -357 -358 -359 -360 -361 -362 -363 -364 -365 -366 -367 -368 -369 -370 -371 -372 -373 -374 -375 -376 -377 -378 -379 -380 -381 -382 -383 -384 -385 -386 -387 -388 -389 -390 -391 -392 -393 -394 -395 -396 -397 -398 -399 -400 -401 -402 -403 -404 -405 -406 -407 -408 -409 -410 -411 -412 -413 -414 -415 -416 -417 -418 -419 -420 -421 -422 -423 -424 -425 -426 -427 -428 -429 -430 -431 -432 -433 -434 -435 -436 -437 -438 -439 -440 -441 -442 -443 -444 -445 -446 -447 -448 -449 -450 -451 -452 -453 -454 -455 -456 -457 -458 -459 -460 -461 -462 -463 -464 -465 -466 -467 -468 -469 -470 -471 -472 -473 -474 -475 -476 -477 -478 -479 -480 -481 -482 -483 -484 -485 -486 -487 -488 -489 -490 -491 -492 -493 -494 -495 -496 -497 -498 -499 -500 -501 -502 -503 -504 -505 -506 -507 -508 -509 -510 -511 -512 -513 -514 -515 -516 -517 -518 -519 -520 -521 -522 -523 -524 -525 -526 -527 -528 -529 -530 -531 -532 -533 -534 -535 -536 -537 -538 -539 -540 -541 -542 -543 -544 -545 -546 -547 -548 -549 -550 -551 -552 -553 -554 -555 -556 -557 -558 -559 -560 -561 -562 -563 -564 -565 -566 -567 -568 -569 -570 -571 -572 -573 -574 -575 -576 -577 -578 -579 -580 -581 -582 -583 -584 -585 -586 -587 -588 -589 -590 -591 -592 -593 -594 -595 -596 -597 -598 -599 -600 -601 -602 -603 -604 -605 -606 -607 -608 -609 -610 -611 -612 -613 -614 -615 -616 -617 -618 -619 -620 -621 -622 -623 -624 -625 -626 -627 -628 -629 -630 -631 -632
    // Copyright (c) 2022 Espresso Systems (espressosys.com)
     // This file is part of the HotShot Query Service library.
     //
    @@ -644,45 +263,19 @@
     
     #![cfg(feature = "file-system-data-source")]
     
    -use super::{
    -    ledger_log::{Iter, LedgerLog},
    -    VersionedDataSource,
    -};
    -use crate::{
    -    availability::{
    -        data_source::{
    -            AvailabilityDataSource, BlockId, LeafId, ResourceId, UpdateAvailabilityData,
    -        },
    -        query_data::{
    -            BlockHash, BlockQueryData, LeafHash, LeafQueryData, QueryablePayload, TransactionHash,
    -            TransactionIndex,
    -        },
    -    },
    -    metrics::PrometheusMetrics,
    -    status::data_source::StatusDataSource,
    -    MissingSnafu, NotFoundSnafu, Payload, QueryResult, SignatureKey,
    -};
    -use async_trait::async_trait;
    -use atomic_store::{AtomicStore, AtomicStoreLoader, PersistenceError};
    -use commit::Committable;
    -use futures::stream::{self, BoxStream, Stream, StreamExt, TryStreamExt};
    +use super::{storage::FileSystemStorage, FetchingDataSource};
    +use crate::{availability::query_data::QueryablePayload, Payload};
    +use atomic_store::AtomicStoreLoader;
     use hotshot_types::traits::node_implementation::NodeType;
    -use serde::{de::DeserializeOwned, Serialize};
    -use snafu::OptionExt;
    -use std::collections::hash_map::{Entry, HashMap};
    -use std::hash::Hash;
    -use std::ops::{Bound, RangeBounds};
     use std::path::Path;
     
    -const CACHED_LEAVES_COUNT: usize = 100;
    -const CACHED_BLOCKS_COUNT: usize = 100;
    -
     /// A data source for the APIs provided in this crate, backed by the local file system.
     ///
     /// Synchronization and atomicity of persisted data structures are provided via [`atomic_store`].
    -/// The methods [`commit`](Self::commit), [`revert`](Self::revert), and
    -/// [`skip_version`](Self::skip_version) of this type can be used to control synchronization in the
    -/// underlying [`AtomicStore`].
    +/// The methods [`commit`](super::VersionedDataSource::commit),
    +/// [`revert`](super::VersionedDataSource::revert), and [`skip_version`](Self::skip_version) of this
    +/// type can be used to control synchronization in the underlying
    +/// [`AtomicStore`](atomic_store::AtomicStore).
     ///
     /// # Extension and Composition
     ///
    @@ -696,11 +289,10 @@
     /// wrapping it in [`ExtensibleDataSource`](super::ExtensibleDataSource):
     ///
     /// ```
    -/// # use atomic_store::PersistenceError;
     /// # use hotshot_query_service::data_source::{ExtensibleDataSource, FileSystemDataSource};
     /// # use hotshot_query_service::testing::mocks::MockTypes as AppTypes;
     /// # use std::path::Path;
    -/// # async fn doc(storage_path: &Path) -> Result<(), PersistenceError> {
    +/// # async fn doc(storage_path: &Path) -> Result<(), anyhow::Error> {
     /// type AppState = &'static str;
     ///
     /// let data_source: ExtensibleDataSource<FileSystemDataSource<AppTypes>, AppState> =
    @@ -721,22 +313,25 @@
     /// create an aggregate struct containing both [`FileSystemDataSource`] and your additional module
     /// states. A complication arises from how persistent storage is managed: if other modules have
     /// their own persistent state, should the storage of [`FileSystemDataSource`] and the other modules
    -/// be completely independent, or synchronized under the control of a single [`AtomicStore`]?
    -/// [`FileSystemDataSource`] supports both patterns: when you create it with
    -/// [`create`](Self::create) or [`open`](Self::open), it will open its own [`AtomicStore`] and
    -/// manage the synchronization of its own storage, independent of any other persistent data it might
    -/// be composed with. But when you create it with [`create_with_store`](Self::create_with_store) or
    -/// [`open_with_store`](Self::open_with_store), you may ask it to register its persistent data
    -/// structures with an existing [`AtomicStoreLoader`]. If you register other modules' persistent
    -/// data structures with the same loader, you can create one [`AtomicStore`] that synchronizes all
    -/// the persistent data. Note, though, that when you choose to use
    +/// be completely independent, or synchronized under the control of a single
    +/// [`AtomicStore`](atomic_store::AtomicStore)? [`FileSystemDataSource`] supports both patterns:
    +/// when you create it with [`create`](Self::create) or [`open`](Self::open), it will open its own
    +/// [`AtomicStore`](atomic_store::AtomicStore) and manage the synchronization of its own storage,
    +/// independent of any other persistent data it might be composed with. But when you create it with
    +/// [`create_with_store`](Self::create_with_store) or [`open_with_store`](Self::open_with_store),
    +/// you may ask it to register its persistent data structures with an existing
    +/// [`AtomicStoreLoader`]. If you register other modules' persistent data structures with the same
    +/// loader, you can create one [`AtomicStore`](atomic_store::AtomicStore) that synchronizes all the
    +/// persistent data. Note, though, that when you choose to use
     /// [`create_with_store`](Self::create_with_store) or [`open_with_store`](Self::open_with_store),
    -/// you become responsible for ensuring that calls to [`AtomicStore::commit_version`] alternate with
    -/// calls to [`FileSystemDataSource::commit`] or [`FileSystemDataSource::revert`].
    +/// you become responsible for ensuring that calls to
    +/// [`AtomicStore::commit_version`](atomic_store::AtomicStore::commit_version) alternate with calls
    +/// to [`commit`](super::VersionedDataSource::commit) or
    +/// [`revert`](super::VersionedDataSource::revert).
     ///
     /// In the following example, we compose HotShot query service modules with other application-
    -/// specific modules, using a single top-level [`AtomicStore`] to synchronize all persistent
    -/// storage.
    +/// specific modules, using a single top-level [`AtomicStore`](atomic_store::AtomicStore) to
    +/// synchronize all persistent storage.
     ///
     /// ```
     /// # use async_std::{sync::{Arc, RwLock}, task::spawn};
    @@ -795,21 +390,7 @@
     ///     Ok(app)
     /// }
     /// ```
    -#[derive(custom_debug::Debug)]
    -pub struct FileSystemDataSource<Types: NodeType>
    -where
    -    Payload<Types>: QueryablePayload,
    -{
    -    index_by_leaf_hash: HashMap<LeafHash<Types>, u64>,
    -    index_by_block_hash: HashMap<BlockHash<Types>, u64>,
    -    index_by_txn_hash: HashMap<TransactionHash<Types>, (u64, TransactionIndex<Types>)>,
    -    index_by_proposer_id: HashMap<SignatureKey<Types>, Vec<u64>>,
    -    #[debug(skip)]
    -    top_storage: Option<AtomicStore>,
    -    leaf_storage: LedgerLog<LeafQueryData<Types>>,
    -    block_storage: LedgerLog<BlockQueryData<Types>>,
    -    metrics: PrometheusMetrics,
    -}
    +pub type FileSystemDataSource<Types> = FetchingDataSource<Types, FileSystemStorage<Types>, ()>;
     
     impl<Types: NodeType> FileSystemDataSource<Types>
     where
    @@ -820,24 +401,18 @@
         /// If there is already data at `path`, it will be archived.
         ///
         /// The [FileSystemDataSource] will manage its own persistence synchronization.
    -    pub async fn create(path: &Path) -> Result<Self, PersistenceError> {
    -        let mut loader = AtomicStoreLoader::create(path, "hotshot_data_source")?;
    -        let mut data_source = Self::create_with_store(&mut loader).await?;
    -        data_source.top_storage = Some(AtomicStore::open(loader)?);
    -        Ok(data_source)
    -    }
    +    pub async fn create(path: &Path) -> anyhow::Result<Self> {
    +        FetchingDataSource::new(FileSystemStorage::create(path).await?, ()).await
    +    }
     
         /// Open an existing [FileSystemDataSource] from storage at `path`.
         ///
         /// If there is no data at `path`, a new store will be created.
         ///
         /// The [FileSystemDataSource] will manage its own persistence synchronization.
    -    pub async fn open(path: &Path) -> Result<Self, PersistenceError> {
    -        let mut loader = AtomicStoreLoader::load(path, "hotshot_data_source")?;
    -        let mut data_source = Self::open_with_store(&mut loader).await?;
    -        data_source.top_storage = Some(AtomicStore::open(loader)?);
    -        Ok(data_source)
    -    }
    +    pub async fn open(path: &Path) -> anyhow::Result<Self> {
    +        FetchingDataSource::new(FileSystemStorage::open(path).await?, ()).await
    +    }
     
         /// Create a new [FileSystemDataSource] using a persistent storage loader.
         ///
    @@ -845,28 +420,11 @@
         /// will be archived.
         ///
         /// The [FileSystemDataSource] will register its persistent data structures with `loader`. The
    -    /// caller is responsible for creating an [AtomicStore] from `loader` and managing
    -    /// synchronization of the store.
    -    pub async fn create_with_store(
    -        loader: &mut AtomicStoreLoader,
    -    ) -> Result<Self, PersistenceError> {
    -        let mut ds = Self {
    -            index_by_leaf_hash: Default::default(),
    -            index_by_block_hash: Default::default(),
    -            index_by_txn_hash: Default::default(),
    -            index_by_proposer_id: Default::default(),
    -            top_storage: None,
    -            leaf_storage: LedgerLog::create(loader, "leaves", CACHED_LEAVES_COUNT)?,
    -            block_storage: LedgerLog::create(loader, "blocks", CACHED_BLOCKS_COUNT)?,
    -            metrics: Default::default(),
    -        };
    -
    -        // HotShot doesn't emit an event for the genesis block, so we need to manually ensure it is
    -        // present.
    -        ds.insert_genesis().await?;
    -
    -        Ok(ds)
    -    }
    +    /// caller is responsible for creating an [AtomicStore](atomic_store::AtomicStore) from `loader`
    +    /// and managing synchronization of the store.
    +    pub async fn create_with_store(loader: &mut AtomicStoreLoader) -> anyhow::Result<Self> {
    +        FetchingDataSource::new(FileSystemStorage::create_with_store(loader).await?, ()).await
    +    }
     
         /// Open an existing [FileSystemDataSource] using a persistent storage loader.
         ///
    @@ -874,356 +432,36 @@
         /// new store will be created.
         ///
         /// The [FileSystemDataSource] will register its persistent data structures with `loader`. The
    -    /// caller is responsible for creating an [AtomicStore] from `loader` and managing
    -    /// synchronization of the store.
    -    pub async fn open_with_store(loader: &mut AtomicStoreLoader) -> Result<Self, PersistenceError> {
    -        let leaf_storage =
    -            LedgerLog::<LeafQueryData<Types>>::open(loader, "leaves", CACHED_LEAVES_COUNT)?;
    -        let block_storage =
    -            LedgerLog::<BlockQueryData<Types>>::open(loader, "blocks", CACHED_BLOCKS_COUNT)?;
    -
    -        let mut index_by_proposer_id = HashMap::new();
    -        let mut index_by_block_hash = HashMap::new();
    -        let index_by_leaf_hash = leaf_storage
    -            .iter()
    -            .flatten()
    -            .map(|leaf| {
    -                index_by_proposer_id
    -                    .entry(leaf.proposer())
    -                    .or_insert_with(Vec::new)
    -                    .push(leaf.height());
    -                update_index_by_hash(&mut index_by_block_hash, leaf.block_hash(), leaf.height());
    -                (leaf.hash(), leaf.height())
    -            })
    -            .collect();
    -
    -        let mut index_by_txn_hash = HashMap::new();
    -        for block in block_storage.iter().flatten() {
    -            let height = block.height();
    -            let meta = &block.metadata();
    -            for (txn_ix, txn) in block.payload().enumerate(meta) {
    -                update_index_by_hash(&mut index_by_txn_hash, txn.commit(), (height, txn_ix));
    -            }
    -        }
    -
    -        let mut ds = Self {
    -            index_by_leaf_hash,
    -            index_by_block_hash,
    -            index_by_txn_hash,
    -            index_by_proposer_id,
    -            leaf_storage,
    -            block_storage,
    -            top_storage: None,
    -            metrics: Default::default(),
    -        };
    -
    -        // HotShot doesn't emit an event for the genesis block, so we need to manually ensure it is
    -        // present.
    -        ds.insert_genesis().await?;
    -
    -        Ok(ds)
    -    }
    +    /// caller is responsible for creating an [AtomicStore](atomic_store::AtomicStore) from `loader`
    +    /// and managing synchronization of the store.
    +    pub async fn open_with_store(loader: &mut AtomicStoreLoader) -> anyhow::Result<Self> {
    +        FetchingDataSource::new(FileSystemStorage::open_with_store(loader).await?, ()).await
    +    }
     
         /// Advance the version of the persistent store without committing changes to persistent state.
         ///
    -    /// This function is useful when the [AtomicStore] synchronizing storage for this
    -    /// [FileSystemDataSource] is being managed by the caller. The caller may want to persist some
    -    /// changes to other modules whose state is managed by the same [AtomicStore]. In order to call
    -    /// [AtomicStore::commit_version], the version of this [FileSystemDataSource] must be advanced,
    -    /// either by [commit](Self::commit) or, if there are no outstanding changes,
    +    /// This function is useful when the [AtomicStore](atomic_store::AtomicStore) synchronizing
    +    /// storage for this [FileSystemDataSource] is being managed by the caller. The caller may want
    +    /// to persist some changes to other modules whose state is managed by the same
    +    /// [AtomicStore](atomic_store::AtomicStore). In order to call
    +    /// [AtomicStore::commit_version](atomic_store::AtomicStore::commit_version), the version of
    +    /// this [FileSystemDataSource] must be advanced, either by
    +    /// [commit](super::VersionedDataSource::commit) or, if there are no outstanding changes,
         /// [skip_version](Self::skip_version).
    -    pub fn skip_version(&mut self) -> Result<(), PersistenceError> {
    -        self.leaf_storage.skip_version()?;
    -        self.block_storage.skip_version()?;
    -        if let Some(store) = &mut self.top_storage {
    -            store.commit_version()?;
    -        }
    -        Ok(())
    -    }
    -
    -    async fn insert_genesis(&mut self) -> Result<(), PersistenceError> {
    -        let block_height =
    -            self.block_height()
    -                .await
    -                .map_err(|err| PersistenceError::OtherLoad {
    -                    inner: Box::new(err),
    -                })?;
    -        if block_height == 0 {
    -            self.insert_leaf(LeafQueryData::genesis()).await?;
    -            self.insert_block(BlockQueryData::genesis()).await?;
    -            self.commit().await?;
    -        }
    -        Ok(())
    -    }
    -}
    -
    -#[async_trait]
    -impl<Types: NodeType> VersionedDataSource for FileSystemDataSource<Types>
    -where
    -    Payload<Types>: QueryablePayload,
    -{
    -    type Error = PersistenceError;
    -
    -    /// Commit the current state to persistent storage.
    -    ///
    -    /// If the [FileSystemDataSource] is managing its own [AtomicStore] (i.e. it was created with
    -    /// [create](Self::create) or [open](Self::open)) it will update the global version as well.
    -    /// Otherwise, the caller is responsible for calling [AtomicStore::commit_version] after calling
    -    /// this function.
    -    async fn commit(&mut self) -> Result<(), PersistenceError> {
    -        self.leaf_storage.commit_version().await?;
    -        self.block_storage.commit_version().await?;
    -        if let Some(store) = &mut self.top_storage {
    -            store.commit_version()?;
    -        }
    -        Ok(())
    -    }
    -
    -    /// Revert changes made to persistent storage since the last call to
    -    /// [commit](Self::commit).
    -    async fn revert(&mut self) {
    -        self.leaf_storage.revert_version().unwrap();
    -        self.block_storage.revert_version().unwrap();
    -    }
    -}
    -
    -async fn range_stream<T>(
    -    mut iter: Iter<'_, T>,
    -    range: impl RangeBounds<usize>,
    -) -> impl '_ + Stream<Item = QueryResult<T>>
    -where
    -    T: Clone + Serialize + DeserializeOwned + Sync,
    -{
    -    let start = range.start_bound().cloned();
    -    let end = range.end_bound().cloned();
    -
    -    // Advance the underlying iterator to the start of the range.
    -    let pos = match start {
    -        Bound::Included(n) => {
    -            if n > 0 {
    -                iter.nth(n - 1);
    -            }
    -            n
    -        }
    -        Bound::Excluded(n) => {
    -            iter.nth(n);
    -            n + 1
    -        }
    -        Bound::Unbounded => 0,
    -    };
    -
    -    stream::unfold((iter, end, pos), |(mut iter, end, pos)| async move {
    -        // Check if we have reached the end of the range.
    -        let reached_end = match end {
    -            Bound::Included(n) => pos > n,
    -            Bound::Excluded(n) => pos >= n,
    -            Bound::Unbounded => false,
    -        };
    -        if reached_end {
    -            return None;
    -        }
    -        let opt = iter.next()?;
    -        Some((opt.context(MissingSnafu), (iter, end, pos + 1)))
    -    })
    -}
    -
    -#[async_trait]
    -impl<Types: NodeType> AvailabilityDataSource<Types> for FileSystemDataSource<Types>
    -where
    -    Payload<Types>: QueryablePayload,
    -{
    -    type LeafStream = BoxStream<'static, QueryResult<LeafQueryData<Types>>>;
    -    type BlockStream = BoxStream<'static, QueryResult<BlockQueryData<Types>>>;
    -
    -    type LeafRange<'a, R> = BoxStream<'a, QueryResult<LeafQueryData<Types>>>
    -    where
    -        Self: 'a,
    -        R: RangeBounds<usize> + Send;
    -    type BlockRange<'a, R> = BoxStream<'a, QueryResult<BlockQueryData<Types>>>
    -    where
    -        Self: 'a,
    -        R: RangeBounds<usize> + Send;
    -
    -    async fn get_leaf<ID>(&self, id: ID) -> QueryResult<LeafQueryData<Types>>
    -    where
    -        ID: Into<LeafId<Types>> + Send + Sync,
    -    {
    -        let n = match id.into() {
    -            ResourceId::Number(n) => n,
    -            ResourceId::Hash(h) => {
    -                *self.index_by_leaf_hash.get(&h).context(NotFoundSnafu)? as usize
    -            }
    -        };
    -        self.leaf_storage
    -            .iter()
    -            .nth(n)
    -            .context(NotFoundSnafu)?
    -            .context(MissingSnafu)
    -    }
    -
    -    async fn get_block<ID>(&self, id: ID) -> QueryResult<BlockQueryData<Types>>
    -    where
    -        ID: Into<BlockId<Types>> + Send + Sync,
    -    {
    -        let n = match id.into() {
    -            ResourceId::Number(n) => n,
    -            ResourceId::Hash(h) => {
    -                *self.index_by_block_hash.get(&h).context(NotFoundSnafu)? as usize
    -            }
    -        };
    -        self.block_storage
    -            .iter()
    -            .nth(n)
    -            .context(NotFoundSnafu)?
    -            .context(MissingSnafu)
    -    }
    -
    -    async fn get_leaf_range<R>(&self, range: R) -> QueryResult<Self::LeafRange<'_, R>>
    -    where
    -        R: RangeBounds<usize> + Send,
    -    {
    -        Ok(range_stream(self.leaf_storage.iter(), range).await.boxed())
    -    }
    -
    -    async fn get_block_range<R>(&self, range: R) -> QueryResult<Self::BlockRange<'_, R>>
    -    where
    -        R: RangeBounds<usize> + Send,
    -    {
    -        Ok(range_stream(self.block_storage.iter(), range).await.boxed())
    -    }
    -
    -    async fn get_block_with_transaction(
    -        &self,
    -        hash: TransactionHash<Types>,
    -    ) -> QueryResult<(BlockQueryData<Types>, TransactionIndex<Types>)> {
    -        let (height, ix) = self.index_by_txn_hash.get(&hash).context(NotFoundSnafu)?;
    -        let block = self.get_block(*height as usize).await?;
    -        Ok((block, ix.clone()))
    -    }
    -
    -    async fn get_proposals(
    -        &self,
    -        id: &SignatureKey<Types>,
    -        limit: Option<usize>,
    -    ) -> QueryResult<Vec<LeafQueryData<Types>>> {
    -        let all_ids = self
    -            .index_by_proposer_id
    -            .get(id)
    -            .cloned()
    -            .unwrap_or_default();
    -        let start_from = match limit {
    -            Some(count) => all_ids.len().saturating_sub(count),
    -            None => 0,
    -        };
    -        stream::iter(all_ids)
    -            .skip(start_from)
    -            .then(|height| self.get_leaf(height as usize))
    -            .try_collect()
    -            .await
    -    }
    -
    -    async fn count_proposals(&self, id: &SignatureKey<Types>) -> QueryResult<usize> {
    -        Ok(match self.index_by_proposer_id.get(id) {
    -            Some(ids) => ids.len(),
    -            None => 0,
    -        })
    -    }
    -
    -    async fn subscribe_leaves(&self, height: usize) -> QueryResult<Self::LeafStream> {
    -        Ok(self
    -            .leaf_storage
    -            .subscribe(height)
    -            .context(MissingSnafu)?
    -            .map(Ok)
    -            .boxed())
    -    }
    -
    -    async fn subscribe_blocks(&self, height: usize) -> QueryResult<Self::BlockStream> {
    -        Ok(self
    -            .block_storage
    -            .subscribe(height)
    -            .context(MissingSnafu)?
    -            .map(Ok)
    -            .boxed())
    -    }
    -}
    -
    -#[async_trait]
    -impl<Types: NodeType> UpdateAvailabilityData<Types> for FileSystemDataSource<Types>
    -where
    -    Payload<Types>: QueryablePayload,
    -{
    -    type Error = PersistenceError;
    -
    -    async fn insert_leaf(&mut self, leaf: LeafQueryData<Types>) -> Result<(), Self::Error> {
    -        self.leaf_storage
    -            .insert(leaf.height() as usize, leaf.clone())?;
    -        self.index_by_leaf_hash.insert(leaf.hash(), leaf.height());
    -        update_index_by_hash(
    -            &mut self.index_by_block_hash,
    -            leaf.block_hash(),
    -            leaf.height(),
    -        );
    -        self.index_by_proposer_id
    -            .entry(leaf.proposer())
    -            .or_default()
    -            .push(leaf.height());
    +    pub async fn skip_version(&mut self) -> anyhow::Result<()> {
    +        self.storage_mut().await.skip_version()?;
             Ok(())
         }
    -
    -    async fn insert_block(&mut self, block: BlockQueryData<Types>) -> Result<(), Self::Error> {
    -        self.block_storage
    -            .insert(block.height() as usize, block.clone())?;
    -        for (txn_ix, txn) in block.enumerate() {
    -            update_index_by_hash(
    -                &mut self.index_by_txn_hash,
    -                txn.commit(),
    -                (block.height(), txn_ix),
    -            );
    -        }
    -        Ok(())
    -    }
    -}
    -
    -/// Update an index mapping hashes of objects to their positions in the ledger.
    -///
    -/// This function will insert the mapping from `hash` to `pos` into `index`, _unless_ there is
    -/// already an entry for `hash` at an earlier position in the ledger.
    -fn update_index_by_hash<H: Eq + Hash, P: Ord>(index: &mut HashMap<H, P>, hash: H, pos: P) {
    -    match index.entry(hash) {
    -        Entry::Occupied(mut e) => {
    -            if &pos < e.get() {
    -                // Overwrite the existing entry if the new object was sequenced first.
    -                e.insert(pos);
    -            }
    -        }
    -        Entry::Vacant(e) => {
    -            e.insert(pos);
    -        }
    -    }
    -}
    -
    -#[async_trait]
    -impl<Types: NodeType> StatusDataSource for FileSystemDataSource<Types>
    -where
    -    Payload<Types>: QueryablePayload,
    -{
    -    async fn block_height(&self) -> QueryResult<usize> {
    -        Ok(self.leaf_storage.iter().len())
    -    }
    -
    -    fn metrics(&self) -> &PrometheusMetrics {
    -        &self.metrics
    -    }
     }
     
     #[cfg(any(test, feature = "testing"))]
     mod impl_testable_data_source {
         use super::*;
         use crate::{
    -        data_source::UpdateDataSource,
    +        data_source::{UpdateDataSource, VersionedDataSource},
             testing::mocks::{DataSourceLifeCycle, MockTypes},
         };
    +    use async_trait::async_trait;
         use hotshot::types::Event;
         use tempdir::TempDir;
     
    diff --git a/src/hotshot_query_service/data_source/notifier.rs.html b/src/hotshot_query_service/data_source/notifier.rs.html
    new file mode 100644
    index 000000000..2f60ce6f4
    --- /dev/null
    +++ b/src/hotshot_query_service/data_source/notifier.rs.html
    @@ -0,0 +1,737 @@
    +notifier.rs - source
    1
    +2
    +3
    +4
    +5
    +6
    +7
    +8
    +9
    +10
    +11
    +12
    +13
    +14
    +15
    +16
    +17
    +18
    +19
    +20
    +21
    +22
    +23
    +24
    +25
    +26
    +27
    +28
    +29
    +30
    +31
    +32
    +33
    +34
    +35
    +36
    +37
    +38
    +39
    +40
    +41
    +42
    +43
    +44
    +45
    +46
    +47
    +48
    +49
    +50
    +51
    +52
    +53
    +54
    +55
    +56
    +57
    +58
    +59
    +60
    +61
    +62
    +63
    +64
    +65
    +66
    +67
    +68
    +69
    +70
    +71
    +72
    +73
    +74
    +75
    +76
    +77
    +78
    +79
    +80
    +81
    +82
    +83
    +84
    +85
    +86
    +87
    +88
    +89
    +90
    +91
    +92
    +93
    +94
    +95
    +96
    +97
    +98
    +99
    +100
    +101
    +102
    +103
    +104
    +105
    +106
    +107
    +108
    +109
    +110
    +111
    +112
    +113
    +114
    +115
    +116
    +117
    +118
    +119
    +120
    +121
    +122
    +123
    +124
    +125
    +126
    +127
    +128
    +129
    +130
    +131
    +132
    +133
    +134
    +135
    +136
    +137
    +138
    +139
    +140
    +141
    +142
    +143
    +144
    +145
    +146
    +147
    +148
    +149
    +150
    +151
    +152
    +153
    +154
    +155
    +156
    +157
    +158
    +159
    +160
    +161
    +162
    +163
    +164
    +165
    +166
    +167
    +168
    +169
    +170
    +171
    +172
    +173
    +174
    +175
    +176
    +177
    +178
    +179
    +180
    +181
    +182
    +183
    +184
    +185
    +186
    +187
    +188
    +189
    +190
    +191
    +192
    +193
    +194
    +195
    +196
    +197
    +198
    +199
    +200
    +201
    +202
    +203
    +204
    +205
    +206
    +207
    +208
    +209
    +210
    +211
    +212
    +213
    +214
    +215
    +216
    +217
    +218
    +219
    +220
    +221
    +222
    +223
    +224
    +225
    +226
    +227
    +228
    +229
    +230
    +231
    +232
    +233
    +234
    +235
    +236
    +237
    +238
    +239
    +240
    +241
    +242
    +243
    +244
    +245
    +246
    +247
    +248
    +249
    +250
    +251
    +252
    +253
    +254
    +255
    +256
    +257
    +258
    +259
    +260
    +261
    +262
    +263
    +264
    +265
    +266
    +267
    +268
    +269
    +270
    +271
    +272
    +273
    +274
    +275
    +276
    +277
    +278
    +279
    +280
    +281
    +282
    +283
    +284
    +285
    +286
    +287
    +288
    +289
    +290
    +291
    +292
    +293
    +294
    +295
    +296
    +297
    +298
    +299
    +300
    +301
    +302
    +303
    +304
    +305
    +306
    +307
    +308
    +309
    +310
    +311
    +312
    +313
    +314
    +315
    +316
    +317
    +318
    +319
    +320
    +321
    +322
    +323
    +324
    +325
    +326
    +327
    +328
    +329
    +330
    +331
    +332
    +333
    +334
    +335
    +336
    +337
    +338
    +339
    +340
    +341
    +342
    +343
    +344
    +345
    +346
    +347
    +348
    +349
    +350
    +351
    +352
    +353
    +354
    +355
    +356
    +357
    +358
    +359
    +360
    +361
    +362
    +363
    +364
    +365
    +366
    +367
    +368
    +
    // Copyright (c) 2022 Espresso Systems (espressosys.com)
    +// This file is part of the HotShot Query Service library.
    +//
    +// This program is free software: you can redistribute it and/or modify it under the terms of the GNU
    +// General Public License as published by the Free Software Foundation, either version 3 of the
    +// License, or (at your option) any later version.
    +// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
    +// even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    +// General Public License for more details.
    +// You should have received a copy of the GNU General Public License along with this program. If not,
    +// see <https://www.gnu.org/licenses/>.
    +
    +//! Multi-producer, multi-consumer oneshot notification channel
    +//!
    +//! [`Notifier`] is an asynchronous, multi-producer, multi-consumer, oneshot channel satisfying
    +//! three additional requirements:
    +//! 1. Dropped receivers do not consume resources.
    +//! 2. Messages are not copied for receivers who don't want them.
    +//! 3. Minimal resource contention for concurrent subscriptions.
    +//!
    +//! ## Dropped receivers do not consume resources
    +//!
    +//! This requirement is a direct prerequisite of the broader requirement that passive requests for
    +//! resources do not consume resources. This is important because in general, passive requests may
    +//! be for resources that are not guaranteed to exist, and thus may never terminate. Just like we
    +//! avoid spawning a task for passive requests, since it may never complete, we need receivers for
    +//! passive requests not to persist beyond the lifetime of the requst, or they may never be closed.
    +//!
    +//! This requirement is implemented via garbage collection: each time a message is sent, resources
    +//! belonging to dropped receivers are cleaned up. Thus, strictly speaking, dropped receivers do
    +//! consume resources, but only briefly. There is no need to keep them around until the desired
    +//! message is delivered, for example.
    +//!
    +//! ## Messages are not copied for receivers who don't want them.
    +//!
    +//! The second requirement simplifies the higher level fetching logic by allowing us to maintain a
    +//! single channel for all notifications about a particular resource type, rather than separate
    +//! channels for each specific request. Since messages are not copied for all subscribers, but only
    +//! for the subscribers interested in a particular message, this simplification becomes nearly
    +//! cost-free.
    +//!
    +//! This requirement is implemented by attaching a predicate to each subscription, which takes a
    +//! message by reference. The predicate is checked on the sending side, and the message is only
    +//! copied to the subscription if the predicate is satisfied.
    +//!
    +//! ## Minimal resource contention for concurrent subscriptions.
    +//!
    +//! This is important because subscriptions are requested in response to read-only client requests,
    +//! which are supposed to run in parallel as much as possible. By contrast, notifications are
    +//! ususally send from internal server tasks (e.g. the background task that updates the data source
    +//! when new blocks are committed). It is less of a problem if these internal tasks contend with
    +//! each other, because they are not directly blocking responses to clients, and we have more
    +//! control over how and when they acquire shared resources.
    +//!
    +//! This requirement also empowers us to create a simpler design for the high-level fetching logic.
    +//! Specifically, we can reuse the same code for fetching individual resources as we use for
    +//! long-lived subscription streams (e.g. `subscribe_blocks` is a thin wrapper around
    +//! `get_block_range`). We do not have to worry about adding complex logic to reuse notification
    +//! subscriptions for long-lived streams, because subscribing anew for each entry in the stream has
    +//! low overhead in terms of contention over shared resources -- the dominant caused in any
    +//! concurrent channel, after data copying (see above).
    +//!
    +//! This further lets us simplify the interface of this channel a bit: since all notifications are
    +//! oneshot, consumers deal with futures rather than streams.
    +//!
    +//! This requirement is satisfied by maintaining the list of subscribers to a [`Notifier`] in a way
    +//! that moves most resource contention to message senders, rather than receivers. We make the
    +//! assumption that there is less concurrency among senders. In the common case, there is just one
    +//! sender: the task monitoring HotShot for new blocks. Occasionally, there may be other tasks
    +//! spawned to fetch missing resources and send them through the [`Notifier`], but these should be
    +//! relatively few and rare.
    +
    +use async_compatibility_layer::channel::{
    +    oneshot, unbounded, OneShotReceiver, OneShotSender, UnboundedReceiver, UnboundedSender,
    +};
    +use async_std::sync::Arc;
    +use derivative::Derivative;
    +use futures::future::{BoxFuture, FutureExt};
    +use std::{
    +    future::IntoFuture,
    +    sync::atomic::{AtomicBool, Ordering},
    +};
    +
    +/// A predicate on a type `<T>`.
    +///
    +/// [`Predicate`] is an alias for any type implementing `Fn(&T) -> bool` (with a few extra bounds
    +/// to support concurrency). It is used by [`Notifier`] to represent the preferences of subscribers
    +/// when filtering messages of type `T`.
    +pub trait Predicate<T>: 'static + Send + Sync + Fn(&T) -> bool {}
    +impl<F, T> Predicate<T> for F where F: 'static + Send + Sync + Fn(&T) -> bool {}
    +
    +#[derive(Derivative)]
    +#[derivative(Debug)]
    +struct Subscriber<T> {
    +    #[derivative(Debug = "ignore")]
    +    predicate: Box<dyn Predicate<T>>,
    +    #[derivative(Debug = "ignore")]
    +    sender: Option<OneShotSender<T>>,
    +    closed: Arc<AtomicBool>,
    +}
    +
    +impl<T> Subscriber<T> {
    +    fn is_closed(&self) -> bool {
    +        // A subscriber can be closed because it has already been notified, which `take`s the
    +        // oneshot sender.
    +        self.sender.is_none() ||
    +        // Or because it was explicitly closed by its receiver (e.g. the receiver was dropped)
    +        self.closed.load(Ordering::Relaxed)
    +    }
    +}
    +
    +impl<T: Clone> Subscriber<T> {
    +    fn notify(&mut self, msg: &T) {
    +        // First, check if the subscriber has been closed. If it has, we can skip it and save the
    +        // work of evaluating the predicate.
    +        if self.is_closed() {
    +            return;
    +        }
    +        // At this point, it is likely, but not guaranteed, that the subscriber is not closed.
    +        // It may have been closed the instant after the check above. However, it is harmless to
    +        // evaluate the predicate now; at worst we waste a bit of computation.
    +        if !(self.predicate)(msg) {
    +            return;
    +        }
    +        // Now we are committed to sending the message to this subscriber if possible. We can take
    +        // the sender. We need to check for closed again in case the subscriber was closed since the
    +        // previous check.
    +        if let Some(sender) = self.sender.take() {
    +            sender.send(msg.clone());
    +        }
    +    }
    +}
    +
    +/// Multi-producer, multi-consumer oneshot notification channel
    +#[derive(Derivative)]
    +#[derivative(Debug)]
    +pub struct Notifier<T> {
    +    // Active subscribers.
    +    active: Vec<Subscriber<T>>,
    +    // Pending subscribers.
    +    //
    +    // When a new subscriber joins the subscriber set, they do not immediately add themselves to
    +    // `active`. Instead, they simply send themselves to this channel. Every time a message is
    +    // sent, it will drain pending subscribers from here and add them to `active`. In this way,
    +    // almost all of the cost is paid by senders, rather than receivers. We adopt this design for
    +    // two reasons:
    +    // 1. Most basically, more messages are received than sent, since the intended use of this
    +    //    channel is broadcast, with each message being delivered to multiple receivers. Thus,
    +    //    moving cost from receivers to senders is always good.
    +    // 2. This channel is intended to be highly concurrent, and `active` is a shared resource that
    +    //    is ripe for contention. With this design, _only_ sends contend for a lock on the
    +    //    subscribers list, but new subscriptions do not. Again, since there are often more
    +    //    receivers than senders, this can reduce contention significantly.
    +    // Consider the example use case of `Fetcher::fetching_stream`. This design of the notification
    +    // channel lets us go with a very simple design of fetching stream, where we fetch each
    +    // subsequent entry individually, with a one-shot notification future. This pattern leads to
    +    // many concurrent subscription requests: each time a new entry is produced, every open stream
    +    // will subscribe anew to notifications for the next entry, at the same time. However, these
    +    // concurrent subscriptions go through the high-throughput multi-producer stream implementation,
    +    // and do not contend for the lock on `FilterSender::subscribers`.
    +    #[derivative(Debug = "ignore")]
    +    pending: UnboundedReceiver<Subscriber<T>>,
    +    #[derivative(Debug = "ignore")]
    +    subscribe: UnboundedSender<Subscriber<T>>,
    +}
    +
    +impl<T> Notifier<T> {
    +    pub fn new() -> Self {
    +        let (subscribe, pending) = unbounded();
    +        Self {
    +            active: vec![],
    +            pending,
    +            subscribe,
    +        }
    +    }
    +}
    +
    +impl<T: Clone> Notifier<T> {
    +    /// Notify all subscribers whose predicate is satisfied by `msg`.
    +    pub fn notify(&mut self, msg: &T) {
    +        // Try sending the message to each active subscriber.
    +        for subscriber in &mut self.active {
    +            subscriber.notify(msg);
    +        }
    +
    +        // Some subscribers may be closed, either because the receiver was dropped or because we
    +        // just sent it its message. Remove these from the `active` list.
    +        self.active.retain(|subscriber| !subscriber.is_closed());
    +
    +        // Promote pending subscribers to active and send them the message.
    +        for mut subscriber in self.pending.drain().unwrap_or_default() {
    +            subscriber.notify(msg);
    +            if !subscriber.is_closed() {
    +                // If that message didn't satisfy the subscriber, or it was dropped, at it to the
    +                // active list so it will get future messages.
    +                self.active.push(subscriber);
    +            }
    +        }
    +    }
    +}
    +
    +impl<T> Notifier<T> {
    +    /// Wait for a message satisfying `predicate`.
    +    pub async fn wait_for(&self, predicate: impl Predicate<T>) -> WaitFor<T> {
    +        // Create a oneshot channel for receiving the notification.
    +        let (sender, receiver) = oneshot();
    +        let sender = Some(sender);
    +        let closed = Arc::new(AtomicBool::new(false));
    +
    +        // Create a handle which will close the subscription when dropped.
    +        let handle = ReceiveHandle {
    +            closed: closed.clone(),
    +        };
    +
    +        // Create a subscriber with our predicate and the oneshot channel.
    +        let subscriber = Subscriber {
    +            predicate: Box::new(predicate),
    +            sender,
    +            closed,
    +        };
    +
    +        // Add the subscriber to the channel and return it. We can ignore errors here: `send` only
    +        // fails when the receive end of the channel has been dropped, which means the notifier has
    +        // been dropped, and thus the send end of the oneshot handle has been dropped. The caller
    +        // will discover this when they try to await a notification and get [`None`].
    +        self.subscribe.send(subscriber).await.ok();
    +        WaitFor { handle, receiver }
    +    }
    +}
    +
    +/// A handle that closes a subscriber when dropped.
    +struct ReceiveHandle {
    +    closed: Arc<AtomicBool>,
    +}
    +
    +impl Drop for ReceiveHandle {
    +    fn drop(&mut self) {
    +        self.closed.store(true, Ordering::Relaxed);
    +    }
    +}
    +
    +/// A pending request for notification.
    +///
    +/// This object can be `await`ed to block until the requested notification arrives. The result is an
    +/// `Option<T>`, which is [`Some`] except in the case that the [`Notifier`] was dropped without ever
    +/// sending a satisfying message.
    +///
    +/// If [`WaitFor`] is dropped before a notification is delivered, it will automatically clean up its
    +/// resources in the [`Notifier`].
    +pub struct WaitFor<T> {
    +    handle: ReceiveHandle,
    +    receiver: OneShotReceiver<T>,
    +}
    +
    +impl<T> IntoFuture for WaitFor<T>
    +where
    +    T: Send + 'static,
    +{
    +    type Output = Option<T>;
    +    type IntoFuture = BoxFuture<'static, Self::Output>;
    +
    +    fn into_future(self) -> Self::IntoFuture {
    +        async move {
    +            let res = self.receiver.recv().await.ok();
    +
    +            // Explicitly drop `handle` _after_ we're done with `receiver`. If the compiler decides
    +            // that it can drop `handle` earlier, we might never get a notification.
    +            drop(self.handle);
    +
    +            res
    +        }
    +        .boxed()
    +    }
    +}
    +
    +#[cfg(test)]
    +mod test {
    +    use super::*;
    +    use crate::testing::setup_test;
    +    use async_std::future::timeout;
    +    use std::time::Duration;
    +
    +    #[async_std::test]
    +    async fn test_notify_drop() {
    +        setup_test();
    +        let mut n = Notifier::new();
    +
    +        // Create two subscribers with different predicates.
    +        let wait_for_zero = n.wait_for(|i| *i == 0).await;
    +        let wait_for_one = n.wait_for(|i| *i == 1).await;
    +
    +        // Send a message which satisfies only one of the subscribers.
    +        n.notify(&0);
    +        assert_eq!(wait_for_zero.await.unwrap(), 0);
    +
    +        // Check that the other subscriber was not notified.
    +        timeout(Duration::from_secs(1), wait_for_one.into_future())
    +            .await
    +            .unwrap_err();
    +
    +        // Check subscribers. The first subsciber should have been cleaned up when it was notified.
    +        // The second should have been closed when it was dropped without completing, but not yet
    +        // garbage collected.
    +        assert_eq!(n.active.len(), 1);
    +        assert!(n.active[0].is_closed());
    +    }
    +
    +    #[async_std::test]
    +    async fn test_notify_active() {
    +        setup_test();
    +        let mut n = Notifier::new();
    +
    +        // Create two subscribers.
    +        let s1 = n.wait_for(|i| *i == 1).await;
    +        let s2 = n.wait_for(|i| *i == 1).await;
    +
    +        // Send a message that doesn't notify either subscriber, but just promotes them from pending
    +        // to active.
    +        n.notify(&0);
    +        // Check active subscribers.
    +        assert_eq!(n.active.len(), 2);
    +        assert!(!n.active[0].is_closed());
    +        assert!(!n.active[1].is_closed());
    +
    +        // Drop one of the subscribers, then send another non-satisfying message. This should cause
    +        // the dropped subscriber to get garbage collected.
    +        drop(s2);
    +        n.notify(&0);
    +        assert_eq!(n.active.len(), 1);
    +        assert!(!n.active[0].is_closed());
    +
    +        // Satisfy the final subscriber.
    +        n.notify(&1);
    +        assert_eq!(s1.await.unwrap(), 1);
    +    }
    +
    +    #[async_std::test]
    +    async fn test_pending_dropped() {
    +        setup_test();
    +        let mut n = Notifier::new();
    +
    +        // Create and immediately drop a pending subscriber.
    +        drop(n.wait_for(|_| false).await);
    +
    +        // Check that the subscriber gets garbage collected on the next notification.
    +        n.notify(&0);
    +        assert_eq!(n.active.len(), 0);
    +    }
    +
    +    #[async_std::test]
    +    async fn test_notifier_dropped() {
    +        setup_test();
    +
    +        let mut n = Notifier::new();
    +
    +        // Create an active subscriber.
    +        let fut1 = n.wait_for(|_| false).await;
    +        n.notify(&0);
    +
    +        // Create a pending subscriber.
    +        let fut2 = n.wait_for(|_| false).await;
    +
    +        // Drop the notifier while both kinds of subscribers are blocked.
    +        drop(n);
    +        assert_eq!(fut1.await, None);
    +        assert_eq!(fut2.await, None);
    +    }
    +}
    +
    \ No newline at end of file diff --git a/src/hotshot_query_service/data_source/sql.rs.html b/src/hotshot_query_service/data_source/sql.rs.html index 8c8426c91..630fb87cf 100644 --- a/src/hotshot_query_service/data_source/sql.rs.html +++ b/src/hotshot_query_service/data_source/sql.rs.html @@ -388,1266 +388,6 @@ 388 389 390 -391 -392 -393 -394 -395 -396 -397 -398 -399 -400 -401 -402 -403 -404 -405 -406 -407 -408 -409 -410 -411 -412 -413 -414 -415 -416 -417 -418 -419 -420 -421 -422 -423 -424 -425 -426 -427 -428 -429 -430 -431 -432 -433 -434 -435 -436 -437 -438 -439 -440 -441 -442 -443 -444 -445 -446 -447 -448 -449 -450 -451 -452 -453 -454 -455 -456 -457 -458 -459 -460 -461 -462 -463 -464 -465 -466 -467 -468 -469 -470 -471 -472 -473 -474 -475 -476 -477 -478 -479 -480 -481 -482 -483 -484 -485 -486 -487 -488 -489 -490 -491 -492 -493 -494 -495 -496 -497 -498 -499 -500 -501 -502 -503 -504 -505 -506 -507 -508 -509 -510 -511 -512 -513 -514 -515 -516 -517 -518 -519 -520 -521 -522 -523 -524 -525 -526 -527 -528 -529 -530 -531 -532 -533 -534 -535 -536 -537 -538 -539 -540 -541 -542 -543 -544 -545 -546 -547 -548 -549 -550 -551 -552 -553 -554 -555 -556 -557 -558 -559 -560 -561 -562 -563 -564 -565 -566 -567 -568 -569 -570 -571 -572 -573 -574 -575 -576 -577 -578 -579 -580 -581 -582 -583 -584 -585 -586 -587 -588 -589 -590 -591 -592 -593 -594 -595 -596 -597 -598 -599 -600 -601 -602 -603 -604 -605 -606 -607 -608 -609 -610 -611 -612 -613 -614 -615 -616 -617 -618 -619 -620 -621 -622 -623 -624 -625 -626 -627 -628 -629 -630 -631 -632 -633 -634 -635 -636 -637 -638 -639 -640 -641 -642 -643 -644 -645 -646 -647 -648 -649 -650 -651 -652 -653 -654 -655 -656 -657 -658 -659 -660 -661 -662 -663 -664 -665 -666 -667 -668 -669 -670 -671 -672 -673 -674 -675 -676 -677 -678 -679 -680 -681 -682 -683 -684 -685 -686 -687 -688 -689 -690 -691 -692 -693 -694 -695 -696 -697 -698 -699 -700 -701 -702 -703 -704 -705 -706 -707 -708 -709 -710 -711 -712 -713 -714 -715 -716 -717 -718 -719 -720 -721 -722 -723 -724 -725 -726 -727 -728 -729 -730 -731 -732 -733 -734 -735 -736 -737 -738 -739 -740 -741 -742 -743 -744 -745 -746 -747 -748 -749 -750 -751 -752 -753 -754 -755 -756 -757 -758 -759 -760 -761 -762 -763 -764 -765 -766 -767 -768 -769 -770 -771 -772 -773 -774 -775 -776 -777 -778 -779 -780 -781 -782 -783 -784 -785 -786 -787 -788 -789 -790 -791 -792 -793 -794 -795 -796 -797 -798 -799 -800 -801 -802 -803 -804 -805 -806 -807 -808 -809 -810 -811 -812 -813 -814 -815 -816 -817 -818 -819 -820 -821 -822 -823 -824 -825 -826 -827 -828 -829 -830 -831 -832 -833 -834 -835 -836 -837 -838 -839 -840 -841 -842 -843 -844 -845 -846 -847 -848 -849 -850 -851 -852 -853 -854 -855 -856 -857 -858 -859 -860 -861 -862 -863 -864 -865 -866 -867 -868 -869 -870 -871 -872 -873 -874 -875 -876 -877 -878 -879 -880 -881 -882 -883 -884 -885 -886 -887 -888 -889 -890 -891 -892 -893 -894 -895 -896 -897 -898 -899 -900 -901 -902 -903 -904 -905 -906 -907 -908 -909 -910 -911 -912 -913 -914 -915 -916 -917 -918 -919 -920 -921 -922 -923 -924 -925 -926 -927 -928 -929 -930 -931 -932 -933 -934 -935 -936 -937 -938 -939 -940 -941 -942 -943 -944 -945 -946 -947 -948 -949 -950 -951 -952 -953 -954 -955 -956 -957 -958 -959 -960 -961 -962 -963 -964 -965 -966 -967 -968 -969 -970 -971 -972 -973 -974 -975 -976 -977 -978 -979 -980 -981 -982 -983 -984 -985 -986 -987 -988 -989 -990 -991 -992 -993 -994 -995 -996 -997 -998 -999 -1000 -1001 -1002 -1003 -1004 -1005 -1006 -1007 -1008 -1009 -1010 -1011 -1012 -1013 -1014 -1015 -1016 -1017 -1018 -1019 -1020 -1021 -1022 -1023 -1024 -1025 -1026 -1027 -1028 -1029 -1030 -1031 -1032 -1033 -1034 -1035 -1036 -1037 -1038 -1039 -1040 -1041 -1042 -1043 -1044 -1045 -1046 -1047 -1048 -1049 -1050 -1051 -1052 -1053 -1054 -1055 -1056 -1057 -1058 -1059 -1060 -1061 -1062 -1063 -1064 -1065 -1066 -1067 -1068 -1069 -1070 -1071 -1072 -1073 -1074 -1075 -1076 -1077 -1078 -1079 -1080 -1081 -1082 -1083 -1084 -1085 -1086 -1087 -1088 -1089 -1090 -1091 -1092 -1093 -1094 -1095 -1096 -1097 -1098 -1099 -1100 -1101 -1102 -1103 -1104 -1105 -1106 -1107 -1108 -1109 -1110 -1111 -1112 -1113 -1114 -1115 -1116 -1117 -1118 -1119 -1120 -1121 -1122 -1123 -1124 -1125 -1126 -1127 -1128 -1129 -1130 -1131 -1132 -1133 -1134 -1135 -1136 -1137 -1138 -1139 -1140 -1141 -1142 -1143 -1144 -1145 -1146 -1147 -1148 -1149 -1150 -1151 -1152 -1153 -1154 -1155 -1156 -1157 -1158 -1159 -1160 -1161 -1162 -1163 -1164 -1165 -1166 -1167 -1168 -1169 -1170 -1171 -1172 -1173 -1174 -1175 -1176 -1177 -1178 -1179 -1180 -1181 -1182 -1183 -1184 -1185 -1186 -1187 -1188 -1189 -1190 -1191 -1192 -1193 -1194 -1195 -1196 -1197 -1198 -1199 -1200 -1201 -1202 -1203 -1204 -1205 -1206 -1207 -1208 -1209 -1210 -1211 -1212 -1213 -1214 -1215 -1216 -1217 -1218 -1219 -1220 -1221 -1222 -1223 -1224 -1225 -1226 -1227 -1228 -1229 -1230 -1231 -1232 -1233 -1234 -1235 -1236 -1237 -1238 -1239 -1240 -1241 -1242 -1243 -1244 -1245 -1246 -1247 -1248 -1249 -1250 -1251 -1252 -1253 -1254 -1255 -1256 -1257 -1258 -1259 -1260 -1261 -1262 -1263 -1264 -1265 -1266 -1267 -1268 -1269 -1270 -1271 -1272 -1273 -1274 -1275 -1276 -1277 -1278 -1279 -1280 -1281 -1282 -1283 -1284 -1285 -1286 -1287 -1288 -1289 -1290 -1291 -1292 -1293 -1294 -1295 -1296 -1297 -1298 -1299 -1300 -1301 -1302 -1303 -1304 -1305 -1306 -1307 -1308 -1309 -1310 -1311 -1312 -1313 -1314 -1315 -1316 -1317 -1318 -1319 -1320 -1321 -1322 -1323 -1324 -1325 -1326 -1327 -1328 -1329 -1330 -1331 -1332 -1333 -1334 -1335 -1336 -1337 -1338 -1339 -1340 -1341 -1342 -1343 -1344 -1345 -1346 -1347 -1348 -1349 -1350 -1351 -1352 -1353 -1354 -1355 -1356 -1357 -1358 -1359 -1360 -1361 -1362 -1363 -1364 -1365 -1366 -1367 -1368 -1369 -1370 -1371 -1372 -1373 -1374 -1375 -1376 -1377 -1378 -1379 -1380 -1381 -1382 -1383 -1384 -1385 -1386 -1387 -1388 -1389 -1390 -1391 -1392 -1393 -1394 -1395 -1396 -1397 -1398 -1399 -1400 -1401 -1402 -1403 -1404 -1405 -1406 -1407 -1408 -1409 -1410 -1411 -1412 -1413 -1414 -1415 -1416 -1417 -1418 -1419 -1420 -1421 -1422 -1423 -1424 -1425 -1426 -1427 -1428 -1429 -1430 -1431 -1432 -1433 -1434 -1435 -1436 -1437 -1438 -1439 -1440 -1441 -1442 -1443 -1444 -1445 -1446 -1447 -1448 -1449 -1450 -1451 -1452 -1453 -1454 -1455 -1456 -1457 -1458 -1459 -1460 -1461 -1462 -1463 -1464 -1465 -1466 -1467 -1468 -1469 -1470 -1471 -1472 -1473 -1474 -1475 -1476 -1477 -1478 -1479 -1480 -1481 -1482 -1483 -1484 -1485 -1486 -1487 -1488 -1489 -1490 -1491 -1492 -1493 -1494 -1495 -1496 -1497 -1498 -1499 -1500 -1501 -1502 -1503 -1504 -1505 -1506 -1507 -1508 -1509 -1510 -1511 -1512 -1513 -1514 -1515 -1516 -1517 -1518 -1519 -1520 -1521 -1522 -1523 -1524 -1525 -1526 -1527 -1528 -1529 -1530 -1531 -1532 -1533 -1534 -1535 -1536 -1537 -1538 -1539 -1540 -1541 -1542 -1543 -1544 -1545 -1546 -1547 -1548 -1549 -1550 -1551 -1552 -1553 -1554 -1555 -1556 -1557 -1558 -1559 -1560 -1561 -1562 -1563 -1564 -1565 -1566 -1567 -1568 -1569 -1570 -1571 -1572 -1573 -1574 -1575 -1576 -1577 -1578 -1579 -1580 -1581 -1582 -1583 -1584 -1585 -1586 -1587 -1588 -1589 -1590 -1591 -1592 -1593 -1594 -1595 -1596 -1597 -1598 -1599 -1600 -1601 -1602 -1603 -1604 -1605 -1606 -1607 -1608 -1609 -1610 -1611 -1612 -1613 -1614 -1615 -1616 -1617 -1618 -1619 -1620 -1621 -1622 -1623 -1624 -1625 -1626 -1627 -1628 -1629 -1630 -1631 -1632 -1633 -1634 -1635 -1636 -1637 -1638 -1639 -1640 -1641 -1642 -1643 -1644 -1645 -1646 -1647 -1648 -1649 -1650

    // Copyright (c) 2022 Espresso Systems (espressosys.com)
     // This file is part of the HotShot Query Service library.
     //
    @@ -1662,302 +402,25 @@
     
     #![cfg(feature = "sql-data-source")]
     
    -use super::{buffered_channel::BufferedChannel, VersionedDataSource};
    -use crate::{
    -    availability::{
    -        AvailabilityDataSource, BlockId, BlockQueryData, LeafId, LeafQueryData, QueryablePayload,
    -        ResourceId, TransactionHash, TransactionIndex, UpdateAvailabilityData,
    -    },
    -    metrics::PrometheusMetrics,
    -    status::StatusDataSource,
    -    Header, Leaf, MissingSnafu, NotFoundSnafu, Payload, QueryError, QueryResult, SignatureKey,
    +use super::{
    +    storage::sql::{self, SqlStorage},
    +    FetchingDataSource,
     };
    -use async_std::{net::ToSocketAddrs, task::spawn};
    +use crate::{availability::QueryablePayload, Payload, QueryResult};
    +use async_std::sync::Arc;
     use async_trait::async_trait;
    -use commit::Committable;
    -use futures::{
    -    channel::oneshot,
    -    future::{select, Either, FutureExt},
    -    stream::{BoxStream, StreamExt, TryStreamExt},
    -    task::{Context, Poll},
    -    AsyncRead, AsyncWrite,
    -};
    -use hotshot_types::{
    -    simple_certificate::QuorumCertificate,
    -    traits::{
    -        block_contents::{BlockHeader, BlockPayload},
    -        node_implementation::NodeType,
    -    },
    -};
    -use itertools::Itertools;
    -use postgres_native_tls::TlsConnector;
    -use snafu::OptionExt;
    -use std::{
    -    ops::{Bound, RangeBounds},
    -    pin::Pin,
    -    str::FromStr,
    -};
    -use tokio_postgres::{
    -    config::Host,
    -    tls::TlsConnect,
    -    types::{BorrowToSql, ToSql},
    -    Client, NoTls, Row, ToStatement,
    -};
    +use hotshot_types::traits::node_implementation::NodeType;
    +use std::borrow::Cow;
    +use tokio_postgres::Client;
     
     pub use crate::include_migrations;
     pub use anyhow::Error;
     pub use refinery::Migration;
     pub use tokio_postgres as postgres;
     
    -// This needs to be reexported so that we can reference it by absolute path relative to this crate
    -// in the expansion of `include_migrations`, even when `include_migrations` is invoked from another
    -// crate which doesn't have `include_dir` as a dependency.
    -pub use include_dir::include_dir;
    -
    -/// Embed migrations from the given directory into the current binary.
    -///
    -/// The macro invocation `include_migrations!(path)` evaluates to an expression of type `impl
    -/// Iterator<Item = Migration>`. Each migration must be a text file which is an immediate child of
    -/// `path`, and there must be no non-migration files in `path`. The migration files must have names
    -/// of the form `V${version}__${name}.sql`, where `version` is a positive integer indicating how the
    -/// migration is to be ordered relative to other migrations, and `name` is a descriptive name for
    -/// the migration.
    -///
    -/// `path` should be an absolute path. It is possible to give a path relative to the root of the
    -/// invoking crate by using environment variable expansions and the `CARGO_MANIFEST_DIR` environment
    -/// variable.
    -///
    -/// As an example, this is the invocation used to load the default migrations from the
    -/// `hotshot-query-service` crate. The migrations are located in a directory called `migrations` at
    -/// the root of the crate.
    -///
    -/// ```
    -/// # use hotshot_query_service::data_source::sql::{include_migrations, Migration};
    -/// let migrations: Vec<Migration> = include_migrations!("$CARGO_MANIFEST_DIR/migrations").collect();
    -/// assert_eq!(migrations[0].version(), 10);
    -/// assert_eq!(migrations[0].name(), "init_schema");
    -/// ```
    -///
    -/// Note that a similar macro is available from Refinery:
    -/// [embed_migrations](https://docs.rs/refinery/0.8.11/refinery/macro.embed_migrations.html). This
    -/// macro differs in that it evaluates to an iterator of [migrations](Migration), making it an
    -/// expression macro, while `embed_migrations` is a statement macro that defines a module which
    -/// provides access to the embedded migrations only indirectly via a
    -/// [`Runner`](https://docs.rs/refinery/0.8.11/refinery/struct.Runner.html). The direct access to
    -/// migrations provided by [`include_migrations`] makes this macro easier to use with
    -/// [`Config::migrations`], for combining custom migrations with [`default_migrations`].
    -#[macro_export]
    -macro_rules! include_migrations {
    -    ($dir:tt) => {
    -        $crate::data_source::sql::include_dir!($dir)
    -            .files()
    -            .map(|file| {
    -                let path = file.path();
    -                let name = path
    -                    .file_name()
    -                    .and_then(std::ffi::OsStr::to_str)
    -                    .unwrap_or_else(|| {
    -                        panic!(
    -                            "migration file {} must have a non-empty UTF-8 name",
    -                            path.display()
    -                        )
    -                    });
    -                let sql = file
    -                    .contents_utf8()
    -                    .unwrap_or_else(|| panic!("migration file {name} must use UTF-8 encoding"));
    -                Migration::unapplied(name, sql).expect("invalid migration")
    -            })
    -    };
    -}
    -
    -/// The migrations requied to build the default schema for this version of [`SqlDataSource`].
    -pub fn default_migrations() -> Vec<Migration> {
    -    let mut migrations = include_migrations!("$CARGO_MANIFEST_DIR/migrations").collect::<Vec<_>>();
    -
    -    // Check version uniqueness and sort by version.
    -    validate_migrations(&mut migrations).expect("default migrations are invalid");
    -
    -    // Check that all migration versions are multiples of 10, so that custom migrations can be
    -    // inserted in between.
    -    for m in &migrations {
    -        if m.version() == 0 || m.version() % 10 != 0 {
    -            panic!(
    -                "default migration version {} is not a positive multiple of 10",
    -                m.version()
    -            );
    -        }
    -    }
    -
    -    migrations
    -}
    -
    -/// Validate and preprocess a sequence of migrations.
    -///
    -/// * Ensure all migrations have distinct versions
    -/// * Ensure migrations are sorted by increasing version
    -fn validate_migrations(migrations: &mut [Migration]) -> Result<(), Error> {
    -    migrations.sort_by_key(|m| m.version());
    -
    -    // Check version uniqueness.
    -    for (prev, next) in migrations.iter().zip(migrations.iter().skip(1)) {
    -        if next <= prev {
    -            return Err(Error::msg(format!(
    -                "migration versions are not strictly increasing ({prev}->{next})"
    -            )));
    -        }
    -    }
    -
    -    Ok(())
    -}
    -
    -/// Add custom migrations to a default migration sequence.
    -///
    -/// Migrations in `custom` replace migrations in `default` with the same version. Otherwise, the two
    -/// sequences `default` and `custom` are merged so that the resulting sequence is sorted by
    -/// ascending version number. Each of `default` and `custom` is assumed to be the output of
    -/// [`validate_migrations`]; that is, each is sorted by version and contains no duplicate versions.
    -fn add_custom_migrations(
    -    default: impl IntoIterator<Item = Migration>,
    -    custom: impl IntoIterator<Item = Migration>,
    -) -> impl Iterator<Item = Migration> {
    -    default
    -        .into_iter()
    -        // Merge sorted lists, joining pairs of equal version into `EitherOrBoth::Both`.
    -        .merge_join_by(custom, |l, r| l.version().cmp(&r.version()))
    -        // Prefer the custom migration for a given version when both default and custom versions
    -        // are present.
    -        .map(|pair| pair.reduce(|_, custom| custom))
    -}
    -
    -/// Postgres client config.
    -#[derive(Clone, Debug)]
    -pub struct Config {
    -    pgcfg: postgres::Config,
    -    host: String,
    -    port: u16,
    -    schema: String,
    -    reset: bool,
    -    migrations: Vec<Migration>,
    -    no_migrations: bool,
    -    tls: bool,
    -}
    -
    -impl Default for Config {
    -    fn default() -> Self {
    -        Self {
    -            pgcfg: Default::default(),
    -            host: "localhost".into(),
    -            port: 5432,
    -            schema: "hotshot".into(),
    -            reset: false,
    -            migrations: vec![],
    -            no_migrations: false,
    -            tls: false,
    -        }
    -    }
    -}
    -
    -impl From<postgres::Config> for Config {
    -    fn from(pgcfg: postgres::Config) -> Self {
    -        // We connect via TCP manually, without using the host and port from pgcfg. So we need to
    -        // pull those out of pgcfg if they have been specified, to override the defaults.
    -        let host = match pgcfg.get_hosts().first() {
    -            Some(Host::Tcp(host)) => host.to_string(),
    -            _ => "localhost".into(),
    -        };
    -        let port = *pgcfg.get_ports().first().unwrap_or(&5432);
    -        Self {
    -            pgcfg,
    -            host,
    -            port,
    -            ..Default::default()
    -        }
    -    }
    -}
    -
    -impl FromStr for Config {
    -    type Err = <postgres::Config as FromStr>::Err;
    -
    -    fn from_str(s: &str) -> Result<Self, Self::Err> {
    -        Ok(postgres::Config::from_str(s)?.into())
    -    }
    -}
    +pub use sql::{Config, Query, Transaction};
     
     impl Config {
    -    /// Set the hostname of the database server.
    -    ///
    -    /// The default is `localhost`.
    -    pub fn host(mut self, host: impl Into<String>) -> Self {
    -        self.host = host.into();
    -        self
    -    }
    -
    -    /// Set the port on which to connect to the database.
    -    ///
    -    /// The default is 5432, the default Postgres port.
    -    pub fn port(mut self, port: u16) -> Self {
    -        self.port = port;
    -        self
    -    }
    -
    -    /// Set the DB user to connect as.
    -    pub fn user(mut self, user: &str) -> Self {
    -        self.pgcfg.user(user);
    -        self
    -    }
    -
    -    /// Set a password for connecting to the database.
    -    pub fn password(mut self, password: &str) -> Self {
    -        self.pgcfg.password(password);
    -        self
    -    }
    -
    -    /// Set the name of the database to connect to.
    -    pub fn database(mut self, database: &str) -> Self {
    -        self.pgcfg.dbname(database);
    -        self
    -    }
    -
    -    /// Set the name of the schema to use for queries.
    -    ///
    -    /// The default schema is named `hotshot` and is created via the default migrations.
    -    pub fn schema(mut self, schema: impl Into<String>) -> Self {
    -        self.schema = schema.into();
    -        self
    -    }
    -
    -    /// Reset the schema on connection.
    -    ///
    -    /// When this [`Config`] is used to [`connect`](Self::connect) a [`SqlDataSource`], if this
    -    /// option is set, the relevant [`schema`](Self::schema) will first be dropped and then
    -    /// recreated, yielding a completely fresh instance of the query service.
    -    ///
    -    /// This is a particularly useful capability for development and staging environments. Still, it
    -    /// must be used with extreme caution, as using this will irrevocably delete any data pertaining
    -    /// to the query service in the database.
    -    pub fn reset_schema(mut self) -> Self {
    -        self.reset = true;
    -        self
    -    }
    -
    -    /// Add custom migrations to run when connecting to the database.
    -    pub fn migrations(mut self, migrations: impl IntoIterator<Item = Migration>) -> Self {
    -        self.migrations.extend(migrations);
    -        self
    -    }
    -
    -    /// Skip all migrations when connecting to the database.
    -    pub fn no_migrations(mut self) -> Self {
    -        self.no_migrations = true;
    -        self
    -    }
    -
    -    /// Use TLS for an encrypted connection to the database.
    -    pub fn tls(mut self) -> Self {
    -        self.tls = true;
    -        self
    -    }
    -
         /// Connect to the database with this config.
         pub async fn connect<Types>(self) -> Result<SqlDataSource<Types>, Error>
         where
    @@ -2083,16 +546,17 @@
     ///
     /// # Synchronization
     ///
    -/// [`SqlDataSource`] implements [`VersionedDataSource`], which means changes are not applied to the
    -/// underlying database with every operation. Instead, outstanding changes are batched and applied
    -/// all at once, atomically, whenever [`commit`](Self::commit) is called. Outstanding, uncommitted
    -/// changes can also be rolled back completely using [`revert`](Self::revert).
    +/// [`SqlDataSource`] implements [`VersionedDataSource`](super::VersionedDataSource), which means
    +/// changes are not applied to the underlying database with every operation. Instead, outstanding
    +/// changes are batched and applied all at once, atomically, whenever
    +/// [`commit`](super::VersionedDataSource::commit) is called. Outstanding, uncommitted changes can
    +/// also be rolled back completely using [`revert`](super::VersionedDataSource::revert).
     ///
     /// Internally, the data source maintains an open [`Transaction`] whenever there are outstanding
    -/// changes, and commits the transaction on [`commit`](Self::commit). The underlying database
    -/// transaction can be accessed directly via [`transaction`](Self::transaction), which makes it
    -/// possible to compose application-specific database updates atomically with updates made by the
    -/// [`SqlDataSource`] itself. This is useful for [extension and
    +/// changes, and commits the transaction on [`commit`](super::VersionedDataSource::commit). The
    +/// underlying database transaction can be accessed directly via [`transaction`](Self::transaction),
    +/// which makes it possible to compose application-specific database updates atomically with updates
    +/// made by the [`SqlDataSource`] itself. This is useful for [extension and
     /// composition](#extension-and-composition).
     ///
     /// # Extension and Composition
    @@ -2133,8 +597,8 @@
     /// data you want to store. You can then access this data through the [`SqlDataSource`] using
     /// [`query`](Self::query) to run a custom read-only SQL query or [`transaction`](Self::transaction)
     /// to execute a custom atomic mutation of the database. If you use
    -/// [`transaction`](Self::transaction), be sure to call [`commit`](Self::commit) when you are ready
    -/// to persist your changes.
    +/// [`transaction`](Self::transaction), be sure to call
    +/// [`commit`](super::VersionedDataSource::commit) when you are ready to persist your changes.
     ///
     /// You will typically use [`query`](Self::query) to read custom data in API endpoint handlers and
     /// [`transaction`](Self::transaction) to populate custom data in your web server's update loop.
    @@ -2206,18 +670,7 @@
     ///     Ok(app)
     /// }
     /// ```
    -#[derive(Debug)]
    -pub struct SqlDataSource<Types>
    -where
    -    Types: NodeType,
    -{
    -    client: Client,
    -    tx_in_progress: bool,
    -    leaf_stream: BufferedChannel<LeafQueryData<Types>>,
    -    block_stream: BufferedChannel<BlockQueryData<Types>>,
    -    metrics: PrometheusMetrics,
    -    kill: Option<oneshot::Sender<()>>,
    -}
    +pub type SqlDataSource<Types> = FetchingDataSource<Types, SqlStorage, ()>;
     
     impl<Types> SqlDataSource<Types>
     where
    @@ -2225,85 +678,9 @@
         Payload<Types>: QueryablePayload,
     {
         /// Connect to a remote database.
    -    pub async fn connect(mut config: Config) -> Result<Self, Error> {
    -        // Establish a TCP connection to the server.
    -        let tcp = TcpStream::connect((config.host.as_str(), config.port)).await?;
    -
    -        // Convert the TCP connection into a postgres connection.
    -        let (mut client, kill) = if config.tls {
    -            let tls = TlsConnector::new(native_tls::TlsConnector::new()?, config.host.as_str());
    -            connect(config.pgcfg, tcp, tls).await?
    -        } else {
    -            connect(config.pgcfg, tcp, NoTls).await?
    -        };
    -
    -        // Create or connect to the schema for this query service.
    -        if config.reset {
    -            client
    -                .batch_execute(&format!("DROP SCHEMA IF EXISTS {} CASCADE", config.schema))
    -                .await?;
    -        }
    -        client
    -            .batch_execute(&format!("CREATE SCHEMA IF NOT EXISTS {}", config.schema))
    -            .await?;
    -        client
    -            .batch_execute(&format!("SET search_path TO {}", config.schema))
    -            .await?;
    -
    -        // Get migrations and interleave with custom migrations, sorting by version number.
    -        validate_migrations(&mut config.migrations)?;
    -        let migrations =
    -            add_custom_migrations(default_migrations(), config.migrations).collect::<Vec<_>>();
    -
    -        // Get a migration runner. Depending on the config, we can either use this to actually run
    -        // the migrations or just check if the database is up to date.
    -        let runner = refinery::Runner::new(&migrations).set_grouped(true);
    -
    -        if config.no_migrations {
    -            // We've been asked not to run any migrations. Abort if the DB is not already up to
    -            // date.
    -            let last_applied = runner.get_last_applied_migration_async(&mut client).await?;
    -            let last_expected = migrations.last();
    -            if last_applied.as_ref() != last_expected {
    -                return Err(Error::msg(format!("DB is out of date: last applied migration is {last_applied:?}, but expected {last_expected:?}")));
    -            }
    -        } else {
    -            // Run migrations using `refinery`.
    -            match runner.run_async(&mut client).await {
    -                Ok(report) => {
    -                    tracing::info!("ran DB migrations: {report:?}");
    -                }
    -                Err(err) => {
    -                    tracing::error!("DB migrations failed: {:?}", err.report());
    -                    Err(err)?;
    -                }
    -            }
    -        }
    -
    -        let mut ds = Self {
    -            client,
    -            tx_in_progress: false,
    -            kill: Some(kill),
    -            leaf_stream: BufferedChannel::init(),
    -            block_stream: BufferedChannel::init(),
    -            metrics: Default::default(),
    -        };
    -
    -        // HotShot doesn't emit an event for the genesis block, so we need to manually ensure it is
    -        // present.
    -        ds.insert_genesis().await?;
    -
    -        Ok(ds)
    -    }
    -
    -    async fn insert_genesis(&mut self) -> Result<(), Error> {
    -        if self.block_height().await? == 0 {
    -            self.insert_leaf(LeafQueryData::genesis()).await?;
    -            self.insert_block(BlockQueryData::genesis()).await?;
    -            self.commit().await?;
    -        }
    -        Ok(())
    -    }
    +    pub async fn connect(config: Config) -> Result<Self, Error> {
    +        Self::new(SqlStorage::connect(config).await?, ()).await
    +    }
     }
     
     impl<Types> SqlDataSource<Types>
    @@ -2317,752 +694,24 @@
         ///
         /// If there is no currently open transaction, a new transaction will be opened. No changes
         /// made through the transaction objeect returned by this method will be persisted until
    -    /// [`commit`](Self::commit) is called.
    +    /// [`commit`](super::VersionedDataSource::commit) is called.
         pub async fn transaction(&mut self) -> QueryResult<Transaction<'_>> {
    -        if !self.tx_in_progress {
    -            // If there is no transaction in progress, open one.
    -            self.client
    -                .batch_execute("BEGIN")
    -                .await
    -                .map_err(postgres_err)?;
    -            self.tx_in_progress = true;
    -        }
    -        Ok(Transaction {
    -            client: &mut self.client,
    -        })
    -    }
    -}
    -
    -impl<Types> Query for SqlDataSource<Types>
    -where
    -    Types: NodeType,
    -{
    -    fn client(&self) -> &Client {
    -        &self.client
    -    }
    -}
    -
    -impl<Types> Drop for SqlDataSource<Types>
    -where
    -    Types: NodeType,
    -{
    -    fn drop(&mut self) {
    -        if let Some(kill) = self.kill.take() {
    -            // Ignore errors, they just mean the task has already exited.
    -            kill.send(()).ok();
    -        }
    -    }
    -}
    -
    -#[async_trait]
    -impl<Types> VersionedDataSource for SqlDataSource<Types>
    -where
    -    Types: NodeType,
    -{
    -    type Error = postgres::error::Error;
    -
    -    /// Atomically commit to all outstanding modifications to the data.
    -    ///
    -    /// If this method fails, outstanding changes are left unmodified. The caller may opt to retry
    -    /// or to erase outstanding changes with [`revert`](Self::revert).
    -    async fn commit(&mut self) -> Result<(), Self::Error> {
    -        if self.tx_in_progress {
    -            self.client.batch_execute("COMMIT").await?;
    -            self.tx_in_progress = false;
    -        }
    -        self.leaf_stream.flush().await;
    -        self.block_stream.flush().await;
    -        Ok(())
    -    }
    -
    -    /// Erase all oustanding modifications to the data.
    -    ///
    -    /// This function must not return if it has failed to revert changes. Inability to revert
    -    /// changes to the database is considered a fatal error, and this function may panic.
    -    async fn revert(&mut self) {
    -        if self.tx_in_progress {
    -            // If we're trying to roll back a transaction, something has already gone wrong and
    -            // we're trying to recover. If we're unable to revert the changes and recover, all we
    -            // can do is panic.
    -            self.client
    -                .batch_execute("ROLLBACK")
    -                .await
    -                .expect("DB rollback succeeds");
    -            self.tx_in_progress = false;
    -        }
    -        self.leaf_stream.clear();
    -        self.block_stream.clear();
    -    }
    -}
    -
    -#[async_trait]
    -impl<Types> AvailabilityDataSource<Types> for SqlDataSource<Types>
    -where
    -    Types: NodeType,
    -    Payload<Types>: QueryablePayload,
    -{
    -    type LeafStream = BoxStream<'static, QueryResult<LeafQueryData<Types>>>;
    -    type BlockStream = BoxStream<'static, QueryResult<BlockQueryData<Types>>>;
    -
    -    type LeafRange<'a, R> = BoxStream<'static, QueryResult<LeafQueryData<Types>>>
    -    where
    -        Self: 'a,
    -        R: RangeBounds<usize> + Send;
    -    type BlockRange<'a, R>= BoxStream<'static, QueryResult<BlockQueryData<Types>>>
    -    where
    -        Self: 'a,
    -        R: RangeBounds<usize> + Send;
    -
    -    async fn get_leaf<ID>(&self, id: ID) -> QueryResult<LeafQueryData<Types>>
    -    where
    -        ID: Into<LeafId<Types>> + Send + Sync,
    -    {
    -        let (where_clause, param): (&str, Box<dyn ToSql + Send + Sync>) = match id.into() {
    -            ResourceId::Number(n) => ("height = $1", Box::new(n as i64)),
    -            ResourceId::Hash(h) => ("hash = $1", Box::new(h.to_string())),
    -        };
    -        let query = format!("SELECT leaf, qc FROM leaf WHERE {where_clause}");
    -        let row = self.query_one(&query, [param]).await?;
    -        parse_leaf(row)
    -    }
    -
    -    async fn get_block<ID>(&self, id: ID) -> QueryResult<BlockQueryData<Types>>
    -    where
    -        ID: Into<BlockId<Types>> + Send + Sync,
    -    {
    -        let (where_clause, param): (&str, Box<dyn ToSql + Send + Sync>) = match id.into() {
    -            ResourceId::Number(n) => ("h.height = $1", Box::new(n as i64)),
    -            ResourceId::Hash(h) => ("h.hash = $1", Box::new(h.to_string())),
    -        };
    -        let query = format!(
    -            "SELECT {BLOCK_COLUMNS}
    -              FROM header AS h
    -              JOIN payload AS p ON h.height = p.height
    -              WHERE {where_clause}
    -              LIMIT 1"
    -        );
    -        let row = self.query_one(&query, [param]).await?;
    -        parse_block(row)
    -    }
    -
    -    async fn get_leaf_range<R>(&self, range: R) -> QueryResult<Self::LeafRange<'_, R>>
    -    where
    -        R: RangeBounds<usize> + Send,
    -    {
    -        let (where_clause, params) = bounds_to_where_clause(range, "height");
    -        let query = format!("SELECT leaf, qc FROM leaf {where_clause} ORDER BY height ASC");
    -        let rows = self.query(&query, params).await?;
    -
    -        Ok(rows.map(|res| parse_leaf(res?)).boxed())
    -    }
    -
    -    async fn get_block_range<R>(&self, range: R) -> QueryResult<Self::BlockRange<'_, R>>
    -    where
    -        R: RangeBounds<usize> + Send,
    -    {
    -        let (where_clause, params) = bounds_to_where_clause(range, "h.height");
    -        let query = format!(
    -            "SELECT {BLOCK_COLUMNS}
    -              FROM header AS h
    -              JOIN payload AS p ON h.height = p.height
    -              {where_clause}
    -              ORDER BY h.height ASC"
    -        );
    -        let rows = self.query(&query, params).await?;
    -
    -        Ok(rows.map(|res| parse_block(res?)).boxed())
    -    }
    -
    -    async fn get_block_with_transaction(
    -        &self,
    -        hash: TransactionHash<Types>,
    -    ) -> QueryResult<(BlockQueryData<Types>, TransactionIndex<Types>)> {
    -        // ORDER BY t.id ASC ensures that if there are duplicate transactions, we return the first
    -        // one.
    -        let query = format!(
    -            "SELECT {BLOCK_COLUMNS}, t.index AS tx_index
    -                FROM header AS h
    -                JOIN payload AS p ON h.height = p.height
    -                JOIN transaction AS t ON t.block_height = h.height
    -                WHERE t.hash = $1
    -                ORDER BY t.id ASC
    -                LIMIT 1"
    -        );
    -        let row = self.query_one(&query, &[&hash.to_string()]).await?;
    -
    -        // Extract the transaction index.
    -        let index = row.try_get("tx_index").map_err(|err| QueryError::Error {
    -            message: format!("error extracting transaction index from query results: {err}"),
    -        })?;
    -        let index: TransactionIndex<Types> =
    -            serde_json::from_value(index).map_err(|err| QueryError::Error {
    -                message: format!("malformed transaction index: {err}"),
    -            })?;
    -
    -        // Extract the block.
    -        let block = parse_block(row)?;
    -
    -        Ok((block, index))
    -    }
    -
    -    async fn get_proposals(
    -        &self,
    -        proposer: &SignatureKey<Types>,
    -        limit: Option<usize>,
    -    ) -> QueryResult<Vec<LeafQueryData<Types>>> {
    -        let mut query = "SELECT leaf, qc FROM leaf WHERE proposer = $1".to_owned();
    -        if let Some(limit) = limit {
    -            // If there is a limit on the number of leaves to return, we want to return the most
    -            // recent leaves, so order by descending height.
    -            query = format!("{query} ORDER BY height DESC limit {limit}");
    -        }
    -        let proposer_json = serde_json::to_value(proposer).map_err(|err| QueryError::Error {
    -            message: format!("failed to serialize proposer ID: {err}"),
    -        })?;
    -        let rows = self.query(&query, &[&proposer_json]).await?;
    -        let mut leaves: Vec<_> = rows.map(|res| parse_leaf(res?)).try_collect().await?;
    -
    -        if limit.is_some() {
    -            // If there was a limit, we selected the leaves in descending order to get the most
    -            // recent leaves. Now reverse them to put them back in chronological order.
    -            leaves.reverse();
    -        }
    -
    -        Ok(leaves)
    -    }
    -
    -    async fn count_proposals(&self, proposer: &SignatureKey<Types>) -> QueryResult<usize> {
    -        let query = "SELECT count(*) FROM leaf WHERE proposer = $1";
    -        let proposer_json = serde_json::to_value(proposer).map_err(|err| QueryError::Error {
    -            message: format!("failed to serialize proposer ID: {err}"),
    -        })?;
    -        let row = self.query_one(query, &[&proposer_json]).await?;
    -        let count: i64 = row.get(0);
    -        Ok(count as usize)
    -    }
    -
    -    async fn subscribe_leaves(&self, height: usize) -> QueryResult<Self::LeafStream> {
    -        // Fetch leaves above `height` which have already been produced.
    -        let current_leaves = self.get_leaf_range(height..).await?;
    -        // Subscribe to future leaves after that.
    -        let future_leaves = self.leaf_stream.subscribe().await.map(Ok);
    -        Ok(current_leaves.chain(future_leaves).boxed())
    -    }
    -
    -    async fn subscribe_blocks(&self, height: usize) -> QueryResult<Self::BlockStream> {
    -        // Fetch blocks above `height` which have already been produced.
    -        let current_blocks = self.get_block_range(height..).await?;
    -        // Subscribe to future blocks after that.
    -        let future_blocks = self.block_stream.subscribe().await.map(Ok);
    -        Ok(current_blocks.chain(future_blocks).boxed())
    -    }
    -}
    -
    -#[async_trait]
    -impl<Types> UpdateAvailabilityData<Types> for SqlDataSource<Types>
    -where
    -    Types: NodeType,
    -    Payload<Types>: QueryablePayload,
    -{
    -    type Error = QueryError;
    -
    -    async fn insert_leaf(&mut self, leaf: LeafQueryData<Types>) -> Result<(), Self::Error> {
    -        let mut stmts: Vec<(String, Vec<Box<dyn ToSql + Send + Sync>>)> = vec![];
    -
    -        // While we don't necessarily have the full block for this leaf yet, we can initialize the
    -        // header table with block metadata taken from the leaf.
    -        let header_json =
    -            serde_json::to_value(&leaf.leaf().block_header).map_err(|err| QueryError::Error {
    -                message: format!("failed to serialize header: {err}"),
    -            })?;
    -        stmts.push((
    -            "INSERT INTO header (height, hash, data) VALUES ($1, $2, $3)".into(),
    -            vec![
    -                Box::new(leaf.height() as i64),
    -                Box::new(leaf.block_hash().to_string()),
    -                Box::new(header_json),
    -            ],
    -        ));
    -
    -        // Similarly, we can initialize the payload table with a null payload, which can help us
    -        // distinguish between blocks that haven't been produced yet and blocks we haven't received
    -        // yet when answering queries.
    -        stmts.push((
    -            "INSERT INTO payload (height) VALUES ($1)".into(),
    -            vec![Box::new(leaf.height() as i64)],
    -        ));
    -
    -        // Finally, we insert the leaf itself, which references the header row we created.
    -        // Serialize the full leaf and QC to JSON for easy storage.
    -        let leaf_json = serde_json::to_value(leaf.leaf()).map_err(|err| QueryError::Error {
    -            message: format!("failed to serialize leaf: {err}"),
    -        })?;
    -        let qc_json = serde_json::to_value(leaf.qc()).map_err(|err| QueryError::Error {
    -            message: format!("failed to serialize QC: {err}"),
    -        })?;
    -        let proposer_json =
    -            serde_json::to_value(&leaf.proposer()).map_err(|err| QueryError::Error {
    -                message: format!("failed to serialize proposer ID: {err}"),
    -            })?;
    -        stmts.push((
    -            "INSERT INTO leaf (height, hash, proposer, block_hash, leaf, qc)
    -             VALUES ($1, $2, $3, $4, $5, $6)"
    -                .into(),
    -            vec![
    -                Box::new(leaf.height() as i64),
    -                Box::new(leaf.hash().to_string()),
    -                Box::new(proposer_json),
    -                Box::new(leaf.block_hash().to_string()),
    -                Box::new(leaf_json),
    -                Box::new(qc_json),
    -            ],
    -        ));
    -
    -        // Grab a transaction and execute all the statements.
    -        let mut tx = self.transaction().await?;
    -        tx.execute_many(stmts).await?;
    -
    -        self.leaf_stream.push(leaf);
    -        Ok(())
    -    }
    -
    -    async fn insert_block(&mut self, block: BlockQueryData<Types>) -> Result<(), Self::Error> {
    -        let mut stmts: Vec<(String, Vec<Box<dyn ToSql + Send + Sync>>)> = vec![];
    -
    -        // The header and payload tables should already have been initialized when we inserted the
    -        // corresponding leaf. All we have to do is add the payload itself and its size.
    -        let payload = block
    -            .payload
    -            .encode()
    -            .map_err(|err| QueryError::Error {
    -                message: format!("failed to serialize block: {err}"),
    -            })?
    -            .collect::<Vec<_>>();
    -        stmts.push((
    -            "UPDATE payload SET (data, size) = ($1, $2) WHERE height = $3".into(),
    -            vec![
    -                Box::new(payload),
    -                Box::new(block.size() as i32),
    -                Box::new(block.height() as i64),
    -            ],
    -        ));
    -
    -        // Index the transactions in the block.
    -        let mut values = vec![];
    -        let mut params: Vec<Box<dyn ToSql + Send + Sync>> = vec![];
    -        for (txn_ix, txn) in block.enumerate() {
    -            let txn_ix = serde_json::to_value(&txn_ix).map_err(|err| QueryError::Error {
    -                message: format!("failed to serialize transaction index: {err}"),
    -            })?;
    -            values.push(format!(
    -                "(${},${},${})",
    -                params.len() + 1,
    -                params.len() + 2,
    -                params.len() + 3
    -            ));
    -            params.push(Box::new(txn.commit().to_string()));
    -            params.push(Box::new(block.height() as i64));
    -            params.push(Box::new(txn_ix));
    -        }
    -        if !values.is_empty() {
    -            stmts.push((
    -                format!(
    -                    "INSERT INTO transaction (hash, block_height, index) VALUES {}",
    -                    values.join(",")
    -                ),
    -                params,
    -            ));
    -        }
    -
    -        let mut tx = self.transaction().await?;
    -        tx.execute_many(stmts).await?;
    -
    -        self.block_stream.push(block);
    -        Ok(())
    -    }
    -}
    -
    -#[async_trait]
    -impl<Types> StatusDataSource for SqlDataSource<Types>
    -where
    -    Types: NodeType,
    -{
    -    async fn block_height(&self) -> QueryResult<usize> {
    -        let query = "SELECT max(height) FROM header";
    -        let row = self.query_one_static(query).await?;
    -        let height: Option<i64> = row.get(0);
    -        match height {
    -            Some(height) => {
    -                // The height of the block is the number of blocks below it, so the total number of
    -                // blocks is one more than the height of the highest block.
    -                Ok(height as usize + 1)
    -            }
    -            None => {
    -                // If there are no blocks yet, the height is 0.
    -                Ok(0)
    -            }
    -        }
    -    }
    -
    -    fn metrics(&self) -> &PrometheusMetrics {
    -        &self.metrics
    -    }
    -}
    -
    -/// An atomic SQL transaction.
    -//
    -// Note: we use a custom `Transaction` type instead of `tokio_postgres::Transaction` because with
    -// the latter, the lifecycle of the underlying SQL transaction is coupled to the lifecycle of the
    -// Rust object: a `BEGIN` statement is executed every time a `Transaction` is created and a `COMMIT`
    -// is executed whenever the `Transaction` is dropped. This is undesirable here because, logically,
    -// the underlying SQL transaction may persist between several calls into the `SqlDataSource`, and is
    -// only closed when `commit` is finally called. However, due to the lifetime of the reference within
    -// `Transaction`, we cannot actually store the `Transaction` object in the `SqlDataSource`, and so
    -// we create a new `Transaction` wrapper each time `SqlDataSource::transaction` is called. Thus, the
    -// lifecycle of the underlying logical transaction is not the same as the lifecycle of the Rust
    -// wrapper object.
    -pub struct Transaction<'a> {
    -    client: &'a mut Client,
    -}
    -
    -impl<'a> Transaction<'a> {
    -    /// Execute a statement against the underlying database.
    -    ///
    -    /// The results of the statement will be reflected immediately in future statements made within
    -    /// this transaction, but will not be reflected in the underlying database until the transaction
    -    /// is committed with [`SqlDataSource::commit`].
    -    pub async fn execute<T, P>(&mut self, statement: &T, params: P) -> QueryResult<()>
    -    where
    -        T: ?Sized + ToStatement,
    -        P: IntoIterator,
    -        P::IntoIter: ExactSizeIterator,
    -        P::Item: BorrowToSql,
    -    {
    -        self.client
    -            .execute_raw(statement, params)
    -            .await
    -            .map_err(|err| QueryError::Error {
    -                message: err.to_string(),
    -            })?;
    -        Ok(())
    -    }
    -
    -    pub async fn execute_many<S, T, P>(&mut self, statements: S) -> QueryResult<()>
    -    where
    -        S: IntoIterator<Item = (T, P)>,
    -        T: ToStatement,
    -        P: IntoIterator,
    -        P::IntoIter: ExactSizeIterator,
    -        P::Item: BorrowToSql,
    -    {
    -        for (stmt, params) in statements {
    -            self.execute(&stmt, params).await?;
    -        }
    -        Ok(())
    -    }
    -}
    -
    -/// Query the underlying SQL database.
    -///
    -/// The results will reflect the state after the statements thus far added to this transaction have
    -/// been applied, even though those effects have not been committed to the database yet.
    -impl<'a> Query for Transaction<'a> {
    -    fn client(&self) -> &Client {
    -        self.client
    -    }
    -}
    -
    -#[async_trait]
    -pub trait Query {
    -    fn client(&self) -> &Client;
    -
    -    // Query the underlying SQL database.
    -    async fn query<T, P>(
    -        &self,
    -        query: &T,
    -        params: P,
    -    ) -> QueryResult<BoxStream<'static, QueryResult<Row>>>
    -    where
    -        T: ?Sized + ToStatement + Sync,
    -        P: IntoIterator + Send,
    -        P::IntoIter: ExactSizeIterator,
    -        P::Item: BorrowToSql,
    -    {
             Ok(self
    -            .client()
    -            .query_raw(query, params)
    +            .storage_mut()
                 .await
    -            .map_err(postgres_err)?
    -            .map_err(postgres_err)
    -            .boxed())
    -    }
    -
    -    /// Query the underlying SQL database with no parameters.
    -    async fn query_static<T>(&self, query: &T) -> QueryResult<BoxStream<'static, QueryResult<Row>>>
    -    where
    -        T: ?Sized + ToStatement + Sync,
    -    {
    -        self.query::<T, [i64; 0]>(query, []).await
    -    }
    -
    -    /// Query the underlying SQL database, returning exactly one result or failing.
    -    async fn query_one<T, P>(&self, query: &T, params: P) -> QueryResult<Row>
    -    where
    -        T: ?Sized + ToStatement + Sync,
    -        P: IntoIterator + Send,
    -        P::IntoIter: ExactSizeIterator,
    -        P::Item: BorrowToSql,
    -    {
    -        self.query_opt(query, params).await?.context(NotFoundSnafu)
    -    }
    -
    -    /// Query the underlying SQL database with no parameters, returning exactly one result or
    -    /// failing.
    -    async fn query_one_static<T>(&self, query: &T) -> QueryResult<Row>
    -    where
    -        T: ?Sized + ToStatement + Sync,
    -    {
    -        self.query_one::<T, [i64; 0]>(query, []).await
    -    }
    -
    -    /// Query the underlying SQL database, returning zero or one results.
    -    async fn query_opt<T, P>(&self, query: &T, params: P) -> QueryResult<Option<Row>>
    -    where
    -        T: ?Sized + ToStatement + Sync,
    -        P: IntoIterator + Send,
    -        P::IntoIter: ExactSizeIterator,
    -        P::Item: BorrowToSql,
    -    {
    -        self.query(query, params).await?.try_next().await
    -    }
    -
    -    /// Query the underlying SQL database with no parameters, returning zero or one results.
    -    async fn query_opt_static<T>(&self, query: &T) -> QueryResult<Option<Row>>
    -    where
    -        T: ?Sized + ToStatement + Sync,
    -    {
    -        self.query_opt::<T, [i64; 0]>(query, []).await
    -    }
    -}
    -
    -fn postgres_err(err: tokio_postgres::Error) -> QueryError {
    -    QueryError::Error {
    -        message: err.to_string(),
    +            .transaction()
    +            .await?
    +            .change_lifetime())
         }
     }
     
    -fn parse_leaf<Types>(row: Row) -> QueryResult<LeafQueryData<Types>>
    -where
    -    Types: NodeType,
    -{
    -    let leaf = row.try_get("leaf").map_err(|err| QueryError::Error {
    -        message: format!("error extracting leaf from query results: {err}"),
    -    })?;
    -    let leaf: Leaf<Types> = serde_json::from_value(leaf).map_err(|err| QueryError::Error {
    -        message: format!("malformed leaf: {err}"),
    -    })?;
    -
    -    let qc = row.try_get("qc").map_err(|err| QueryError::Error {
    -        message: format!("error extracting QC from query results: {err}"),
    -    })?;
    -    let qc: QuorumCertificate<Types> =
    -        serde_json::from_value(qc).map_err(|err| QueryError::Error {
    -            message: format!("malformed QC: {err}"),
    -        })?;
    -
    -    Ok(LeafQueryData { leaf, qc })
    -}
    -
    -const BLOCK_COLUMNS: &str =
    -    "h.hash AS hash, h.data AS header_data, p.size AS payload_size, p.data AS payload_data";
    -
    -fn parse_block<Types>(row: Row) -> QueryResult<BlockQueryData<Types>>
    +#[async_trait]
    +impl<Types> Query for SqlDataSource<Types>
     where
         Types: NodeType,
     {
    -    // First, check if we have the payload for this block yet.
    -    let size: Option<i32> = row
    -        .try_get("payload_size")
    -        .map_err(|err| QueryError::Error {
    -            message: format!("error extracting payload size from query results: {err}"),
    -        })?;
    -    let payload_data: Option<Vec<u8>> =
    -        row.try_get("payload_data")
    -            .map_err(|err| QueryError::Error {
    -                message: format!("error extracting payload data from query results: {err}"),
    -            })?;
    -    let (size, payload_data) = size.zip(payload_data).context(MissingSnafu)?;
    -    let size = size as u64;
    -
    -    // Reconstruct the full header.
    -    let header_data = row
    -        .try_get("header_data")
    -        .map_err(|err| QueryError::Error {
    -            message: format!("error extracting header data from query results: {err}"),
    -        })?;
    -    let header: Header<Types> =
    -        serde_json::from_value(header_data).map_err(|err| QueryError::Error {
    -            message: format!("malformed header: {err}"),
    -        })?;
    -
    -    // Reconstruct the full block payload.
    -    let payload = Payload::<Types>::from_bytes(payload_data.into_iter(), header.metadata());
    -
    -    // Reconstruct the query data by adding metadata.
    -    let hash: String = row.try_get("hash").map_err(|err| QueryError::Error {
    -        message: format!("error extracting block hash from query results: {err}"),
    -    })?;
    -    let hash = hash.parse().map_err(|err| QueryError::Error {
    -        message: format!("malformed block hash: {err}"),
    -    })?;
    -
    -    Ok(BlockQueryData {
    -        header,
    -        payload,
    -        size,
    -        hash,
    -    })
    -}
    -
    -/// Convert range bounds to a SQL where clause constraining a given column.
    -///
    -/// Returns the where clause as a string and a list of query parameters. We assume that there are no
    -/// other parameters in the query; that is, parameters in the where clause will start from $1.
    -fn bounds_to_where_clause<R>(range: R, column: &str) -> (String, Vec<i64>)
    -where
    -    R: RangeBounds<usize>,
    -{
    -    let mut bounds = vec![];
    -    let mut params = vec![];
    -
    -    match range.start_bound() {
    -        Bound::Included(n) => {
    -            params.push(*n as i64);
    -            bounds.push(format!("{column} >= ${}", params.len()));
    -        }
    -        Bound::Excluded(n) => {
    -            params.push(*n as i64);
    -            bounds.push(format!("{column} > ${}", params.len()));
    -        }
    -        Bound::Unbounded => {}
    -    }
    -    match range.end_bound() {
    -        Bound::Included(n) => {
    -            params.push(*n as i64);
    -            bounds.push(format!("{column} <= ${}", params.len()));
    -        }
    -        Bound::Excluded(n) => {
    -            params.push(*n as i64);
    -            bounds.push(format!("{column} < ${}", params.len()));
    -        }
    -        Bound::Unbounded => {}
    -    }
    -
    -    let mut where_clause = bounds.join(" AND ");
    -    if !where_clause.is_empty() {
    -        where_clause = format!(" WHERE {where_clause}");
    -    }
    -
    -    (where_clause, params)
    -}
    -
    -/// Connect to a Postgres database with a TLS implementation.
    -///
    -/// Spawns a background task to run the connection. Returns a client and a channel to kill the
    -/// connection task.
    -async fn connect<T>(
    -    pgcfg: postgres::Config,
    -    tcp: TcpStream,
    -    tls: T,
    -) -> anyhow::Result<(Client, oneshot::Sender<()>)>
    -where
    -    T: TlsConnect<TcpStream>,
    -    T::Stream: Send + 'static,
    -{
    -    let (client, connection) = pgcfg.connect_raw(tcp, tls).await?;
    -
    -    // Spawn a task to drive the connection, with a channel to kill it when this data source is
    -    // dropped.
    -    let (kill, killed) = oneshot::channel();
    -    spawn(select(killed, connection).inspect(|res| {
    -        if let Either::Right((res, _)) = res {
    -            // If we were killed, do nothing. That is the normal shutdown path. But if the `select`
    -            // returned because the `connection` terminated, we should log something, as that is
    -            // unusual.
    -            match res {
    -                Ok(()) => tracing::warn!("postgres connection terminated unexpectedly"),
    -                Err(err) => tracing::error!("postgres connection closed with error: {err}"),
    -            }
    -        }
    -    }));
    -
    -    Ok((client, kill))
    -}
    -
    -// tokio-postgres is written in terms of the tokio AsyncRead/AsyncWrite traits. However, these
    -// traits do not require any specifics of the tokio runtime. Thus we can implement them using the
    -// async_std TcpStream type, and have a stream which is compatible with tokio-postgres but will run
    -// on the async_std executor.
    -//
    -// To avoid orphan impls, we wrap this tream in a new type.
    -struct TcpStream(async_std::net::TcpStream);
    -
    -impl TcpStream {
    -    async fn connect<A: ToSocketAddrs>(addrs: A) -> Result<Self, Error> {
    -        Ok(Self(async_std::net::TcpStream::connect(addrs).await?))
    -    }
    -}
    -
    -impl tokio::io::AsyncRead for TcpStream {
    -    fn poll_read(
    -        mut self: Pin<&mut Self>,
    -        cx: &mut Context<'_>,
    -        buf: &mut tokio::io::ReadBuf<'_>,
    -    ) -> Poll<std::io::Result<()>> {
    -        // tokio uses this hyper-optimized `ReadBuf` construct, where there is a filled portion, an
    -        // unfilled portion where we append new data, and the unfilled portion of the buffer need
    -        // not even be initialized. However the async_std implementation we're delegating to just
    -        // expects a normal `&mut [u8]` buffer which is entirely unfilled. To simplify the
    -        // conversion, we will abandon the uninitialized buffer optimization and force
    -        // initialization of the entire buffer, resulting in a plain old `&mut [u8]` representing
    -        // the unfilled portion. But first, we need to grab the length of the filled region so we
    -        // can increment it after we read new data from async_std.
    -        let filled = buf.filled().len();
    -
    -        // Initialize the buffer and get a slice of the unfilled region. This operation is free
    -        // after the first time it is called, so we don't need to worry about maintaining state
    -        // between subsequent calls to `poll_read`.
    -        let unfilled = buf.initialize_unfilled();
    -
    -        // Read data into the unfilled portion of the buffer.
    -        match Pin::new(&mut self.0).poll_read(cx, unfilled) {
    -            Poll::Ready(Ok(bytes_read)) => {
    -                // After the read completes, the first `bytes_read` of `unfilled` have now been
    -                // filled. Increment the `filled` cursor within the `ReadBuf` to account for this.
    -                buf.set_filled(filled + bytes_read);
    -                Poll::Ready(Ok(()))
    -            }
    -            Poll::Ready(Err(err)) => Poll::Ready(Err(err)),
    -            Poll::Pending => Poll::Pending,
    -        }
    -    }
    -}
    -
    -impl tokio::io::AsyncWrite for TcpStream {
    -    fn poll_write(
    -        mut self: Pin<&mut Self>,
    -        cx: &mut Context<'_>,
    -        buf: &[u8],
    -    ) -> Poll<std::io::Result<usize>> {
    -        Pin::new(&mut self.0).poll_write(cx, buf)
    -    }
    -
    -    fn poll_flush(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<std::io::Result<()>> {
    -        Pin::new(&mut self.0).poll_flush(cx)
    -    }
    -
    -    fn poll_shutdown(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<std::io::Result<()>> {
    -        Pin::new(&mut self.0).poll_close(cx)
    +    async fn client(&self) -> Cow<Arc<Client>> {
    +        Cow::Owned(self.storage().await.client().await.into_owned())
         }
     }
     
    @@ -3071,102 +720,12 @@
     pub mod testing {
         use super::*;
         use crate::{
    -        data_source::UpdateDataSource,
    -        testing::{
    -            mocks::{DataSourceLifeCycle, MockTypes},
    -            sleep,
    -        },
    +        data_source::{UpdateDataSource, VersionedDataSource},
    +        testing::mocks::{DataSourceLifeCycle, MockTypes},
         };
         use hotshot::types::Event;
    -    use portpicker::pick_unused_port;
    -    use std::{
    -        process::{Command, Stdio},
    -        str,
    -        time::Duration,
    -    };
    -
    -    #[derive(Debug)]
    -    pub struct TmpDb {
    -        port: u16,
    -        container_id: String,
    -    }
    -
    -    impl TmpDb {
    -        pub async fn init() -> Self {
    -            let port = pick_unused_port().unwrap();
     
    -            let output = Command::new("docker")
    -                .arg("run")
    -                .arg("-d")
    -                .args(["-p", &format!("{port}:5432")])
    -                .args(["-e", "POSTGRES_PASSWORD=password"])
    -                .arg("postgres")
    -                .output()
    -                .unwrap();
    -            let stdout = str::from_utf8(&output.stdout).unwrap();
    -            let stderr = str::from_utf8(&output.stderr).unwrap();
    -            if !output.status.success() {
    -                panic!("failed to start postgres docker: {stderr}");
    -            }
    -
    -            // Create the TmpDb object immediately after starting the Docker container, so if
    -            // anything panics after this `drop` will be called and we will clean up.
    -            let container_id = stdout.trim().to_owned();
    -            tracing::info!("launched postgres docker {container_id}");
    -            let db = Self { port, container_id };
    -
    -            // Wait for the database to be ready.
    -            while !Command::new("psql")
    -                .args(["-h", "localhost", "-p", &port.to_string(), "-U", "postgres"])
    -                .env("PGPASSWORD", "password")
    -                // Null input so the command terminates as soon as it manages to connect.
    -                .stdin(Stdio::null())
    -                // Output from this command is not useful, it's just a prompt.
    -                .stdout(Stdio::null())
    -                .stderr(Stdio::null())
    -                .status()
    -                .unwrap()
    -                .success()
    -            {
    -                tracing::warn!("database is not ready");
    -                sleep(Duration::from_secs(1)).await;
    -            }
    -
    -            db
    -        }
    -
    -        pub fn port(&self) -> u16 {
    -            self.port
    -        }
    -    }
    -
    -    impl Drop for TmpDb {
    -        fn drop(&mut self) {
    -            let output = Command::new("docker")
    -                .args(["kill", self.container_id.as_str()])
    -                .output()
    -                .unwrap();
    -            if !output.status.success() {
    -                tracing::error!(
    -                    "error killing postgres docker {}: {}",
    -                    self.container_id,
    -                    str::from_utf8(&output.stderr).unwrap()
    -                );
    -            }
    -
    -            let output = Command::new("docker")
    -                .args(["rm", self.container_id.as_str()])
    -                .output()
    -                .unwrap();
    -            if !output.status.success() {
    -                tracing::error!(
    -                    "error removing postgres docker {}: {}",
    -                    self.container_id,
    -                    str::from_utf8(&output.stderr).unwrap()
    -                );
    -            }
    -        }
    -    }
    +    pub use sql::testing::TmpDb;
     
         #[async_trait]
         impl DataSourceLifeCycle for SqlDataSource<MockTypes> {
    @@ -3219,83 +778,4 @@
     
         instantiate_data_source_tests!(SqlDataSource<MockTypes>);
     }
    -
    -// These tests run the `postgres` Docker image, which doesn't work on Windows.
    -#[cfg(all(test, not(target_os = "windows")))]
    -mod test {
    -    use super::{testing::TmpDb, *};
    -    use crate::testing::{mocks::MockTypes, setup_test};
    -
    -    #[async_std::test]
    -    async fn test_migrations() {
    -        setup_test();
    -
    -        let db = TmpDb::init().await;
    -        let port = db.port();
    -
    -        let connect = |migrations: bool, custom_migrations| async move {
    -            let mut cfg = Config::default()
    -                .user("postgres")
    -                .password("password")
    -                .port(port)
    -                .migrations(custom_migrations);
    -            if !migrations {
    -                cfg = cfg.no_migrations();
    -            }
    -            let client: SqlDataSource<MockTypes> = cfg.connect().await?;
    -            Ok::<_, Error>(client)
    -        };
    -
    -        // Connecting with migrations disabled should fail if the database is not already up to date
    -        // (since we've just created a fresh database, it isn't).
    -        let err = connect(false, vec![]).await.unwrap_err();
    -        tracing::info!("connecting without running migrations failed as expected: {err}");
    -
    -        // Now connect and run migrations to bring the database up to date.
    -        connect(true, vec![]).await.unwrap();
    -        // Now connecting without migrations should work.
    -        connect(false, vec![]).await.unwrap();
    -
    -        // Connect with some custom migrations, to advance the schema even further. Pass in the
    -        // custom migrations out of order; they should still execute in order of version number.
    -        // The SQL commands used here will fail if not run in order.
    -        let migrations = vec![
    -            Migration::unapplied(
    -                "V12__create_test_table.sql",
    -                "ALTER TABLE test ADD COLUMN data INTEGER;",
    -            )
    -            .unwrap(),
    -            Migration::unapplied("V11__create_test_table.sql", "CREATE TABLE test ();").unwrap(),
    -        ];
    -        connect(true, migrations.clone()).await.unwrap();
    -
    -        // Connect using the default schema (no custom migrations) and not running migrations. This
    -        // should fail because the database is _ahead_ of the client in terms of schema.
    -        let err = connect(false, vec![]).await.unwrap_err();
    -        tracing::info!("connecting without running migrations failed as expected: {err}");
    -
    -        // Connecting with the customized schema should work even without running migrations.
    -        connect(true, migrations).await.unwrap();
    -    }
    -
    -    #[test]
    -    fn test_config_from_str() {
    -        let cfg = Config::from_str("postgresql://user:password@host:8080").unwrap();
    -        assert_eq!(cfg.pgcfg.get_user(), Some("user"));
    -        assert_eq!(cfg.pgcfg.get_password(), Some("password".as_bytes()));
    -        assert_eq!(cfg.host, "host");
    -        assert_eq!(cfg.port, 8080);
    -    }
    -
    -    #[test]
    -    fn test_config_from_pgcfg() {
    -        let mut pgcfg = postgres::Config::default();
    -        pgcfg.dbname("db");
    -        let cfg = Config::from(pgcfg.clone());
    -        assert_eq!(cfg.pgcfg, pgcfg);
    -        // Default values.
    -        assert_eq!(cfg.host, "localhost");
    -        assert_eq!(cfg.port, 5432);
    -    }
    -}
     

    \ No newline at end of file diff --git a/src/hotshot_query_service/data_source/storage.rs.html b/src/hotshot_query_service/data_source/storage.rs.html new file mode 100644 index 000000000..830b64551 --- /dev/null +++ b/src/hotshot_query_service/data_source/storage.rs.html @@ -0,0 +1,173 @@ +storage.rs - source
    1
    +2
    +3
    +4
    +5
    +6
    +7
    +8
    +9
    +10
    +11
    +12
    +13
    +14
    +15
    +16
    +17
    +18
    +19
    +20
    +21
    +22
    +23
    +24
    +25
    +26
    +27
    +28
    +29
    +30
    +31
    +32
    +33
    +34
    +35
    +36
    +37
    +38
    +39
    +40
    +41
    +42
    +43
    +44
    +45
    +46
    +47
    +48
    +49
    +50
    +51
    +52
    +53
    +54
    +55
    +56
    +57
    +58
    +59
    +60
    +61
    +62
    +63
    +64
    +65
    +66
    +67
    +68
    +69
    +70
    +71
    +72
    +73
    +74
    +75
    +76
    +77
    +78
    +79
    +80
    +81
    +82
    +83
    +84
    +85
    +86
    +
    // Copyright (c) 2022 Espresso Systems (espressosys.com)
    +// This file is part of the HotShot Query Service library.
    +//
    +// This program is free software: you can redistribute it and/or modify it under the terms of the GNU
    +// General Public License as published by the Free Software Foundation, either version 3 of the
    +// License, or (at your option) any later version.
    +// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
    +// even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    +// General Public License for more details.
    +// You should have received a copy of the GNU General Public License along with this program. If not,
    +// see <https://www.gnu.org/licenses/>.
    +
    +//! Persistent storage for data sources.
    +//!
    +//! Naturally, an archival query service such as this is heavily dependent on a persistent storage
    +//! implementation. This module defines the interfaces required of this storage. Any storage layer
    +//! implementing the appropriate interfaces can be used as the storage layer when constructing a
    +//! [`FetchingDataSource`](super::FetchingDataSource), which can in turn be used to instantiate the
    +//! REST APIs provided by this crate.
    +//!
    +//! This module also comes with a few pre-built persistence implementations:
    +//! * [`SqlStorage`]
    +//! * [`FileSystemStorage`]
    +//!
    +
    +use crate::{
    +    availability::{
    +        BlockId, BlockQueryData, LeafId, LeafQueryData, QueryablePayload, TransactionHash,
    +        TransactionIndex, UpdateAvailabilityData,
    +    },
    +    Payload, QueryResult,
    +};
    +use async_trait::async_trait;
    +use hotshot_types::traits::node_implementation::NodeType;
    +use std::ops::RangeBounds;
    +
    +pub mod fs;
    +mod ledger_log;
    +pub mod sql;
    +
    +#[cfg(feature = "file-system-data-source")]
    +pub use fs::FileSystemStorage;
    +#[cfg(feature = "sql-data-source")]
    +pub use sql::SqlStorage;
    +
    +/// Persistent storage for a HotShot blockchain.
    +///
    +/// This trait defines the interface which must be provided by the storage layer in order to
    +/// implement an availability data source. It is very similar to
    +/// [`AvailabilityDataSource`](crate::availability::AvailabilityDataSource) with every occurrence of
    +/// [`Fetch`](crate::availability::Fetch) replaced by [`QueryResult`]. This is not a coincidence.
    +/// The purpose of the storage layer is to provide all of the functionality of the data source
    +/// layer, but independent of an external fetcher for missing data. Thus, when the storage layer
    +/// encounters missing, corrupt, or inaccessible data, it simply gives up and replaces the missing
    +/// data with [`Err`], rather than creating an asynchronous fetch request to retrieve the missing
    +/// data.
    +///
    +/// Rust gives us ways to abstract and deduplicate these two similar APIs, but they do not lead to a
    +/// better interface.
    +#[async_trait]
    +pub trait AvailabilityStorage<Types>: UpdateAvailabilityData<Types> + Send + Sync
    +where
    +    Types: NodeType,
    +    Payload<Types>: QueryablePayload,
    +{
    +    async fn get_leaf(&self, id: LeafId<Types>) -> QueryResult<LeafQueryData<Types>>;
    +    async fn get_block(&self, id: BlockId<Types>) -> QueryResult<BlockQueryData<Types>>;
    +
    +    async fn get_leaf_range<R>(
    +        &self,
    +        range: R,
    +    ) -> QueryResult<Vec<QueryResult<LeafQueryData<Types>>>>
    +    where
    +        R: RangeBounds<usize> + Send + 'static;
    +    async fn get_block_range<R>(
    +        &self,
    +        range: R,
    +    ) -> QueryResult<Vec<QueryResult<BlockQueryData<Types>>>>
    +    where
    +        R: RangeBounds<usize> + Send + 'static;
    +
    +    async fn get_block_with_transaction(
    +        &self,
    +        hash: TransactionHash<Types>,
    +    ) -> QueryResult<(BlockQueryData<Types>, TransactionIndex<Types>)>;
    +}
    +
    \ No newline at end of file diff --git a/src/hotshot_query_service/data_source/storage/fs.rs.html b/src/hotshot_query_service/data_source/storage/fs.rs.html new file mode 100644 index 000000000..745273c0e --- /dev/null +++ b/src/hotshot_query_service/data_source/storage/fs.rs.html @@ -0,0 +1,801 @@ +fs.rs - source
    1
    +2
    +3
    +4
    +5
    +6
    +7
    +8
    +9
    +10
    +11
    +12
    +13
    +14
    +15
    +16
    +17
    +18
    +19
    +20
    +21
    +22
    +23
    +24
    +25
    +26
    +27
    +28
    +29
    +30
    +31
    +32
    +33
    +34
    +35
    +36
    +37
    +38
    +39
    +40
    +41
    +42
    +43
    +44
    +45
    +46
    +47
    +48
    +49
    +50
    +51
    +52
    +53
    +54
    +55
    +56
    +57
    +58
    +59
    +60
    +61
    +62
    +63
    +64
    +65
    +66
    +67
    +68
    +69
    +70
    +71
    +72
    +73
    +74
    +75
    +76
    +77
    +78
    +79
    +80
    +81
    +82
    +83
    +84
    +85
    +86
    +87
    +88
    +89
    +90
    +91
    +92
    +93
    +94
    +95
    +96
    +97
    +98
    +99
    +100
    +101
    +102
    +103
    +104
    +105
    +106
    +107
    +108
    +109
    +110
    +111
    +112
    +113
    +114
    +115
    +116
    +117
    +118
    +119
    +120
    +121
    +122
    +123
    +124
    +125
    +126
    +127
    +128
    +129
    +130
    +131
    +132
    +133
    +134
    +135
    +136
    +137
    +138
    +139
    +140
    +141
    +142
    +143
    +144
    +145
    +146
    +147
    +148
    +149
    +150
    +151
    +152
    +153
    +154
    +155
    +156
    +157
    +158
    +159
    +160
    +161
    +162
    +163
    +164
    +165
    +166
    +167
    +168
    +169
    +170
    +171
    +172
    +173
    +174
    +175
    +176
    +177
    +178
    +179
    +180
    +181
    +182
    +183
    +184
    +185
    +186
    +187
    +188
    +189
    +190
    +191
    +192
    +193
    +194
    +195
    +196
    +197
    +198
    +199
    +200
    +201
    +202
    +203
    +204
    +205
    +206
    +207
    +208
    +209
    +210
    +211
    +212
    +213
    +214
    +215
    +216
    +217
    +218
    +219
    +220
    +221
    +222
    +223
    +224
    +225
    +226
    +227
    +228
    +229
    +230
    +231
    +232
    +233
    +234
    +235
    +236
    +237
    +238
    +239
    +240
    +241
    +242
    +243
    +244
    +245
    +246
    +247
    +248
    +249
    +250
    +251
    +252
    +253
    +254
    +255
    +256
    +257
    +258
    +259
    +260
    +261
    +262
    +263
    +264
    +265
    +266
    +267
    +268
    +269
    +270
    +271
    +272
    +273
    +274
    +275
    +276
    +277
    +278
    +279
    +280
    +281
    +282
    +283
    +284
    +285
    +286
    +287
    +288
    +289
    +290
    +291
    +292
    +293
    +294
    +295
    +296
    +297
    +298
    +299
    +300
    +301
    +302
    +303
    +304
    +305
    +306
    +307
    +308
    +309
    +310
    +311
    +312
    +313
    +314
    +315
    +316
    +317
    +318
    +319
    +320
    +321
    +322
    +323
    +324
    +325
    +326
    +327
    +328
    +329
    +330
    +331
    +332
    +333
    +334
    +335
    +336
    +337
    +338
    +339
    +340
    +341
    +342
    +343
    +344
    +345
    +346
    +347
    +348
    +349
    +350
    +351
    +352
    +353
    +354
    +355
    +356
    +357
    +358
    +359
    +360
    +361
    +362
    +363
    +364
    +365
    +366
    +367
    +368
    +369
    +370
    +371
    +372
    +373
    +374
    +375
    +376
    +377
    +378
    +379
    +380
    +381
    +382
    +383
    +384
    +385
    +386
    +387
    +388
    +389
    +390
    +391
    +392
    +393
    +394
    +395
    +396
    +397
    +398
    +399
    +400
    +
    // Copyright (c) 2022 Espresso Systems (espressosys.com)
    +// This file is part of the HotShot Query Service library.
    +//
    +// This program is free software: you can redistribute it and/or modify it under the terms of the GNU
    +// General Public License as published by the Free Software Foundation, either version 3 of the
    +// License, or (at your option) any later version.
    +// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
    +// even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    +// General Public License for more details.
    +// You should have received a copy of the GNU General Public License along with this program. If not,
    +// see <https://www.gnu.org/licenses/>.
    +
    +#![cfg(feature = "file-system-data-source")]
    +
    +use super::{
    +    ledger_log::{Iter, LedgerLog},
    +    AvailabilityStorage,
    +};
    +use crate::{
    +    availability::{
    +        data_source::{BlockId, LeafId, ResourceId, UpdateAvailabilityData},
    +        query_data::{
    +            BlockHash, BlockQueryData, LeafHash, LeafQueryData, QueryablePayload, TransactionHash,
    +            TransactionIndex,
    +        },
    +    },
    +    data_source::VersionedDataSource,
    +    node::{NodeDataSource, UpdateNodeData},
    +    MissingSnafu, NotFoundSnafu, Payload, QueryResult, SignatureKey,
    +};
    +use async_trait::async_trait;
    +use atomic_store::{AtomicStore, AtomicStoreLoader, PersistenceError};
    +use commit::Committable;
    +use futures::stream::{self, StreamExt, TryStreamExt};
    +use hotshot_types::traits::node_implementation::NodeType;
    +use serde::{de::DeserializeOwned, Serialize};
    +use snafu::OptionExt;
    +use std::collections::hash_map::{Entry, HashMap};
    +use std::hash::Hash;
    +use std::ops::{Bound, RangeBounds};
    +use std::path::Path;
    +
    +const CACHED_LEAVES_COUNT: usize = 100;
    +const CACHED_BLOCKS_COUNT: usize = 100;
    +
    +/// Storage for the APIs provided in this crate, backed by a remote PostgreSQL database.
    +#[derive(custom_debug::Debug)]
    +pub struct FileSystemStorage<Types: NodeType>
    +where
    +    Payload<Types>: QueryablePayload,
    +{
    +    index_by_leaf_hash: HashMap<LeafHash<Types>, u64>,
    +    index_by_block_hash: HashMap<BlockHash<Types>, u64>,
    +    index_by_txn_hash: HashMap<TransactionHash<Types>, (u64, TransactionIndex<Types>)>,
    +    index_by_proposer_id: HashMap<SignatureKey<Types>, Vec<u64>>,
    +    #[debug(skip)]
    +    top_storage: Option<AtomicStore>,
    +    leaf_storage: LedgerLog<LeafQueryData<Types>>,
    +    block_storage: LedgerLog<BlockQueryData<Types>>,
    +}
    +
    +impl<Types: NodeType> FileSystemStorage<Types>
    +where
    +    Payload<Types>: QueryablePayload,
    +{
    +    /// Create a new [FileSystemStorage] with storage at `path`.
    +    ///
    +    /// If there is already data at `path`, it will be archived.
    +    ///
    +    /// The [FileSystemStorage] will manage its own persistence synchronization.
    +    pub async fn create(path: &Path) -> Result<Self, PersistenceError> {
    +        let mut loader = AtomicStoreLoader::create(path, "hotshot_data_source")?;
    +        let mut data_source = Self::create_with_store(&mut loader).await?;
    +        data_source.top_storage = Some(AtomicStore::open(loader)?);
    +        Ok(data_source)
    +    }
    +
    +    /// Open an existing [FileSystemStorage] from storage at `path`.
    +    ///
    +    /// If there is no data at `path`, a new store will be created.
    +    ///
    +    /// The [FileSystemStorage] will manage its own persistence synchronization.
    +    pub async fn open(path: &Path) -> Result<Self, PersistenceError> {
    +        let mut loader = AtomicStoreLoader::load(path, "hotshot_data_source")?;
    +        let mut data_source = Self::open_with_store(&mut loader).await?;
    +        data_source.top_storage = Some(AtomicStore::open(loader)?);
    +        Ok(data_source)
    +    }
    +
    +    /// Create a new [FileSystemStorage] using a persistent storage loader.
    +    ///
    +    /// If there is existing data corresponding to the [FileSystemStorage] data structures, it will
    +    /// be archived.
    +    ///
    +    /// The [FileSystemStorage] will register its persistent data structures with `loader`. The
    +    /// caller is responsible for creating an [AtomicStore] from `loader` and managing
    +    /// synchronization of the store.
    +    pub async fn create_with_store(
    +        loader: &mut AtomicStoreLoader,
    +    ) -> Result<Self, PersistenceError> {
    +        Ok(Self {
    +            index_by_leaf_hash: Default::default(),
    +            index_by_block_hash: Default::default(),
    +            index_by_txn_hash: Default::default(),
    +            index_by_proposer_id: Default::default(),
    +            top_storage: None,
    +            leaf_storage: LedgerLog::create(loader, "leaves", CACHED_LEAVES_COUNT)?,
    +            block_storage: LedgerLog::create(loader, "blocks", CACHED_BLOCKS_COUNT)?,
    +        })
    +    }
    +
    +    /// Open an existing [FileSystemStorage] using a persistent storage loader.
    +    ///
    +    /// If there is no existing data corresponding to the [FileSystemStorage] data structures, a new
    +    /// store will be created.
    +    ///
    +    /// The [FileSystemStorage] will register its persistent data structures with `loader`. The
    +    /// caller is responsible for creating an [AtomicStore] from `loader` and managing
    +    /// synchronization of the store.
    +    pub async fn open_with_store(loader: &mut AtomicStoreLoader) -> Result<Self, PersistenceError> {
    +        let leaf_storage =
    +            LedgerLog::<LeafQueryData<Types>>::open(loader, "leaves", CACHED_LEAVES_COUNT)?;
    +        let block_storage =
    +            LedgerLog::<BlockQueryData<Types>>::open(loader, "blocks", CACHED_BLOCKS_COUNT)?;
    +
    +        let mut index_by_proposer_id = HashMap::new();
    +        let mut index_by_block_hash = HashMap::new();
    +        let index_by_leaf_hash = leaf_storage
    +            .iter()
    +            .flatten()
    +            .map(|leaf| {
    +                index_by_proposer_id
    +                    .entry(leaf.proposer())
    +                    .or_insert_with(Vec::new)
    +                    .push(leaf.height());
    +                update_index_by_hash(&mut index_by_block_hash, leaf.block_hash(), leaf.height());
    +                (leaf.hash(), leaf.height())
    +            })
    +            .collect();
    +
    +        let mut index_by_txn_hash = HashMap::new();
    +        for block in block_storage.iter().flatten() {
    +            let height = block.height();
    +            for (txn_ix, txn) in block.enumerate() {
    +                update_index_by_hash(&mut index_by_txn_hash, txn.commit(), (height, txn_ix));
    +            }
    +        }
    +
    +        Ok(Self {
    +            index_by_leaf_hash,
    +            index_by_block_hash,
    +            index_by_txn_hash,
    +            index_by_proposer_id,
    +            leaf_storage,
    +            block_storage,
    +            top_storage: None,
    +        })
    +    }
    +
    +    /// Advance the version of the persistent store without committing changes to persistent state.
    +    pub fn skip_version(&mut self) -> Result<(), PersistenceError> {
    +        self.leaf_storage.skip_version()?;
    +        self.block_storage.skip_version()?;
    +        if let Some(store) = &mut self.top_storage {
    +            store.commit_version()?;
    +        }
    +        Ok(())
    +    }
    +}
    +
    +#[async_trait]
    +impl<Types: NodeType> VersionedDataSource for FileSystemStorage<Types>
    +where
    +    Payload<Types>: QueryablePayload,
    +{
    +    type Error = PersistenceError;
    +
    +    async fn commit(&mut self) -> Result<(), PersistenceError> {
    +        self.leaf_storage.commit_version().await?;
    +        self.block_storage.commit_version().await?;
    +        if let Some(store) = &mut self.top_storage {
    +            store.commit_version()?;
    +        }
    +        Ok(())
    +    }
    +
    +    async fn revert(&mut self) {
    +        self.leaf_storage.revert_version().unwrap();
    +        self.block_storage.revert_version().unwrap();
    +    }
    +}
    +
    +fn range_iter<T>(
    +    mut iter: Iter<'_, T>,
    +    range: impl RangeBounds<usize>,
    +) -> impl '_ + Iterator<Item = QueryResult<T>>
    +where
    +    T: Clone + Serialize + DeserializeOwned,
    +{
    +    let start = range.start_bound().cloned();
    +    let end = range.end_bound().cloned();
    +
    +    // Advance the underlying iterator to the start of the range.
    +    let pos = match start {
    +        Bound::Included(n) => {
    +            if n > 0 {
    +                iter.nth(n - 1);
    +            }
    +            n
    +        }
    +        Bound::Excluded(n) => {
    +            iter.nth(n);
    +            n + 1
    +        }
    +        Bound::Unbounded => 0,
    +    };
    +
    +    itertools::unfold((iter, end, pos), |(iter, end, pos)| {
    +        // Check if we have reached the end of the range.
    +        let reached_end = match end {
    +            Bound::Included(n) => pos > n,
    +            Bound::Excluded(n) => pos >= n,
    +            Bound::Unbounded => false,
    +        };
    +        if reached_end {
    +            return None;
    +        }
    +        let opt = iter.next()?;
    +        *pos += 1;
    +        Some(opt.context(MissingSnafu))
    +    })
    +}
    +
    +#[async_trait]
    +impl<Types: NodeType> AvailabilityStorage<Types> for FileSystemStorage<Types>
    +where
    +    Payload<Types>: QueryablePayload,
    +{
    +    async fn get_leaf(&self, id: LeafId<Types>) -> QueryResult<LeafQueryData<Types>> {
    +        let n = match id {
    +            ResourceId::Number(n) => n,
    +            ResourceId::Hash(h) => {
    +                *self.index_by_leaf_hash.get(&h).context(NotFoundSnafu)? as usize
    +            }
    +        };
    +        self.leaf_storage
    +            .iter()
    +            .nth(n)
    +            .context(NotFoundSnafu)?
    +            .context(MissingSnafu)
    +    }
    +
    +    async fn get_block(&self, id: BlockId<Types>) -> QueryResult<BlockQueryData<Types>> {
    +        let n = match id {
    +            ResourceId::Number(n) => n,
    +            ResourceId::Hash(h) => {
    +                *self.index_by_block_hash.get(&h).context(NotFoundSnafu)? as usize
    +            }
    +        };
    +        self.block_storage
    +            .iter()
    +            .nth(n)
    +            .context(NotFoundSnafu)?
    +            .context(MissingSnafu)
    +    }
    +
    +    async fn get_leaf_range<R>(
    +        &self,
    +        range: R,
    +    ) -> QueryResult<Vec<QueryResult<LeafQueryData<Types>>>>
    +    where
    +        R: RangeBounds<usize> + Send,
    +    {
    +        Ok(range_iter(self.leaf_storage.iter(), range).collect())
    +    }
    +
    +    async fn get_block_range<R>(
    +        &self,
    +        range: R,
    +    ) -> QueryResult<Vec<QueryResult<BlockQueryData<Types>>>>
    +    where
    +        R: RangeBounds<usize> + Send,
    +    {
    +        Ok(range_iter(self.block_storage.iter(), range).collect())
    +    }
    +
    +    async fn get_block_with_transaction(
    +        &self,
    +        hash: TransactionHash<Types>,
    +    ) -> QueryResult<(BlockQueryData<Types>, TransactionIndex<Types>)> {
    +        let (height, ix) = self.index_by_txn_hash.get(&hash).context(NotFoundSnafu)?;
    +        let block = self.get_block((*height as usize).into()).await?;
    +        Ok((block, ix.clone()))
    +    }
    +}
    +
    +#[async_trait]
    +impl<Types: NodeType> UpdateAvailabilityData<Types> for FileSystemStorage<Types>
    +where
    +    Payload<Types>: QueryablePayload,
    +{
    +    type Error = PersistenceError;
    +
    +    async fn insert_leaf(&mut self, leaf: LeafQueryData<Types>) -> Result<(), Self::Error> {
    +        self.leaf_storage
    +            .insert(leaf.height() as usize, leaf.clone())?;
    +        self.index_by_leaf_hash.insert(leaf.hash(), leaf.height());
    +        update_index_by_hash(
    +            &mut self.index_by_block_hash,
    +            leaf.block_hash(),
    +            leaf.height(),
    +        );
    +        Ok(())
    +    }
    +
    +    async fn insert_block(&mut self, block: BlockQueryData<Types>) -> Result<(), Self::Error> {
    +        self.block_storage
    +            .insert(block.height() as usize, block.clone())?;
    +        for (txn_ix, txn) in block.enumerate() {
    +            update_index_by_hash(
    +                &mut self.index_by_txn_hash,
    +                txn.commit(),
    +                (block.height(), txn_ix),
    +            );
    +        }
    +        Ok(())
    +    }
    +}
    +
    +/// Update an index mapping hashes of objects to their positions in the ledger.
    +///
    +/// This function will insert the mapping from `hash` to `pos` into `index`, _unless_ there is
    +/// already an entry for `hash` at an earlier position in the ledger.
    +fn update_index_by_hash<H: Eq + Hash, P: Ord>(index: &mut HashMap<H, P>, hash: H, pos: P) {
    +    match index.entry(hash) {
    +        Entry::Occupied(mut e) => {
    +            if &pos < e.get() {
    +                // Overwrite the existing entry if the new object was sequenced first.
    +                e.insert(pos);
    +            }
    +        }
    +        Entry::Vacant(e) => {
    +            e.insert(pos);
    +        }
    +    }
    +}
    +
    +#[async_trait]
    +impl<Types: NodeType> NodeDataSource<Types> for FileSystemStorage<Types>
    +where
    +    Payload<Types>: QueryablePayload,
    +{
    +    async fn block_height(&self) -> QueryResult<usize> {
    +        Ok(self.leaf_storage.iter().len())
    +    }
    +
    +    async fn get_proposals(
    +        &self,
    +        id: &SignatureKey<Types>,
    +        limit: Option<usize>,
    +    ) -> QueryResult<Vec<LeafQueryData<Types>>> {
    +        let all_ids = self
    +            .index_by_proposer_id
    +            .get(id)
    +            .cloned()
    +            .unwrap_or_default();
    +        let start_from = match limit {
    +            Some(count) => all_ids.len().saturating_sub(count),
    +            None => 0,
    +        };
    +        stream::iter(all_ids)
    +            .skip(start_from)
    +            .then(|height| self.get_leaf((height as usize).into()))
    +            .try_collect()
    +            .await
    +    }
    +
    +    async fn count_proposals(&self, id: &SignatureKey<Types>) -> QueryResult<usize> {
    +        Ok(match self.index_by_proposer_id.get(id) {
    +            Some(ids) => ids.len(),
    +            None => 0,
    +        })
    +    }
    +}
    +
    +#[async_trait]
    +impl<Types: NodeType> UpdateNodeData<Types> for FileSystemStorage<Types>
    +where
    +    Payload<Types>: QueryablePayload,
    +{
    +    type Error = PersistenceError;
    +
    +    async fn insert_leaf(&mut self, leaf: LeafQueryData<Types>) -> Result<(), Self::Error> {
    +        self.index_by_proposer_id
    +            .entry(leaf.proposer())
    +            .or_default()
    +            .push(leaf.height());
    +        Ok(())
    +    }
    +}
    +
    \ No newline at end of file diff --git a/src/hotshot_query_service/data_source/ledger_log.rs.html b/src/hotshot_query_service/data_source/storage/ledger_log.rs.html similarity index 65% rename from src/hotshot_query_service/data_source/ledger_log.rs.html rename to src/hotshot_query_service/data_source/storage/ledger_log.rs.html index b7f3aa3c9..66d245673 100644 --- a/src/hotshot_query_service/data_source/ledger_log.rs.html +++ b/src/hotshot_query_service/data_source/storage/ledger_log.rs.html @@ -1,4 +1,4 @@ -ledger_log.rs - source
    1
    +ledger_log.rs - source
    1
     2
     3
     4
    @@ -340,151 +340,6 @@
     340
     341
     342
    -343
    -344
    -345
    -346
    -347
    -348
    -349
    -350
    -351
    -352
    -353
    -354
    -355
    -356
    -357
    -358
    -359
    -360
    -361
    -362
    -363
    -364
    -365
    -366
    -367
    -368
    -369
    -370
    -371
    -372
    -373
    -374
    -375
    -376
    -377
    -378
    -379
    -380
    -381
    -382
    -383
    -384
    -385
    -386
    -387
    -388
    -389
    -390
    -391
    -392
    -393
    -394
    -395
    -396
    -397
    -398
    -399
    -400
    -401
    -402
    -403
    -404
    -405
    -406
    -407
    -408
    -409
    -410
    -411
    -412
    -413
    -414
    -415
    -416
    -417
    -418
    -419
    -420
    -421
    -422
    -423
    -424
    -425
    -426
    -427
    -428
    -429
    -430
    -431
    -432
    -433
    -434
    -435
    -436
    -437
    -438
    -439
    -440
    -441
    -442
    -443
    -444
    -445
    -446
    -447
    -448
    -449
    -450
    -451
    -452
    -453
    -454
    -455
    -456
    -457
    -458
    -459
    -460
    -461
    -462
    -463
    -464
    -465
    -466
    -467
    -468
    -469
    -470
    -471
    -472
    -473
    -474
    -475
    -476
    -477
    -478
    -479
    -480
    -481
    -482
    -483
    -484
    -485
    -486
    -487
     
    // Copyright (c) 2022 Espresso Systems (espressosys.com)
     // This file is part of the HotShot Query Service library.
     //
    @@ -499,11 +354,9 @@
     
     #![cfg(feature = "file-system-data-source")]
     
    -use async_compatibility_layer::async_primitives::broadcast::{channel, BroadcastSender};
    -use atomic_store::{
    +use atomic_store::{
         append_log, load_store::BincodeLoadStore, AppendLog, AtomicStoreLoader, PersistenceError,
     };
    -use futures::stream::{self, BoxStream, StreamExt};
     use serde::{de::DeserializeOwned, Serialize};
     use std::collections::VecDeque;
     use std::fmt::Debug;
    @@ -521,15 +374,6 @@
         // handled differently and `self.store.iter().len()` does not update until a new version is
         // committed.
         pending_inserts: usize,
    -
    -    // Send handle for a channel where we stream resource.
    -    stream: BroadcastSender<T>,
    -    // Because we may receive resource out of order, but `stream` must be ordered, we will not
    -    // necessarily send a resource as soon as we get it. `stream_pos` is the index in `store` of the
    -    // next object to be sent on `stream` when we receive it. It is equal to the length of the
    -    // longest prefix of non-[None] objects in `store`, which may be less than the total length of
    -    // `store`.
    -    stream_pos: usize,
     }
     
     impl<T: Serialize + DeserializeOwned + Clone> LedgerLog<T> {
    @@ -549,8 +393,6 @@
                     1u64 << 20, // 1 MB
                 )?,
                 pending_inserts: 0,
    -            stream: channel().0,
    -            stream_pos: 0,
             })
         }
     
    @@ -589,25 +431,12 @@
                 .collect::<VecDeque<_>>();
             cache.reserve_exact(cache_size - cache.len());
     
    -        // Find the next object to broadcast on `stream` when it becomes available. This is the
    -        // index of the first _unavailable_ item in `store`.
    -        let stream_pos = store
    -            .iter()
    -            .position(|entry| !matches!(entry, Ok(Some(_))))
    -            // If there are no currently unavailable entries in `store`, then the next object to
    -            // broadcast is the next object to be appended to `store`, whose index is the length of
    -            // `store`.
    -            .unwrap_or_else(|| store.iter().len());
    -        tracing::debug!("stream_pos={}", stream_pos);
    -
             Ok(Self {
                 cache_start,
                 cache_size,
                 cache,
                 store,
                 pending_inserts: 0,
    -            stream: channel().0,
    -            stream_pos,
             })
         }
     
    @@ -637,7 +466,7 @@
         {
             // If there are missing objects between what we currently have and `object`, pad with
             // placeholders.
    -        let len = self.store.iter().len() + self.pending_inserts;
    +        let len = self.store.iter().len();
             let target_len = std::cmp::max(index, len);
             for i in len..target_len {
                 tracing::debug!("storing placeholders for position {}/{target_len}", len + i);
    @@ -657,7 +486,10 @@
                 // This is an object earlier in the chain that we are now receiving asynchronously.
                 // Update the placeholder with the actual contents of the object.
                 // TODO update persistent storage once AppendLog supports updates.
    -            warn!("skipping out-of-order object; random inserts not yet supported");
    +            warn!(
    +                index,
    +                len, target_len, "skipping out-of-order object; random inserts not yet supported"
    +            );
     
                 // Update the object in cache if necessary.
                 if index >= self.cache_start {
    @@ -671,18 +503,6 @@
             tracing::debug!("committing new version of LedgerLog");
             self.store.commit_version()?;
             self.pending_inserts = 0;
    -
    -        // Broadcast any newly-appended objects which extend the in-order available prefix.
    -        let mut i = self.stream_pos;
    -        let mut objects = self.iter().skip(i);
    -        while let Some(Some(obj)) = objects.next() {
    -            tracing::debug!("broadcasting new object {}", i);
    -            // Ignore errors on sending, it just means all listeners have dropped their handles.
    -            self.stream.send_async(obj).await.ok();
    -            i += 1;
    -        }
    -        self.stream_pos = i;
    -
             Ok(())
         }
     
    @@ -703,44 +523,6 @@
         }
     }
     
    -impl<T: Serialize + DeserializeOwned + Clone + Send + 'static> LedgerLog<T> {
    -    pub(crate) fn subscribe(&self, from: usize) -> Option<BoxStream<'static, T>> {
    -        tracing::debug!(
    -            "subcribing to objects from {}, stream_pos={}, len={}",
    -            from,
    -            self.stream_pos,
    -            self.iter().len()
    -        );
    -
    -        // A prefix of items are already available, from `from` to `self.stream_pos`. We can yield
    -        // these immediately.
    -        let prefix = self
    -            .iter()
    -            .skip(from)
    -            // `saturating_sub` handles the case where `from >= self.stream_pos`, in which case
    -            // `prefix` is empty.
    -            .take(self.stream_pos.saturating_sub(from))
    -            .collect::<Option<Vec<_>>>()?;
    -        // After the prefix comes the asynchronous stream of items yielded by `self.stream`. Convert
    -        // the receive handle for `self.stream` into an instance of `Stream`.
    -        let stream = stream::unfold(self.stream.handle_sync(), |mut handle| async move {
    -            match handle.recv_async().await {
    -                Ok(obj) => Some((obj, handle)),
    -                Err(_) => {
    -                    // An error in receive means the send end of the channel has been disconnected,
    -                    // which means the stream is over.
    -                    None
    -                }
    -            }
    -        });
    -        // Filter the asynchronous stream so that it starts at `self.stream_pos` or `from`,
    -        // whichever comes later.
    -        let rest = stream.skip(from.saturating_sub(self.stream_pos));
    -        // Return the concatenation of these two streams.
    -        Some(stream::iter(prefix).chain(rest).boxed())
    -    }
    -}
    -
     pub struct Iter<'a, T: Serialize + DeserializeOwned> {
         index: usize,
         cache_start: usize,
    @@ -899,77 +681,5 @@
             }
             assert_eq!(log.iter().nth(5), None);
         }
    -
    -    #[async_std::test]
    -    async fn test_ledger_log_subscribe() {
    -        setup_test();
    -
    -        let dir = TempDir::new("test_ledger_log").unwrap();
    -        let mut loader = AtomicStoreLoader::create(dir.path(), "test_ledger_log").unwrap();
    -        let mut log = LedgerLog::<u64>::create(&mut loader, "ledger", 3).unwrap();
    -        let mut store = AtomicStore::open(loader).unwrap();
    -
    -        log.store_resource(Some(0)).unwrap();
    -        log.commit_version().await.unwrap();
    -        store.commit_version().unwrap();
    -
    -        // Subscribe one stream starting from items that already exist and one stream starting from
    -        // the future.
    -        let mut past = log.subscribe(0).unwrap();
    -        let mut future = log.subscribe(1).unwrap();
    -        assert_eq!(past.next().await.unwrap(), 0);
    -
    -        // Store a new item, it should be reflected in both streams.
    -        log.store_resource(Some(1)).unwrap();
    -        log.commit_version().await.unwrap();
    -        store.commit_version().unwrap();
    -        assert_eq!(past.next().await.unwrap(), 1);
    -        assert_eq!(future.next().await.unwrap(), 1);
    -
    -        // Store two items out of order, they should be reflected in the streams in order.
    -        log.insert(3, 3).unwrap();
    -        log.commit_version().await.unwrap();
    -        store.commit_version().unwrap();
    -        log.insert(2, 2).unwrap();
    -        log.commit_version().await.unwrap();
    -        store.commit_version().unwrap();
    -        assert_eq!(past.next().await.unwrap(), 2);
    -        assert_eq!(future.next().await.unwrap(), 2);
    -        assert_eq!(past.next().await.unwrap(), 3);
    -        assert_eq!(future.next().await.unwrap(), 3);
    -
    -        // TODO enable out-of-order reloading tests once AppendLog supports out-of-order insertion
    -        // https://github.com/EspressoSystems/hotshot-query-service/issues/16
    -        // Store another item out of order, then reload the log from disk.
    -        // log.insert(5, 5).unwrap();
    -        // log.commit_version().await.unwrap();
    -        // store.commit_version().unwrap();
    -        // drop(log);
    -        // drop(store);
    -        // let mut loader = AtomicStoreLoader::load(dir.path(), "test_ledger_log").unwrap();
    -        // let mut log = LedgerLog::<u64>::open(&mut loader, "ledger", 3).unwrap();
    -        // let mut store = AtomicStore::open(loader).unwrap();
    -
    -        // // After reloading from disk, the in-order prefix of objects (0-3) should immediately be
    -        // // available.
    -        // assert_eq!(
    -        //     log.subscribe(0).unwrap().take(4).collect::<Vec<_>>().await,
    -        //     vec![0, 1, 2, 3]
    -        // );
    -
    -        // // The remaining items should become available once they can all be yielded in order.
    -        // log.insert(4, 4).unwrap();
    -        // log.commit_version().await.unwrap();
    -        // store.commit_version().unwrap();
    -        // assert_eq!(
    -        //     log.subscribe(0).unwrap().take(6).collect::<Vec<_>>().await,
    -        //     vec![0, 1, 2, 3, 4, 5]
    -        // );
    -
    -        // // Dropping the log should terminate the stream.
    -        // let stream = log.subscribe(0).unwrap();
    -        // drop(log);
    -        // assert_eq!(stream.collect::<Vec<_>>().await, vec![0, 1, 2, 3, 4, 5]);
    -    }
     }
     
    \ No newline at end of file diff --git a/src/hotshot_query_service/data_source/storage/sql.rs.html b/src/hotshot_query_service/data_source/storage/sql.rs.html new file mode 100644 index 000000000..e2bf891ff --- /dev/null +++ b/src/hotshot_query_service/data_source/storage/sql.rs.html @@ -0,0 +1,2591 @@ +sql.rs - source
    1
    +2
    +3
    +4
    +5
    +6
    +7
    +8
    +9
    +10
    +11
    +12
    +13
    +14
    +15
    +16
    +17
    +18
    +19
    +20
    +21
    +22
    +23
    +24
    +25
    +26
    +27
    +28
    +29
    +30
    +31
    +32
    +33
    +34
    +35
    +36
    +37
    +38
    +39
    +40
    +41
    +42
    +43
    +44
    +45
    +46
    +47
    +48
    +49
    +50
    +51
    +52
    +53
    +54
    +55
    +56
    +57
    +58
    +59
    +60
    +61
    +62
    +63
    +64
    +65
    +66
    +67
    +68
    +69
    +70
    +71
    +72
    +73
    +74
    +75
    +76
    +77
    +78
    +79
    +80
    +81
    +82
    +83
    +84
    +85
    +86
    +87
    +88
    +89
    +90
    +91
    +92
    +93
    +94
    +95
    +96
    +97
    +98
    +99
    +100
    +101
    +102
    +103
    +104
    +105
    +106
    +107
    +108
    +109
    +110
    +111
    +112
    +113
    +114
    +115
    +116
    +117
    +118
    +119
    +120
    +121
    +122
    +123
    +124
    +125
    +126
    +127
    +128
    +129
    +130
    +131
    +132
    +133
    +134
    +135
    +136
    +137
    +138
    +139
    +140
    +141
    +142
    +143
    +144
    +145
    +146
    +147
    +148
    +149
    +150
    +151
    +152
    +153
    +154
    +155
    +156
    +157
    +158
    +159
    +160
    +161
    +162
    +163
    +164
    +165
    +166
    +167
    +168
    +169
    +170
    +171
    +172
    +173
    +174
    +175
    +176
    +177
    +178
    +179
    +180
    +181
    +182
    +183
    +184
    +185
    +186
    +187
    +188
    +189
    +190
    +191
    +192
    +193
    +194
    +195
    +196
    +197
    +198
    +199
    +200
    +201
    +202
    +203
    +204
    +205
    +206
    +207
    +208
    +209
    +210
    +211
    +212
    +213
    +214
    +215
    +216
    +217
    +218
    +219
    +220
    +221
    +222
    +223
    +224
    +225
    +226
    +227
    +228
    +229
    +230
    +231
    +232
    +233
    +234
    +235
    +236
    +237
    +238
    +239
    +240
    +241
    +242
    +243
    +244
    +245
    +246
    +247
    +248
    +249
    +250
    +251
    +252
    +253
    +254
    +255
    +256
    +257
    +258
    +259
    +260
    +261
    +262
    +263
    +264
    +265
    +266
    +267
    +268
    +269
    +270
    +271
    +272
    +273
    +274
    +275
    +276
    +277
    +278
    +279
    +280
    +281
    +282
    +283
    +284
    +285
    +286
    +287
    +288
    +289
    +290
    +291
    +292
    +293
    +294
    +295
    +296
    +297
    +298
    +299
    +300
    +301
    +302
    +303
    +304
    +305
    +306
    +307
    +308
    +309
    +310
    +311
    +312
    +313
    +314
    +315
    +316
    +317
    +318
    +319
    +320
    +321
    +322
    +323
    +324
    +325
    +326
    +327
    +328
    +329
    +330
    +331
    +332
    +333
    +334
    +335
    +336
    +337
    +338
    +339
    +340
    +341
    +342
    +343
    +344
    +345
    +346
    +347
    +348
    +349
    +350
    +351
    +352
    +353
    +354
    +355
    +356
    +357
    +358
    +359
    +360
    +361
    +362
    +363
    +364
    +365
    +366
    +367
    +368
    +369
    +370
    +371
    +372
    +373
    +374
    +375
    +376
    +377
    +378
    +379
    +380
    +381
    +382
    +383
    +384
    +385
    +386
    +387
    +388
    +389
    +390
    +391
    +392
    +393
    +394
    +395
    +396
    +397
    +398
    +399
    +400
    +401
    +402
    +403
    +404
    +405
    +406
    +407
    +408
    +409
    +410
    +411
    +412
    +413
    +414
    +415
    +416
    +417
    +418
    +419
    +420
    +421
    +422
    +423
    +424
    +425
    +426
    +427
    +428
    +429
    +430
    +431
    +432
    +433
    +434
    +435
    +436
    +437
    +438
    +439
    +440
    +441
    +442
    +443
    +444
    +445
    +446
    +447
    +448
    +449
    +450
    +451
    +452
    +453
    +454
    +455
    +456
    +457
    +458
    +459
    +460
    +461
    +462
    +463
    +464
    +465
    +466
    +467
    +468
    +469
    +470
    +471
    +472
    +473
    +474
    +475
    +476
    +477
    +478
    +479
    +480
    +481
    +482
    +483
    +484
    +485
    +486
    +487
    +488
    +489
    +490
    +491
    +492
    +493
    +494
    +495
    +496
    +497
    +498
    +499
    +500
    +501
    +502
    +503
    +504
    +505
    +506
    +507
    +508
    +509
    +510
    +511
    +512
    +513
    +514
    +515
    +516
    +517
    +518
    +519
    +520
    +521
    +522
    +523
    +524
    +525
    +526
    +527
    +528
    +529
    +530
    +531
    +532
    +533
    +534
    +535
    +536
    +537
    +538
    +539
    +540
    +541
    +542
    +543
    +544
    +545
    +546
    +547
    +548
    +549
    +550
    +551
    +552
    +553
    +554
    +555
    +556
    +557
    +558
    +559
    +560
    +561
    +562
    +563
    +564
    +565
    +566
    +567
    +568
    +569
    +570
    +571
    +572
    +573
    +574
    +575
    +576
    +577
    +578
    +579
    +580
    +581
    +582
    +583
    +584
    +585
    +586
    +587
    +588
    +589
    +590
    +591
    +592
    +593
    +594
    +595
    +596
    +597
    +598
    +599
    +600
    +601
    +602
    +603
    +604
    +605
    +606
    +607
    +608
    +609
    +610
    +611
    +612
    +613
    +614
    +615
    +616
    +617
    +618
    +619
    +620
    +621
    +622
    +623
    +624
    +625
    +626
    +627
    +628
    +629
    +630
    +631
    +632
    +633
    +634
    +635
    +636
    +637
    +638
    +639
    +640
    +641
    +642
    +643
    +644
    +645
    +646
    +647
    +648
    +649
    +650
    +651
    +652
    +653
    +654
    +655
    +656
    +657
    +658
    +659
    +660
    +661
    +662
    +663
    +664
    +665
    +666
    +667
    +668
    +669
    +670
    +671
    +672
    +673
    +674
    +675
    +676
    +677
    +678
    +679
    +680
    +681
    +682
    +683
    +684
    +685
    +686
    +687
    +688
    +689
    +690
    +691
    +692
    +693
    +694
    +695
    +696
    +697
    +698
    +699
    +700
    +701
    +702
    +703
    +704
    +705
    +706
    +707
    +708
    +709
    +710
    +711
    +712
    +713
    +714
    +715
    +716
    +717
    +718
    +719
    +720
    +721
    +722
    +723
    +724
    +725
    +726
    +727
    +728
    +729
    +730
    +731
    +732
    +733
    +734
    +735
    +736
    +737
    +738
    +739
    +740
    +741
    +742
    +743
    +744
    +745
    +746
    +747
    +748
    +749
    +750
    +751
    +752
    +753
    +754
    +755
    +756
    +757
    +758
    +759
    +760
    +761
    +762
    +763
    +764
    +765
    +766
    +767
    +768
    +769
    +770
    +771
    +772
    +773
    +774
    +775
    +776
    +777
    +778
    +779
    +780
    +781
    +782
    +783
    +784
    +785
    +786
    +787
    +788
    +789
    +790
    +791
    +792
    +793
    +794
    +795
    +796
    +797
    +798
    +799
    +800
    +801
    +802
    +803
    +804
    +805
    +806
    +807
    +808
    +809
    +810
    +811
    +812
    +813
    +814
    +815
    +816
    +817
    +818
    +819
    +820
    +821
    +822
    +823
    +824
    +825
    +826
    +827
    +828
    +829
    +830
    +831
    +832
    +833
    +834
    +835
    +836
    +837
    +838
    +839
    +840
    +841
    +842
    +843
    +844
    +845
    +846
    +847
    +848
    +849
    +850
    +851
    +852
    +853
    +854
    +855
    +856
    +857
    +858
    +859
    +860
    +861
    +862
    +863
    +864
    +865
    +866
    +867
    +868
    +869
    +870
    +871
    +872
    +873
    +874
    +875
    +876
    +877
    +878
    +879
    +880
    +881
    +882
    +883
    +884
    +885
    +886
    +887
    +888
    +889
    +890
    +891
    +892
    +893
    +894
    +895
    +896
    +897
    +898
    +899
    +900
    +901
    +902
    +903
    +904
    +905
    +906
    +907
    +908
    +909
    +910
    +911
    +912
    +913
    +914
    +915
    +916
    +917
    +918
    +919
    +920
    +921
    +922
    +923
    +924
    +925
    +926
    +927
    +928
    +929
    +930
    +931
    +932
    +933
    +934
    +935
    +936
    +937
    +938
    +939
    +940
    +941
    +942
    +943
    +944
    +945
    +946
    +947
    +948
    +949
    +950
    +951
    +952
    +953
    +954
    +955
    +956
    +957
    +958
    +959
    +960
    +961
    +962
    +963
    +964
    +965
    +966
    +967
    +968
    +969
    +970
    +971
    +972
    +973
    +974
    +975
    +976
    +977
    +978
    +979
    +980
    +981
    +982
    +983
    +984
    +985
    +986
    +987
    +988
    +989
    +990
    +991
    +992
    +993
    +994
    +995
    +996
    +997
    +998
    +999
    +1000
    +1001
    +1002
    +1003
    +1004
    +1005
    +1006
    +1007
    +1008
    +1009
    +1010
    +1011
    +1012
    +1013
    +1014
    +1015
    +1016
    +1017
    +1018
    +1019
    +1020
    +1021
    +1022
    +1023
    +1024
    +1025
    +1026
    +1027
    +1028
    +1029
    +1030
    +1031
    +1032
    +1033
    +1034
    +1035
    +1036
    +1037
    +1038
    +1039
    +1040
    +1041
    +1042
    +1043
    +1044
    +1045
    +1046
    +1047
    +1048
    +1049
    +1050
    +1051
    +1052
    +1053
    +1054
    +1055
    +1056
    +1057
    +1058
    +1059
    +1060
    +1061
    +1062
    +1063
    +1064
    +1065
    +1066
    +1067
    +1068
    +1069
    +1070
    +1071
    +1072
    +1073
    +1074
    +1075
    +1076
    +1077
    +1078
    +1079
    +1080
    +1081
    +1082
    +1083
    +1084
    +1085
    +1086
    +1087
    +1088
    +1089
    +1090
    +1091
    +1092
    +1093
    +1094
    +1095
    +1096
    +1097
    +1098
    +1099
    +1100
    +1101
    +1102
    +1103
    +1104
    +1105
    +1106
    +1107
    +1108
    +1109
    +1110
    +1111
    +1112
    +1113
    +1114
    +1115
    +1116
    +1117
    +1118
    +1119
    +1120
    +1121
    +1122
    +1123
    +1124
    +1125
    +1126
    +1127
    +1128
    +1129
    +1130
    +1131
    +1132
    +1133
    +1134
    +1135
    +1136
    +1137
    +1138
    +1139
    +1140
    +1141
    +1142
    +1143
    +1144
    +1145
    +1146
    +1147
    +1148
    +1149
    +1150
    +1151
    +1152
    +1153
    +1154
    +1155
    +1156
    +1157
    +1158
    +1159
    +1160
    +1161
    +1162
    +1163
    +1164
    +1165
    +1166
    +1167
    +1168
    +1169
    +1170
    +1171
    +1172
    +1173
    +1174
    +1175
    +1176
    +1177
    +1178
    +1179
    +1180
    +1181
    +1182
    +1183
    +1184
    +1185
    +1186
    +1187
    +1188
    +1189
    +1190
    +1191
    +1192
    +1193
    +1194
    +1195
    +1196
    +1197
    +1198
    +1199
    +1200
    +1201
    +1202
    +1203
    +1204
    +1205
    +1206
    +1207
    +1208
    +1209
    +1210
    +1211
    +1212
    +1213
    +1214
    +1215
    +1216
    +1217
    +1218
    +1219
    +1220
    +1221
    +1222
    +1223
    +1224
    +1225
    +1226
    +1227
    +1228
    +1229
    +1230
    +1231
    +1232
    +1233
    +1234
    +1235
    +1236
    +1237
    +1238
    +1239
    +1240
    +1241
    +1242
    +1243
    +1244
    +1245
    +1246
    +1247
    +1248
    +1249
    +1250
    +1251
    +1252
    +1253
    +1254
    +1255
    +1256
    +1257
    +1258
    +1259
    +1260
    +1261
    +1262
    +1263
    +1264
    +1265
    +1266
    +1267
    +1268
    +1269
    +1270
    +1271
    +1272
    +1273
    +1274
    +1275
    +1276
    +1277
    +1278
    +1279
    +1280
    +1281
    +1282
    +1283
    +1284
    +1285
    +1286
    +1287
    +1288
    +1289
    +1290
    +1291
    +1292
    +1293
    +1294
    +1295
    +
    // Copyright (c) 2022 Espresso Systems (espressosys.com)
    +// This file is part of the HotShot Query Service library.
    +//
    +// This program is free software: you can redistribute it and/or modify it under the terms of the GNU
    +// General Public License as published by the Free Software Foundation, either version 3 of the
    +// License, or (at your option) any later version.
    +// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
    +// even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    +// General Public License for more details.
    +// You should have received a copy of the GNU General Public License along with this program. If not,
    +// see <https://www.gnu.org/licenses/>.
    +
    +#![cfg(feature = "sql-data-source")]
    +
    +use super::AvailabilityStorage;
    +use crate::{
    +    availability::{
    +        BlockId, BlockQueryData, LeafId, LeafQueryData, QueryablePayload, ResourceId,
    +        TransactionHash, TransactionIndex, UpdateAvailabilityData,
    +    },
    +    data_source::VersionedDataSource,
    +    node::{NodeDataSource, UpdateNodeData},
    +    Header, Leaf, MissingSnafu, NotFoundSnafu, Payload, QueryError, QueryResult, SignatureKey,
    +};
    +use async_std::{net::ToSocketAddrs, sync::Arc, task::spawn};
    +use async_trait::async_trait;
    +use commit::Committable;
    +use futures::{
    +    channel::oneshot,
    +    future::{select, Either, FutureExt},
    +    stream::{BoxStream, StreamExt, TryStreamExt},
    +    task::{Context, Poll},
    +    AsyncRead, AsyncWrite,
    +};
    +use hotshot_types::{
    +    simple_certificate::QuorumCertificate,
    +    traits::{
    +        block_contents::{BlockHeader, BlockPayload},
    +        node_implementation::NodeType,
    +    },
    +};
    +use itertools::Itertools;
    +use postgres_native_tls::TlsConnector;
    +use snafu::OptionExt;
    +use std::{
    +    borrow::Cow,
    +    ops::{Bound, RangeBounds},
    +    pin::Pin,
    +    str::FromStr,
    +};
    +use tokio_postgres::{
    +    config::Host,
    +    tls::TlsConnect,
    +    types::{BorrowToSql, ToSql},
    +    Client, NoTls, Row, ToStatement,
    +};
    +
    +pub use crate::include_migrations;
    +pub use anyhow::Error;
    +pub use refinery::Migration;
    +pub use tokio_postgres as postgres;
    +
    +// This needs to be reexported so that we can reference it by absolute path relative to this crate
    +// in the expansion of `include_migrations`, even when `include_migrations` is invoked from another
    +// crate which doesn't have `include_dir` as a dependency.
    +pub use include_dir::include_dir;
    +
    +/// Embed migrations from the given directory into the current binary.
    +///
    +/// The macro invocation `include_migrations!(path)` evaluates to an expression of type `impl
    +/// Iterator<Item = Migration>`. Each migration must be a text file which is an immediate child of
    +/// `path`, and there must be no non-migration files in `path`. The migration files must have names
    +/// of the form `V${version}__${name}.sql`, where `version` is a positive integer indicating how the
    +/// migration is to be ordered relative to other migrations, and `name` is a descriptive name for
    +/// the migration.
    +///
    +/// `path` should be an absolute path. It is possible to give a path relative to the root of the
    +/// invoking crate by using environment variable expansions and the `CARGO_MANIFEST_DIR` environment
    +/// variable.
    +///
    +/// As an example, this is the invocation used to load the default migrations from the
    +/// `hotshot-query-service` crate. The migrations are located in a directory called `migrations` at
    +/// the root of the crate.
    +///
    +/// ```
    +/// # use hotshot_query_service::data_source::sql::{include_migrations, Migration};
    +/// let migrations: Vec<Migration> = include_migrations!("$CARGO_MANIFEST_DIR/migrations").collect();
    +/// assert_eq!(migrations[0].version(), 10);
    +/// assert_eq!(migrations[0].name(), "init_schema");
    +/// ```
    +///
    +/// Note that a similar macro is available from Refinery:
    +/// [embed_migrations](https://docs.rs/refinery/0.8.11/refinery/macro.embed_migrations.html). This
    +/// macro differs in that it evaluates to an iterator of [migrations](Migration), making it an
    +/// expression macro, while `embed_migrations` is a statement macro that defines a module which
    +/// provides access to the embedded migrations only indirectly via a
    +/// [`Runner`](https://docs.rs/refinery/0.8.11/refinery/struct.Runner.html). The direct access to
    +/// migrations provided by [`include_migrations`] makes this macro easier to use with
    +/// [`Config::migrations`], for combining custom migrations with [`default_migrations`].
    +#[macro_export]
    +macro_rules! include_migrations {
    +    ($dir:tt) => {
    +        $crate::data_source::storage::sql::include_dir!($dir)
    +            .files()
    +            .map(|file| {
    +                let path = file.path();
    +                let name = path
    +                    .file_name()
    +                    .and_then(std::ffi::OsStr::to_str)
    +                    .unwrap_or_else(|| {
    +                        panic!(
    +                            "migration file {} must have a non-empty UTF-8 name",
    +                            path.display()
    +                        )
    +                    });
    +                let sql = file
    +                    .contents_utf8()
    +                    .unwrap_or_else(|| panic!("migration file {name} must use UTF-8 encoding"));
    +                $crate::data_source::storage::sql::Migration::unapplied(name, sql)
    +                    .expect("invalid migration")
    +            })
    +    };
    +}
    +
    +/// The migrations requied to build the default schema for this version of [`SqlStorage`].
    +pub fn default_migrations() -> Vec<Migration> {
    +    let mut migrations = include_migrations!("$CARGO_MANIFEST_DIR/migrations").collect::<Vec<_>>();
    +
    +    // Check version uniqueness and sort by version.
    +    validate_migrations(&mut migrations).expect("default migrations are invalid");
    +
    +    // Check that all migration versions are multiples of 10, so that custom migrations can be
    +    // inserted in between.
    +    for m in &migrations {
    +        if m.version() == 0 || m.version() % 10 != 0 {
    +            panic!(
    +                "default migration version {} is not a positive multiple of 10",
    +                m.version()
    +            );
    +        }
    +    }
    +
    +    migrations
    +}
    +
    +/// Validate and preprocess a sequence of migrations.
    +///
    +/// * Ensure all migrations have distinct versions
    +/// * Ensure migrations are sorted by increasing version
    +fn validate_migrations(migrations: &mut [Migration]) -> Result<(), Error> {
    +    migrations.sort_by_key(|m| m.version());
    +
    +    // Check version uniqueness.
    +    for (prev, next) in migrations.iter().zip(migrations.iter().skip(1)) {
    +        if next <= prev {
    +            return Err(Error::msg(format!(
    +                "migration versions are not strictly increasing ({prev}->{next})"
    +            )));
    +        }
    +    }
    +
    +    Ok(())
    +}
    +
    +/// Add custom migrations to a default migration sequence.
    +///
    +/// Migrations in `custom` replace migrations in `default` with the same version. Otherwise, the two
    +/// sequences `default` and `custom` are merged so that the resulting sequence is sorted by
    +/// ascending version number. Each of `default` and `custom` is assumed to be the output of
    +/// [`validate_migrations`]; that is, each is sorted by version and contains no duplicate versions.
    +fn add_custom_migrations(
    +    default: impl IntoIterator<Item = Migration>,
    +    custom: impl IntoIterator<Item = Migration>,
    +) -> impl Iterator<Item = Migration> {
    +    default
    +        .into_iter()
    +        // Merge sorted lists, joining pairs of equal version into `EitherOrBoth::Both`.
    +        .merge_join_by(custom, |l, r| l.version().cmp(&r.version()))
    +        // Prefer the custom migration for a given version when both default and custom versions
    +        // are present.
    +        .map(|pair| pair.reduce(|_, custom| custom))
    +}
    +
    +/// Postgres client config.
    +#[derive(Clone, Debug)]
    +pub struct Config {
    +    pgcfg: postgres::Config,
    +    host: String,
    +    port: u16,
    +    schema: String,
    +    reset: bool,
    +    migrations: Vec<Migration>,
    +    no_migrations: bool,
    +    tls: bool,
    +}
    +
    +impl Default for Config {
    +    fn default() -> Self {
    +        Self {
    +            pgcfg: Default::default(),
    +            host: "localhost".into(),
    +            port: 5432,
    +            schema: "hotshot".into(),
    +            reset: false,
    +            migrations: vec![],
    +            no_migrations: false,
    +            tls: false,
    +        }
    +    }
    +}
    +
    +impl From<postgres::Config> for Config {
    +    fn from(pgcfg: postgres::Config) -> Self {
    +        // We connect via TCP manually, without using the host and port from pgcfg. So we need to
    +        // pull those out of pgcfg if they have been specified, to override the defaults.
    +        let host = match pgcfg.get_hosts().first() {
    +            Some(Host::Tcp(host)) => host.to_string(),
    +            _ => "localhost".into(),
    +        };
    +        let port = *pgcfg.get_ports().first().unwrap_or(&5432);
    +        Self {
    +            pgcfg,
    +            host,
    +            port,
    +            ..Default::default()
    +        }
    +    }
    +}
    +
    +impl FromStr for Config {
    +    type Err = <postgres::Config as FromStr>::Err;
    +
    +    fn from_str(s: &str) -> Result<Self, Self::Err> {
    +        Ok(postgres::Config::from_str(s)?.into())
    +    }
    +}
    +
    +impl Config {
    +    /// Set the hostname of the database server.
    +    ///
    +    /// The default is `localhost`.
    +    pub fn host(mut self, host: impl Into<String>) -> Self {
    +        self.host = host.into();
    +        self
    +    }
    +
    +    /// Set the port on which to connect to the database.
    +    ///
    +    /// The default is 5432, the default Postgres port.
    +    pub fn port(mut self, port: u16) -> Self {
    +        self.port = port;
    +        self
    +    }
    +
    +    /// Set the DB user to connect as.
    +    pub fn user(mut self, user: &str) -> Self {
    +        self.pgcfg.user(user);
    +        self
    +    }
    +
    +    /// Set a password for connecting to the database.
    +    pub fn password(mut self, password: &str) -> Self {
    +        self.pgcfg.password(password);
    +        self
    +    }
    +
    +    /// Set the name of the database to connect to.
    +    pub fn database(mut self, database: &str) -> Self {
    +        self.pgcfg.dbname(database);
    +        self
    +    }
    +
    +    /// Set the name of the schema to use for queries.
    +    ///
    +    /// The default schema is named `hotshot` and is created via the default migrations.
    +    pub fn schema(mut self, schema: impl Into<String>) -> Self {
    +        self.schema = schema.into();
    +        self
    +    }
    +
    +    /// Reset the schema on connection.
    +    ///
    +    /// When this [`Config`] is used to [`connect`](Self::connect) a
    +    /// [`SqlDataSource`](crate::data_source::SqlDataSource), if this option is set, the relevant
    +    /// [`schema`](Self::schema) will first be dropped and then recreated, yielding a completely
    +    /// fresh instance of the query service.
    +    ///
    +    /// This is a particularly useful capability for development and staging environments. Still, it
    +    /// must be used with extreme caution, as using this will irrevocably delete any data pertaining
    +    /// to the query service in the database.
    +    pub fn reset_schema(mut self) -> Self {
    +        self.reset = true;
    +        self
    +    }
    +
    +    /// Add custom migrations to run when connecting to the database.
    +    pub fn migrations(mut self, migrations: impl IntoIterator<Item = Migration>) -> Self {
    +        self.migrations.extend(migrations);
    +        self
    +    }
    +
    +    /// Skip all migrations when connecting to the database.
    +    pub fn no_migrations(mut self) -> Self {
    +        self.no_migrations = true;
    +        self
    +    }
    +
    +    /// Use TLS for an encrypted connection to the database.
    +    pub fn tls(mut self) -> Self {
    +        self.tls = true;
    +        self
    +    }
    +}
    +
    +/// Storage for the APIs provided in this crate, backed by a remote PostgreSQL database.
    +#[derive(Debug)]
    +pub struct SqlStorage {
    +    client: Arc<Client>,
    +    tx_in_progress: bool,
    +    kill: Option<oneshot::Sender<()>>,
    +}
    +
    +impl SqlStorage {
    +    /// Connect to a remote database.
    +    pub async fn connect(mut config: Config) -> Result<Self, Error> {
    +        // Establish a TCP connection to the server.
    +        let tcp = TcpStream::connect((config.host.as_str(), config.port)).await?;
    +
    +        // Convert the TCP connection into a postgres connection.
    +        let (mut client, kill) = if config.tls {
    +            let tls = TlsConnector::new(native_tls::TlsConnector::new()?, config.host.as_str());
    +            connect(config.pgcfg, tcp, tls).await?
    +        } else {
    +            connect(config.pgcfg, tcp, NoTls).await?
    +        };
    +
    +        // Create or connect to the schema for this query service.
    +        if config.reset {
    +            client
    +                .batch_execute(&format!("DROP SCHEMA IF EXISTS {} CASCADE", config.schema))
    +                .await?;
    +        }
    +        client
    +            .batch_execute(&format!("CREATE SCHEMA IF NOT EXISTS {}", config.schema))
    +            .await?;
    +        client
    +            .batch_execute(&format!("SET search_path TO {}", config.schema))
    +            .await?;
    +
    +        // Get migrations and interleave with custom migrations, sorting by version number.
    +        validate_migrations(&mut config.migrations)?;
    +        let migrations =
    +            add_custom_migrations(default_migrations(), config.migrations).collect::<Vec<_>>();
    +
    +        // Get a migration runner. Depending on the config, we can either use this to actually run
    +        // the migrations or just check if the database is up to date.
    +        let runner = refinery::Runner::new(&migrations).set_grouped(true);
    +
    +        if config.no_migrations {
    +            // We've been asked not to run any migrations. Abort if the DB is not already up to
    +            // date.
    +            let last_applied = runner.get_last_applied_migration_async(&mut client).await?;
    +            let last_expected = migrations.last();
    +            if last_applied.as_ref() != last_expected {
    +                return Err(Error::msg(format!("DB is out of date: last applied migration is {last_applied:?}, but expected {last_expected:?}")));
    +            }
    +        } else {
    +            // Run migrations using `refinery`.
    +            match runner.run_async(&mut client).await {
    +                Ok(report) => {
    +                    tracing::info!("ran DB migrations: {report:?}");
    +                }
    +                Err(err) => {
    +                    tracing::error!("DB migrations failed: {:?}", err.report());
    +                    Err(err)?;
    +                }
    +            }
    +        }
    +
    +        Ok(Self {
    +            client: Arc::new(client),
    +            tx_in_progress: false,
    +            kill: Some(kill),
    +        })
    +    }
    +}
    +
    +impl SqlStorage {
    +    /// Access the transaction which is accumulating all uncommitted changes to the data source.
    +    pub async fn transaction(&mut self) -> QueryResult<Transaction<'_>> {
    +        if !self.tx_in_progress {
    +            // If there is no transaction in progress, open one.
    +            self.client
    +                .batch_execute("BEGIN")
    +                .await
    +                .map_err(postgres_err)?;
    +            self.tx_in_progress = true;
    +        }
    +        Ok(Transaction {
    +            client: Cow::Borrowed(&self.client),
    +        })
    +    }
    +}
    +
    +#[async_trait]
    +impl Query for SqlStorage {
    +    async fn client(&self) -> Cow<Arc<Client>> {
    +        Cow::Borrowed(&self.client)
    +    }
    +}
    +
    +impl Drop for SqlStorage {
    +    fn drop(&mut self) {
    +        if let Some(kill) = self.kill.take() {
    +            // Ignore errors, they just mean the task has already exited.
    +            kill.send(()).ok();
    +        }
    +    }
    +}
    +
    +#[async_trait]
    +impl VersionedDataSource for SqlStorage {
    +    type Error = postgres::error::Error;
    +
    +    async fn commit(&mut self) -> Result<(), Self::Error> {
    +        if self.tx_in_progress {
    +            self.client.batch_execute("COMMIT").await?;
    +            self.tx_in_progress = false;
    +        }
    +        Ok(())
    +    }
    +
    +    async fn revert(&mut self) {
    +        if self.tx_in_progress {
    +            // If we're trying to roll back a transaction, something has already gone wrong and
    +            // we're trying to recover. If we're unable to revert the changes and recover, all we
    +            // can do is panic.
    +            self.client
    +                .batch_execute("ROLLBACK")
    +                .await
    +                .expect("DB rollback succeeds");
    +            self.tx_in_progress = false;
    +        }
    +    }
    +}
    +
    +#[async_trait]
    +impl<Types> AvailabilityStorage<Types> for SqlStorage
    +where
    +    Types: NodeType,
    +    Payload<Types>: QueryablePayload,
    +{
    +    async fn get_leaf(&self, id: LeafId<Types>) -> QueryResult<LeafQueryData<Types>> {
    +        let (where_clause, param): (&str, Box<dyn ToSql + Send + Sync>) = match id {
    +            ResourceId::Number(n) => ("height = $1", Box::new(n as i64)),
    +            ResourceId::Hash(h) => ("hash = $1", Box::new(h.to_string())),
    +        };
    +        let query = format!("SELECT leaf, qc FROM leaf WHERE {where_clause}");
    +        let row = self.query_one(&query, [param]).await?;
    +        parse_leaf(row)
    +    }
    +
    +    async fn get_block(&self, id: BlockId<Types>) -> QueryResult<BlockQueryData<Types>> {
    +        let (where_clause, param): (&str, Box<dyn ToSql + Send + Sync>) = match id {
    +            ResourceId::Number(n) => ("h.height = $1", Box::new(n as i64)),
    +            ResourceId::Hash(h) => ("h.hash = $1", Box::new(h.to_string())),
    +        };
    +        let query = format!(
    +            "SELECT {BLOCK_COLUMNS}
    +              FROM header AS h
    +              JOIN payload AS p ON h.height = p.height
    +              WHERE {where_clause}
    +              LIMIT 1"
    +        );
    +        let row = self.query_one(&query, [param]).await?;
    +        parse_block(row)
    +    }
    +
    +    async fn get_leaf_range<R>(
    +        &self,
    +        range: R,
    +    ) -> QueryResult<Vec<QueryResult<LeafQueryData<Types>>>>
    +    where
    +        R: RangeBounds<usize> + Send,
    +    {
    +        let (where_clause, params) = bounds_to_where_clause(range, "height");
    +        let query = format!("SELECT leaf, qc FROM leaf {where_clause} ORDER BY height ASC");
    +        let rows = self.query(&query, params).await?;
    +
    +        Ok(rows.map(|res| parse_leaf(res?)).collect().await)
    +    }
    +
    +    async fn get_block_range<R>(
    +        &self,
    +        range: R,
    +    ) -> QueryResult<Vec<QueryResult<BlockQueryData<Types>>>>
    +    where
    +        R: RangeBounds<usize> + Send,
    +    {
    +        let (where_clause, params) = bounds_to_where_clause(range, "h.height");
    +        let query = format!(
    +            "SELECT {BLOCK_COLUMNS}
    +              FROM header AS h
    +              JOIN payload AS p ON h.height = p.height
    +              {where_clause}
    +              ORDER BY h.height ASC"
    +        );
    +        let rows = self.query(&query, params).await?;
    +
    +        Ok(rows.map(|res| parse_block(res?)).collect().await)
    +    }
    +
    +    async fn get_block_with_transaction(
    +        &self,
    +        hash: TransactionHash<Types>,
    +    ) -> QueryResult<(BlockQueryData<Types>, TransactionIndex<Types>)> {
    +        // ORDER BY t.id ASC ensures that if there are duplicate transactions, we return the first
    +        // one.
    +        let query = format!(
    +            "SELECT {BLOCK_COLUMNS}, t.index AS tx_index
    +                FROM header AS h
    +                JOIN payload AS p ON h.height = p.height
    +                JOIN transaction AS t ON t.block_height = h.height
    +                WHERE t.hash = $1
    +                ORDER BY t.id ASC
    +                LIMIT 1"
    +        );
    +        let row = self.query_one(&query, &[&hash.to_string()]).await?;
    +
    +        // Extract the transaction index.
    +        let index = row.try_get("tx_index").map_err(|err| QueryError::Error {
    +            message: format!("error extracting transaction index from query results: {err}"),
    +        })?;
    +        let index: TransactionIndex<Types> =
    +            serde_json::from_value(index).map_err(|err| QueryError::Error {
    +                message: format!("malformed transaction index: {err}"),
    +            })?;
    +
    +        // Extract the block.
    +        let block = parse_block(row)?;
    +
    +        Ok((block, index))
    +    }
    +}
    +
    +#[async_trait]
    +impl<Types> UpdateAvailabilityData<Types> for SqlStorage
    +where
    +    Types: NodeType,
    +    Payload<Types>: QueryablePayload,
    +{
    +    type Error = QueryError;
    +
    +    async fn insert_leaf(&mut self, leaf: LeafQueryData<Types>) -> Result<(), Self::Error> {
    +        let mut stmts: Vec<(String, Vec<Box<dyn ToSql + Send + Sync>>)> = vec![];
    +
    +        // While we don't necessarily have the full block for this leaf yet, we can initialize the
    +        // header table with block metadata taken from the leaf.
    +        let header_json =
    +            serde_json::to_value(&leaf.leaf().block_header).map_err(|err| QueryError::Error {
    +                message: format!("failed to serialize header: {err}"),
    +            })?;
    +        stmts.push((
    +            "INSERT INTO header (height, hash, data) VALUES ($1, $2, $3)".into(),
    +            vec![
    +                Box::new(leaf.height() as i64),
    +                Box::new(leaf.block_hash().to_string()),
    +                Box::new(header_json),
    +            ],
    +        ));
    +
    +        // Similarly, we can initialize the payload table with a null payload, which can help us
    +        // distinguish between blocks that haven't been produced yet and blocks we haven't received
    +        // yet when answering queries.
    +        stmts.push((
    +            "INSERT INTO payload (height) VALUES ($1)".into(),
    +            vec![Box::new(leaf.height() as i64)],
    +        ));
    +
    +        // Finally, we insert the leaf itself, which references the header row we created.
    +        // Serialize the full leaf and QC to JSON for easy storage.
    +        let leaf_json = serde_json::to_value(leaf.leaf()).map_err(|err| QueryError::Error {
    +            message: format!("failed to serialize leaf: {err}"),
    +        })?;
    +        let qc_json = serde_json::to_value(leaf.qc()).map_err(|err| QueryError::Error {
    +            message: format!("failed to serialize QC: {err}"),
    +        })?;
    +        let proposer_json =
    +            serde_json::to_value(&leaf.proposer()).map_err(|err| QueryError::Error {
    +                message: format!("failed to serialize proposer ID: {err}"),
    +            })?;
    +        stmts.push((
    +            "INSERT INTO leaf (height, hash, proposer, block_hash, leaf, qc)
    +             VALUES ($1, $2, $3, $4, $5, $6)"
    +                .into(),
    +            vec![
    +                Box::new(leaf.height() as i64),
    +                Box::new(leaf.hash().to_string()),
    +                Box::new(proposer_json),
    +                Box::new(leaf.block_hash().to_string()),
    +                Box::new(leaf_json),
    +                Box::new(qc_json),
    +            ],
    +        ));
    +
    +        // Grab a transaction and execute all the statements.
    +        let mut tx = self.transaction().await?;
    +        tx.execute_many(stmts).await?;
    +
    +        Ok(())
    +    }
    +
    +    async fn insert_block(&mut self, block: BlockQueryData<Types>) -> Result<(), Self::Error> {
    +        let mut stmts: Vec<(String, Vec<Box<dyn ToSql + Send + Sync>>)> = vec![];
    +
    +        // The header and payload tables should already have been initialized when we inserted the
    +        // corresponding leaf. All we have to do is add the payload itself and its size.
    +        let payload = block
    +            .payload
    +            .encode()
    +            .map_err(|err| QueryError::Error {
    +                message: format!("failed to serialize block: {err}"),
    +            })?
    +            .collect::<Vec<_>>();
    +        stmts.push((
    +            "UPDATE payload SET (data, size) = ($1, $2) WHERE height = $3".into(),
    +            vec![
    +                Box::new(payload),
    +                Box::new(block.size() as i32),
    +                Box::new(block.height() as i64),
    +            ],
    +        ));
    +
    +        // Index the transactions in the block.
    +        let mut values = vec![];
    +        let mut params: Vec<Box<dyn ToSql + Send + Sync>> = vec![];
    +        for (txn_ix, txn) in block.enumerate() {
    +            let txn_ix = serde_json::to_value(&txn_ix).map_err(|err| QueryError::Error {
    +                message: format!("failed to serialize transaction index: {err}"),
    +            })?;
    +            values.push(format!(
    +                "(${},${},${})",
    +                params.len() + 1,
    +                params.len() + 2,
    +                params.len() + 3
    +            ));
    +            params.push(Box::new(txn.commit().to_string()));
    +            params.push(Box::new(block.height() as i64));
    +            params.push(Box::new(txn_ix));
    +        }
    +        if !values.is_empty() {
    +            stmts.push((
    +                format!(
    +                    "INSERT INTO transaction (hash, block_height, index) VALUES {}",
    +                    values.join(",")
    +                ),
    +                params,
    +            ));
    +        }
    +
    +        let mut tx = self.transaction().await?;
    +        tx.execute_many(stmts).await?;
    +
    +        Ok(())
    +    }
    +}
    +
    +#[async_trait]
    +impl<Types> NodeDataSource<Types> for SqlStorage
    +where
    +    Types: NodeType,
    +{
    +    async fn block_height(&self) -> QueryResult<usize> {
    +        let query = "SELECT max(height) FROM header";
    +        let row = self.query_one_static(query).await?;
    +        let height: Option<i64> = row.get(0);
    +        match height {
    +            Some(height) => {
    +                // The height of the block is the number of blocks below it, so the total number of
    +                // blocks is one more than the height of the highest block.
    +                Ok(height as usize + 1)
    +            }
    +            None => {
    +                // If there are no blocks yet, the height is 0.
    +                Ok(0)
    +            }
    +        }
    +    }
    +
    +    async fn get_proposals(
    +        &self,
    +        proposer: &SignatureKey<Types>,
    +        limit: Option<usize>,
    +    ) -> QueryResult<Vec<LeafQueryData<Types>>> {
    +        let mut query = "SELECT leaf, qc FROM leaf WHERE proposer = $1".to_owned();
    +        if let Some(limit) = limit {
    +            // If there is a limit on the number of leaves to return, we want to return the most
    +            // recent leaves, so order by descending height.
    +            query = format!("{query} ORDER BY height DESC limit {limit}");
    +        }
    +        let proposer_json = serde_json::to_value(proposer).map_err(|err| QueryError::Error {
    +            message: format!("failed to serialize proposer ID: {err}"),
    +        })?;
    +        let rows = self.query(&query, &[&proposer_json]).await?;
    +        let mut leaves: Vec<_> = rows.map(|res| parse_leaf(res?)).try_collect().await?;
    +
    +        if limit.is_some() {
    +            // If there was a limit, we selected the leaves in descending order to get the most
    +            // recent leaves. Now reverse them to put them back in chronological order.
    +            leaves.reverse();
    +        }
    +
    +        Ok(leaves)
    +    }
    +
    +    async fn count_proposals(&self, proposer: &SignatureKey<Types>) -> QueryResult<usize> {
    +        let query = "SELECT count(*) FROM leaf WHERE proposer = $1";
    +        let proposer_json = serde_json::to_value(proposer).map_err(|err| QueryError::Error {
    +            message: format!("failed to serialize proposer ID: {err}"),
    +        })?;
    +        let row = self.query_one(query, &[&proposer_json]).await?;
    +        let count: i64 = row.get(0);
    +        Ok(count as usize)
    +    }
    +}
    +
    +#[async_trait]
    +impl<Types> UpdateNodeData<Types> for SqlStorage
    +where
    +    Types: NodeType,
    +{
    +    type Error = QueryError;
    +
    +    async fn insert_leaf(&mut self, _leaf: LeafQueryData<Types>) -> Result<(), Self::Error> {
    +        // The node data source borrows data that is populated by the availability source, so
    +        // there's nothing more to do here.
    +        Ok(())
    +    }
    +}
    +
    +/// An atomic SQL transaction.
    +//
    +// Note: we use a custom `Transaction` type instead of `tokio_postgres::Transaction` because with
    +// the latter, the lifecycle of the underlying SQL transaction is coupled to the lifecycle of the
    +// Rust object: a `BEGIN` statement is executed every time a `Transaction` is created and a `COMMIT`
    +// is executed whenever the `Transaction` is dropped. This is undesirable here because, logically,
    +// the underlying SQL transaction may persist between several calls into the `SqlDataSource`, and is
    +// only closed when `commit` is finally called. However, due to the lifetime of the reference within
    +// `Transaction`, we cannot actually store the `Transaction` object in the `SqlDataSource`, and so
    +// we create a new `Transaction` wrapper each time `SqlDataSource::transaction` is called. Thus, the
    +// lifecycle of the underlying logical transaction is not the same as the lifecycle of the Rust
    +// wrapper object.
    +//
    +// The lifetime parameter here is mostly for type safety for callers. Internally, we can change the
    +// lifetime parameter to `'static` very easily, using `Cow::into_owned` on the inner `client`. This
    +// is even necessary, to move the [`Transaction`] out of an [`RwLockWriteGuard`] when exposing it
    +// via the higher-level [`SqlDataSource`]. However, none of the _public_ APIs exposed by this crate
    +// allow a caller to detach the lifetime parameter here from the lifetime of the [`SqlStorage`] or
    +// [`SqlDataSource`] from which the [`Transaction`] is borrowed, providing enhanced type safety.
    +pub struct Transaction<'a> {
    +    client: Cow<'a, Arc<Client>>,
    +}
    +
    +impl<'a> Transaction<'a> {
    +    /// Change the lifetime parameter of a [`Transaction`].
    +    ///
    +    /// This allows the caller to change the lifetime parameter of this [`Transaction`], by taking
    +    /// ownership of a clone of the referenced client. This function must be used with care (hence
    +    /// the restricted visibility). It is used in this crate to return a [`Transaction`] which is
    +    /// borrowed from an [`RwLockWriteGuard`] up the stack, by replacing the lifetime parameter of
    +    /// the write guard with the lifetime parameter of the [`SqlDataSource`] that owns the
    +    /// [`RwLock`].
    +    pub(crate) fn change_lifetime<'b>(self) -> Transaction<'b> {
    +        Transaction {
    +            client: Cow::Owned(self.client.into_owned()),
    +        }
    +    }
    +}
    +
    +impl<'a> Transaction<'a> {
    +    /// Execute a statement against the underlying database.
    +    ///
    +    /// The results of the statement will be reflected immediately in future statements made within
    +    /// this transaction, but will not be reflected in the underlying database until the transaction
    +    /// is committed with [`commit`](VersionedDataSource::commit).
    +    pub async fn execute<T, P>(&mut self, statement: &T, params: P) -> QueryResult<()>
    +    where
    +        T: ?Sized + ToStatement,
    +        P: IntoIterator,
    +        P::IntoIter: ExactSizeIterator,
    +        P::Item: BorrowToSql,
    +    {
    +        self.client
    +            .execute_raw(statement, params)
    +            .await
    +            .map_err(|err| QueryError::Error {
    +                message: err.to_string(),
    +            })?;
    +        Ok(())
    +    }
    +
    +    pub async fn execute_many<S, T, P>(&mut self, statements: S) -> QueryResult<()>
    +    where
    +        S: IntoIterator<Item = (T, P)>,
    +        T: ToStatement,
    +        P: IntoIterator,
    +        P::IntoIter: ExactSizeIterator,
    +        P::Item: BorrowToSql,
    +    {
    +        for (stmt, params) in statements {
    +            self.execute(&stmt, params).await?;
    +        }
    +        Ok(())
    +    }
    +}
    +
    +/// Query the underlying SQL database.
    +///
    +/// The results will reflect the state after the statements thus far added to this transaction have
    +/// been applied, even though those effects have not been committed to the database yet.
    +#[async_trait]
    +impl<'a> Query for Transaction<'a> {
    +    async fn client(&self) -> Cow<Arc<Client>> {
    +        self.client.clone()
    +    }
    +}
    +
    +#[async_trait]
    +pub trait Query {
    +    async fn client(&self) -> Cow<Arc<Client>>;
    +
    +    // Query the underlying SQL database.
    +    async fn query<T, P>(
    +        &self,
    +        query: &T,
    +        params: P,
    +    ) -> QueryResult<BoxStream<'static, QueryResult<Row>>>
    +    where
    +        T: ?Sized + ToStatement + Sync,
    +        P: IntoIterator + Send,
    +        P::IntoIter: ExactSizeIterator,
    +        P::Item: BorrowToSql,
    +    {
    +        Ok(self
    +            .client()
    +            .await
    +            .query_raw(query, params)
    +            .await
    +            .map_err(postgres_err)?
    +            .map_err(postgres_err)
    +            .boxed())
    +    }
    +
    +    /// Query the underlying SQL database with no parameters.
    +    async fn query_static<T>(&self, query: &T) -> QueryResult<BoxStream<'static, QueryResult<Row>>>
    +    where
    +        T: ?Sized + ToStatement + Sync,
    +    {
    +        self.query::<T, [i64; 0]>(query, []).await
    +    }
    +
    +    /// Query the underlying SQL database, returning exactly one result or failing.
    +    async fn query_one<T, P>(&self, query: &T, params: P) -> QueryResult<Row>
    +    where
    +        T: ?Sized + ToStatement + Sync,
    +        P: IntoIterator + Send,
    +        P::IntoIter: ExactSizeIterator,
    +        P::Item: BorrowToSql,
    +    {
    +        self.query_opt(query, params).await?.context(NotFoundSnafu)
    +    }
    +
    +    /// Query the underlying SQL database with no parameters, returning exactly one result or
    +    /// failing.
    +    async fn query_one_static<T>(&self, query: &T) -> QueryResult<Row>
    +    where
    +        T: ?Sized + ToStatement + Sync,
    +    {
    +        self.query_one::<T, [i64; 0]>(query, []).await
    +    }
    +
    +    /// Query the underlying SQL database, returning zero or one results.
    +    async fn query_opt<T, P>(&self, query: &T, params: P) -> QueryResult<Option<Row>>
    +    where
    +        T: ?Sized + ToStatement + Sync,
    +        P: IntoIterator + Send,
    +        P::IntoIter: ExactSizeIterator,
    +        P::Item: BorrowToSql,
    +    {
    +        self.query(query, params).await?.try_next().await
    +    }
    +
    +    /// Query the underlying SQL database with no parameters, returning zero or one results.
    +    async fn query_opt_static<T>(&self, query: &T) -> QueryResult<Option<Row>>
    +    where
    +        T: ?Sized + ToStatement + Sync,
    +    {
    +        self.query_opt::<T, [i64; 0]>(query, []).await
    +    }
    +}
    +
    +fn postgres_err(err: tokio_postgres::Error) -> QueryError {
    +    QueryError::Error {
    +        message: err.to_string(),
    +    }
    +}
    +
    +fn parse_leaf<Types>(row: Row) -> QueryResult<LeafQueryData<Types>>
    +where
    +    Types: NodeType,
    +{
    +    let leaf = row.try_get("leaf").map_err(|err| QueryError::Error {
    +        message: format!("error extracting leaf from query results: {err}"),
    +    })?;
    +    let leaf: Leaf<Types> = serde_json::from_value(leaf).map_err(|err| QueryError::Error {
    +        message: format!("malformed leaf: {err}"),
    +    })?;
    +
    +    let qc = row.try_get("qc").map_err(|err| QueryError::Error {
    +        message: format!("error extracting QC from query results: {err}"),
    +    })?;
    +    let qc: QuorumCertificate<Types> =
    +        serde_json::from_value(qc).map_err(|err| QueryError::Error {
    +            message: format!("malformed QC: {err}"),
    +        })?;
    +
    +    Ok(LeafQueryData { leaf, qc })
    +}
    +
    +const BLOCK_COLUMNS: &str =
    +    "h.hash AS hash, h.data AS header_data, p.size AS payload_size, p.data AS payload_data";
    +
    +fn parse_block<Types>(row: Row) -> QueryResult<BlockQueryData<Types>>
    +where
    +    Types: NodeType,
    +{
    +    // First, check if we have the payload for this block yet.
    +    let size: Option<i32> = row
    +        .try_get("payload_size")
    +        .map_err(|err| QueryError::Error {
    +            message: format!("error extracting payload size from query results: {err}"),
    +        })?;
    +    let payload_data: Option<Vec<u8>> =
    +        row.try_get("payload_data")
    +            .map_err(|err| QueryError::Error {
    +                message: format!("error extracting payload data from query results: {err}"),
    +            })?;
    +    let (size, payload_data) = size.zip(payload_data).context(MissingSnafu)?;
    +    let size = size as u64;
    +
    +    // Reconstruct the full header.
    +    let header_data = row
    +        .try_get("header_data")
    +        .map_err(|err| QueryError::Error {
    +            message: format!("error extracting header data from query results: {err}"),
    +        })?;
    +    let header: Header<Types> =
    +        serde_json::from_value(header_data).map_err(|err| QueryError::Error {
    +            message: format!("malformed header: {err}"),
    +        })?;
    +
    +    // Reconstruct the full block payload.
    +    let payload = Payload::<Types>::from_bytes(payload_data.into_iter(), header.metadata());
    +
    +    // Reconstruct the query data by adding metadata.
    +    let hash: String = row.try_get("hash").map_err(|err| QueryError::Error {
    +        message: format!("error extracting block hash from query results: {err}"),
    +    })?;
    +    let hash = hash.parse().map_err(|err| QueryError::Error {
    +        message: format!("malformed block hash: {err}"),
    +    })?;
    +
    +    Ok(BlockQueryData {
    +        header,
    +        payload,
    +        size,
    +        hash,
    +    })
    +}
    +
    +/// Convert range bounds to a SQL where clause constraining a given column.
    +///
    +/// Returns the where clause as a string and a list of query parameters. We assume that there are no
    +/// other parameters in the query; that is, parameters in the where clause will start from $1.
    +fn bounds_to_where_clause<R>(range: R, column: &str) -> (String, Vec<i64>)
    +where
    +    R: RangeBounds<usize>,
    +{
    +    let mut bounds = vec![];
    +    let mut params = vec![];
    +
    +    match range.start_bound() {
    +        Bound::Included(n) => {
    +            params.push(*n as i64);
    +            bounds.push(format!("{column} >= ${}", params.len()));
    +        }
    +        Bound::Excluded(n) => {
    +            params.push(*n as i64);
    +            bounds.push(format!("{column} > ${}", params.len()));
    +        }
    +        Bound::Unbounded => {}
    +    }
    +    match range.end_bound() {
    +        Bound::Included(n) => {
    +            params.push(*n as i64);
    +            bounds.push(format!("{column} <= ${}", params.len()));
    +        }
    +        Bound::Excluded(n) => {
    +            params.push(*n as i64);
    +            bounds.push(format!("{column} < ${}", params.len()));
    +        }
    +        Bound::Unbounded => {}
    +    }
    +
    +    let mut where_clause = bounds.join(" AND ");
    +    if !where_clause.is_empty() {
    +        where_clause = format!(" WHERE {where_clause}");
    +    }
    +
    +    (where_clause, params)
    +}
    +
    +/// Connect to a Postgres database with a TLS implementation.
    +///
    +/// Spawns a background task to run the connection. Returns a client and a channel to kill the
    +/// connection task.
    +async fn connect<T>(
    +    pgcfg: postgres::Config,
    +    tcp: TcpStream,
    +    tls: T,
    +) -> anyhow::Result<(Client, oneshot::Sender<()>)>
    +where
    +    T: TlsConnect<TcpStream>,
    +    T::Stream: Send + 'static,
    +{
    +    let (client, connection) = pgcfg.connect_raw(tcp, tls).await?;
    +
    +    // Spawn a task to drive the connection, with a channel to kill it when this data source is
    +    // dropped.
    +    let (kill, killed) = oneshot::channel();
    +    spawn(select(killed, connection).inspect(|res| {
    +        if let Either::Right((res, _)) = res {
    +            // If we were killed, do nothing. That is the normal shutdown path. But if the `select`
    +            // returned because the `connection` terminated, we should log something, as that is
    +            // unusual.
    +            match res {
    +                Ok(()) => tracing::warn!("postgres connection terminated unexpectedly"),
    +                Err(err) => tracing::error!("postgres connection closed with error: {err}"),
    +            }
    +        }
    +    }));
    +
    +    Ok((client, kill))
    +}
    +
    +// tokio-postgres is written in terms of the tokio AsyncRead/AsyncWrite traits. However, these
    +// traits do not require any specifics of the tokio runtime. Thus we can implement them using the
    +// async_std TcpStream type, and have a stream which is compatible with tokio-postgres but will run
    +// on the async_std executor.
    +//
    +// To avoid orphan impls, we wrap this tream in a new type.
    +struct TcpStream(async_std::net::TcpStream);
    +
    +impl TcpStream {
    +    async fn connect<A: ToSocketAddrs>(addrs: A) -> Result<Self, Error> {
    +        Ok(Self(async_std::net::TcpStream::connect(addrs).await?))
    +    }
    +}
    +
    +impl tokio::io::AsyncRead for TcpStream {
    +    fn poll_read(
    +        mut self: Pin<&mut Self>,
    +        cx: &mut Context<'_>,
    +        buf: &mut tokio::io::ReadBuf<'_>,
    +    ) -> Poll<std::io::Result<()>> {
    +        // tokio uses this hyper-optimized `ReadBuf` construct, where there is a filled portion, an
    +        // unfilled portion where we append new data, and the unfilled portion of the buffer need
    +        // not even be initialized. However the async_std implementation we're delegating to just
    +        // expects a normal `&mut [u8]` buffer which is entirely unfilled. To simplify the
    +        // conversion, we will abandon the uninitialized buffer optimization and force
    +        // initialization of the entire buffer, resulting in a plain old `&mut [u8]` representing
    +        // the unfilled portion. But first, we need to grab the length of the filled region so we
    +        // can increment it after we read new data from async_std.
    +        let filled = buf.filled().len();
    +
    +        // Initialize the buffer and get a slice of the unfilled region. This operation is free
    +        // after the first time it is called, so we don't need to worry about maintaining state
    +        // between subsequent calls to `poll_read`.
    +        let unfilled = buf.initialize_unfilled();
    +
    +        // Read data into the unfilled portion of the buffer.
    +        match Pin::new(&mut self.0).poll_read(cx, unfilled) {
    +            Poll::Ready(Ok(bytes_read)) => {
    +                // After the read completes, the first `bytes_read` of `unfilled` have now been
    +                // filled. Increment the `filled` cursor within the `ReadBuf` to account for this.
    +                buf.set_filled(filled + bytes_read);
    +                Poll::Ready(Ok(()))
    +            }
    +            Poll::Ready(Err(err)) => Poll::Ready(Err(err)),
    +            Poll::Pending => Poll::Pending,
    +        }
    +    }
    +}
    +
    +impl tokio::io::AsyncWrite for TcpStream {
    +    fn poll_write(
    +        mut self: Pin<&mut Self>,
    +        cx: &mut Context<'_>,
    +        buf: &[u8],
    +    ) -> Poll<std::io::Result<usize>> {
    +        Pin::new(&mut self.0).poll_write(cx, buf)
    +    }
    +
    +    fn poll_flush(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<std::io::Result<()>> {
    +        Pin::new(&mut self.0).poll_flush(cx)
    +    }
    +
    +    fn poll_shutdown(mut self: Pin<&mut Self>, cx: &mut Context<'_>) -> Poll<std::io::Result<()>> {
    +        Pin::new(&mut self.0).poll_close(cx)
    +    }
    +}
    +
    +// These tests run the `postgres` Docker image, which doesn't work on Windows.
    +#[cfg(all(any(test, feature = "testing"), not(target_os = "windows")))]
    +pub mod testing {
    +    use crate::testing::sleep;
    +    use portpicker::pick_unused_port;
    +    use std::{
    +        process::{Command, Stdio},
    +        str,
    +        time::Duration,
    +    };
    +
    +    #[derive(Debug)]
    +    pub struct TmpDb {
    +        port: u16,
    +        container_id: String,
    +    }
    +
    +    impl TmpDb {
    +        pub async fn init() -> Self {
    +            let port = pick_unused_port().unwrap();
    +
    +            let output = Command::new("docker")
    +                .arg("run")
    +                .arg("-d")
    +                .args(["-p", &format!("{port}:5432")])
    +                .args(["-e", "POSTGRES_PASSWORD=password"])
    +                .arg("postgres")
    +                .output()
    +                .unwrap();
    +            let stdout = str::from_utf8(&output.stdout).unwrap();
    +            let stderr = str::from_utf8(&output.stderr).unwrap();
    +            if !output.status.success() {
    +                panic!("failed to start postgres docker: {stderr}");
    +            }
    +
    +            // Create the TmpDb object immediately after starting the Docker container, so if
    +            // anything panics after this `drop` will be called and we will clean up.
    +            let container_id = stdout.trim().to_owned();
    +            tracing::info!("launched postgres docker {container_id}");
    +            let db = Self { port, container_id };
    +
    +            // Wait for the database to be ready.
    +            while !Command::new("psql")
    +                .args(["-h", "localhost", "-p", &port.to_string(), "-U", "postgres"])
    +                .env("PGPASSWORD", "password")
    +                // Null input so the command terminates as soon as it manages to connect.
    +                .stdin(Stdio::null())
    +                // Output from this command is not useful, it's just a prompt.
    +                .stdout(Stdio::null())
    +                .stderr(Stdio::null())
    +                .status()
    +                .unwrap()
    +                .success()
    +            {
    +                tracing::warn!("database is not ready");
    +                sleep(Duration::from_secs(1)).await;
    +            }
    +
    +            db
    +        }
    +
    +        pub fn port(&self) -> u16 {
    +            self.port
    +        }
    +    }
    +
    +    impl Drop for TmpDb {
    +        fn drop(&mut self) {
    +            let output = Command::new("docker")
    +                .args(["kill", self.container_id.as_str()])
    +                .output()
    +                .unwrap();
    +            if !output.status.success() {
    +                tracing::error!(
    +                    "error killing postgres docker {}: {}",
    +                    self.container_id,
    +                    str::from_utf8(&output.stderr).unwrap()
    +                );
    +            }
    +
    +            let output = Command::new("docker")
    +                .args(["rm", self.container_id.as_str()])
    +                .output()
    +                .unwrap();
    +            if !output.status.success() {
    +                tracing::error!(
    +                    "error removing postgres docker {}: {}",
    +                    self.container_id,
    +                    str::from_utf8(&output.stderr).unwrap()
    +                );
    +            }
    +        }
    +    }
    +}
    +
    +// These tests run the `postgres` Docker image, which doesn't work on Windows.
    +#[cfg(all(test, not(target_os = "windows")))]
    +mod test {
    +    use super::{testing::TmpDb, *};
    +    use crate::testing::setup_test;
    +
    +    #[async_std::test]
    +    async fn test_migrations() {
    +        setup_test();
    +
    +        let db = TmpDb::init().await;
    +        let port = db.port();
    +
    +        let connect = |migrations: bool, custom_migrations| async move {
    +            let mut cfg = Config::default()
    +                .user("postgres")
    +                .password("password")
    +                .port(port)
    +                .migrations(custom_migrations);
    +            if !migrations {
    +                cfg = cfg.no_migrations();
    +            }
    +            let client = SqlStorage::connect(cfg).await?;
    +            Ok::<_, Error>(client)
    +        };
    +
    +        // Connecting with migrations disabled should fail if the database is not already up to date
    +        // (since we've just created a fresh database, it isn't).
    +        let err = connect(false, vec![]).await.unwrap_err();
    +        tracing::info!("connecting without running migrations failed as expected: {err}");
    +
    +        // Now connect and run migrations to bring the database up to date.
    +        connect(true, vec![]).await.unwrap();
    +        // Now connecting without migrations should work.
    +        connect(false, vec![]).await.unwrap();
    +
    +        // Connect with some custom migrations, to advance the schema even further. Pass in the
    +        // custom migrations out of order; they should still execute in order of version number.
    +        // The SQL commands used here will fail if not run in order.
    +        let migrations = vec![
    +            Migration::unapplied(
    +                "V12__create_test_table.sql",
    +                "ALTER TABLE test ADD COLUMN data INTEGER;",
    +            )
    +            .unwrap(),
    +            Migration::unapplied("V11__create_test_table.sql", "CREATE TABLE test ();").unwrap(),
    +        ];
    +        connect(true, migrations.clone()).await.unwrap();
    +
    +        // Connect using the default schema (no custom migrations) and not running migrations. This
    +        // should fail because the database is _ahead_ of the client in terms of schema.
    +        let err = connect(false, vec![]).await.unwrap_err();
    +        tracing::info!("connecting without running migrations failed as expected: {err}");
    +
    +        // Connecting with the customized schema should work even without running migrations.
    +        connect(true, migrations).await.unwrap();
    +    }
    +
    +    #[test]
    +    fn test_config_from_str() {
    +        let cfg = Config::from_str("postgresql://user:password@host:8080").unwrap();
    +        assert_eq!(cfg.pgcfg.get_user(), Some("user"));
    +        assert_eq!(cfg.pgcfg.get_password(), Some("password".as_bytes()));
    +        assert_eq!(cfg.host, "host");
    +        assert_eq!(cfg.port, 8080);
    +    }
    +
    +    #[test]
    +    fn test_config_from_pgcfg() {
    +        let mut pgcfg = postgres::Config::default();
    +        pgcfg.dbname("db");
    +        let cfg = Config::from(pgcfg.clone());
    +        assert_eq!(cfg.pgcfg, pgcfg);
    +        // Default values.
    +        assert_eq!(cfg.host, "localhost");
    +        assert_eq!(cfg.port, 5432);
    +    }
    +}
    +
    \ No newline at end of file diff --git a/src/hotshot_query_service/data_source/update.rs.html b/src/hotshot_query_service/data_source/update.rs.html index 43a6bbfcc..ab519d3d5 100644 --- a/src/hotshot_query_service/data_source/update.rs.html +++ b/src/hotshot_query_service/data_source/update.rs.html @@ -119,6 +119,18 @@ 119 120 121 +122 +123 +124 +125 +126 +127 +128 +129 +130 +131 +132 +133
    // Copyright (c) 2022 Espresso Systems (espressosys.com)
     // This file is part of the HotShot Query Service library.
     //
    @@ -133,6 +145,7 @@
     
     //! A generic algorithm for updating a HotShot Query Service data source with new data.
     use crate::availability::{BlockQueryData, LeafQueryData, UpdateAvailabilityData};
    +use crate::node::UpdateNodeData;
     use crate::status::UpdateStatusData;
     use async_trait::async_trait;
     use hotshot::types::{Event, EventType};
    @@ -151,7 +164,9 @@
     /// * [update](Self::update), to update the query state when a new HotShot event is emitted
     #[async_trait]
     pub trait UpdateDataSource<Types: NodeType>:
    -    UpdateAvailabilityData<Types> + UpdateStatusData
    +    UpdateAvailabilityData<Types>
    +    + UpdateNodeData<Types, Error = <Self as UpdateAvailabilityData<Types>>::Error>
    +    + UpdateStatusData
     {
         /// Update query state based on a new consensus event.
         ///
    @@ -164,14 +179,24 @@
         ///
         /// If you want to update the data source with an untrusted event, for example one received from
         /// a peer over the network, you must authenticate it first.
    -    async fn update(&mut self, event: &Event<Types>) -> Result<(), Self::Error>;
    +    async fn update(
    +        &mut self,
    +        event: &Event<Types>,
    +    ) -> Result<(), <Self as UpdateAvailabilityData<Types>>::Error>;
     }
     
     #[async_trait]
    -impl<Types: NodeType, T: UpdateAvailabilityData<Types> + UpdateStatusData + Send>
    -    UpdateDataSource<Types> for T
    +impl<Types: NodeType, T> UpdateDataSource<Types> for T
    +where
    +    T: UpdateAvailabilityData<Types>
    +        + UpdateNodeData<Types, Error = <Self as UpdateAvailabilityData<Types>>::Error>
    +        + UpdateStatusData
    +        + Send,
     {
    -    async fn update(&mut self, event: &Event<Types>) -> Result<(), Self::Error> {
    +    async fn update(
    +        &mut self,
    +        event: &Event<Types>,
    +    ) -> Result<(), <Self as UpdateAvailabilityData<Types>>::Error> {
             if let EventType::Decide { leaf_chain, qc, .. } = &event.event {
                 // `qc` justifies the first (most recent) leaf...
                 let qcs = once((**qc).clone())
    @@ -187,16 +212,15 @@
                     // `LeafQueryData::new` only fails if `qc` does not reference `leaf`. We have just
                     // gotten `leaf` and `qc` directly from a consensus `Decide` event, so they are
                     // guaranteed to correspond, and this should never panic.
    -                self.insert_leaf(
    -                    LeafQueryData::new(leaf.clone(), qc.clone()).expect("inconsistent leaf"),
    -                )
    -                .await?;
    +                let leaf_data =
    +                    LeafQueryData::new(leaf.clone(), qc.clone()).expect("inconsistent leaf");
    +                UpdateAvailabilityData::insert_leaf(self, leaf_data.clone()).await?;
    +                UpdateNodeData::insert_leaf(self, leaf_data).await?;
     
                     if let Some(block) = leaf.get_block_payload() {
                         // For the same reason, this will not panic either.
                         self.insert_block(
    -                        BlockQueryData::new(leaf.clone(), qc.clone(), block)
    -                            .expect("inconsistent block"),
    +                        BlockQueryData::new(leaf, &qc, block).expect("inconsistent block"),
                         )
                         .await?;
                     } else {
    diff --git a/src/hotshot_query_service/error.rs.html b/src/hotshot_query_service/error.rs.html
    index 451874068..178055c85 100644
    --- a/src/hotshot_query_service/error.rs.html
    +++ b/src/hotshot_query_service/error.rs.html
    @@ -49,6 +49,9 @@
     49
     50
     51
    +52
    +53
    +54
     
    // Copyright (c) 2022 Espresso Systems (espressosys.com)
     // This file is part of the HotShot Query Service library.
     //
    @@ -61,7 +64,7 @@
     // You should have received a copy of the GNU General Public License along with this program. If not,
     // see <https://www.gnu.org/licenses/>.
     
    -use crate::{availability, status};
    +use crate::{availability, node, status};
     use derive_more::From;
     use serde::{Deserialize, Serialize};
     use snafu::Snafu;
    @@ -73,6 +76,8 @@
         #[snafu(display("{source}"))]
         Availability { source: availability::Error },
         #[snafu(display("{source}"))]
    +    Node { source: node::Error },
    +    #[snafu(display("{source}"))]
         Status { source: status::Error },
         #[snafu(display("error {status}: {message}"))]
         Custom { message: String, status: StatusCode },
    @@ -95,6 +100,7 @@
         fn status(&self) -> StatusCode {
             match self {
                 Self::Availability { source } => source.status(),
    +            Self::Node { source } => source.status(),
                 Self::Status { source } => source.status(),
                 Self::Custom { status, .. } => *status,
             }
    diff --git a/src/hotshot_query_service/lib.rs.html b/src/hotshot_query_service/lib.rs.html
    index 4129ac534..70da70121 100644
    --- a/src/hotshot_query_service/lib.rs.html
    +++ b/src/hotshot_query_service/lib.rs.html
    @@ -663,6 +663,47 @@
     663
     664
     665
    +666
    +667
    +668
    +669
    +670
    +671
    +672
    +673
    +674
    +675
    +676
    +677
    +678
    +679
    +680
    +681
    +682
    +683
    +684
    +685
    +686
    +687
    +688
    +689
    +690
    +691
    +692
    +693
    +694
    +695
    +696
    +697
    +698
    +699
    +700
    +701
    +702
    +703
    +704
    +705
    +706
     

    // Copyright (c) 2022 Espresso Systems (espressosys.com)
     // This file is part of the HotShot Query Service library.
     //
    @@ -695,6 +736,7 @@
     //! use hotshot_query_service::{
     //!     availability,
     //!     data_source::{FileSystemDataSource, UpdateDataSource, VersionedDataSource},
    +//!     node,
     //!     status::UpdateStatusData,
     //!     status, Error
     //! };
    @@ -719,6 +761,8 @@
     //! // Create API modules.
     //! let availability_api = availability::define_api(&Default::default())
     //!     .map_err(Error::internal)?;
    +//! let node_api = node::define_api(&Default::default())
    +//!     .map_err(Error::internal)?;
     //! let status_api = status::define_api(&Default::default())
     //!     .map_err(Error::internal)?;
     //!
    @@ -728,6 +772,8 @@
     //! app
     //!     .register_module("availability", availability_api)
     //!     .map_err(Error::internal)?
    +//!     .register_module("node", node_api)
    +//!     .map_err(Error::internal)?
     //!     .register_module("status", status_api)
     //!     .map_err(Error::internal)?;
     //!
    @@ -834,7 +880,7 @@
     //! # use async_trait::async_trait;
     //! # use futures::FutureExt;
     //! # use hotshot_query_service::availability::{
    -//! #   self, AvailabilityDataSource, QueryBlockSnafu, TransactionIndex,
    +//! #   self, AvailabilityDataSource, FetchBlockSnafu, TransactionIndex,
     //! # };
     //! # use hotshot_query_service::testing::mocks::MockTypes as AppTypes;
     //! # use hotshot_query_service::Error;
    @@ -865,7 +911,7 @@
     //!         let block = state
     //!             .get_block(block_index)
     //!             .await
    -//!             .context(QueryBlockSnafu { resource: block_index.to_string() })?;
    +//!             .context(FetchBlockSnafu { resource: block_index.to_string() })?;
     //!         let txn = block.transaction(&txn_index).unwrap();
     //!         let utxo = // Application-specific logic to extract a UTXO from a transaction.
     //! #           todo!();
    @@ -903,25 +949,26 @@
     //! Composing the modules provided by this crate with other, unrelated modules to create a unified
     //! service is fairly simple, as most of the complexity is handled by [tide_disco], which already
     //! provides a mechanism for composing several modules into a single application. In principle, all
    -//! you need to do is register the [availability] and [status] APIs provided by this crate with a
    -//! [tide_disco::App], and then register your own API modules with the same app.
    +//! you need to do is register the [availability], [node], and [status] APIs provided by this crate
    +//! with a [tide_disco::App], and then register your own API modules with the same app.
     //!
     //! The one wrinkle is that all modules within a [tide_disco] app must share the same state type. It
    -//! is for this reason that the modules provided by this crate are generic on the state type -- both
    -//! [availability::define_api] and [status::define_api] can work with any state type, provided that
    -//! type implements the corresponding data source traits. The data sources provided by this crate
    -//! implement both of these traits, but if you want to use a custom state type that includes state
    -//! for other modules, you will need to implement these traits for your custom type. The basic
    -//! pattern looks like this:
    +//! is for this reason that the modules provided by this crate are generic on the state type --
    +//! [availability::define_api], [node::define_api], and [status::define_api] can all work with any
    +//! state type, provided that type implements the corresponding data source traits. The data sources
    +//! provided by this crate implement these traits, but if you want to use a custom state type that
    +//! includes state for other modules, you will need to implement these traits for your custom type.
    +//! The basic pattern looks like this:
     //!
     //! ```
     //! # use async_trait::async_trait;
     //! # use hotshot_query_service::{QueryResult, SignatureKey};
     //! # use hotshot_query_service::availability::{
    -//! #   AvailabilityDataSource, BlockId, BlockQueryData, LeafId, LeafQueryData, TransactionHash,
    -//! #   TransactionIndex,
    +//! #   AvailabilityDataSource, BlockId, BlockQueryData, Fetch, LeafId, LeafQueryData,
    +//! #   TransactionHash, TransactionIndex,
     //! # };
     //! # use hotshot_query_service::metrics::PrometheusMetrics;
    +//! # use hotshot_query_service::node::NodeDataSource;
     //! # use hotshot_query_service::status::StatusDataSource;
     //! # use hotshot_query_service::testing::mocks::MockTypes as AppTypes;
     //! # use std::ops::RangeBounds;
    @@ -938,19 +985,14 @@
     //! impl<D: AvailabilityDataSource<AppTypes> + Send + Sync>
     //!     AvailabilityDataSource<AppTypes> for AppState<D>
     //! {
    -//!     type LeafRange<'a, R> = D::LeafRange<'a, R>
    +//!     type LeafRange<R> = D::LeafRange<R>
     //!     where
    -//!         Self: 'a,
     //!         R: RangeBounds<usize> + Send;
    -//!     type BlockRange<'a, R> = D::BlockRange<'a, R>
    +//!     type BlockRange<R> = D::BlockRange<R>
     //!     where
    -//!         Self: 'a,
     //!         R: RangeBounds<usize> + Send;
     //!
    -//!     type LeafStream = D::LeafStream;
    -//!     type BlockStream = D::BlockStream;
    -//!
    -//!     async fn get_leaf<ID>(&self, id: ID) -> QueryResult<LeafQueryData<AppTypes>>
    +//!     async fn get_leaf<ID>(&self, id: ID) -> Fetch<LeafQueryData<AppTypes>>
     //!     where
     //!         ID: Into<LeafId<AppTypes>> + Send + Sync,
     //!     {
    @@ -958,20 +1000,36 @@
     //!     }
     //!
     //!     // etc
    -//! #   async fn get_block<ID>(&self, id: ID) -> QueryResult<BlockQueryData<AppTypes>>
    +//! #   async fn get_block<ID>(&self, id: ID) -> Fetch<BlockQueryData<AppTypes>>
     //! #   where
     //! #       ID: Into<BlockId<AppTypes>> + Send + Sync { todo!() }
    -//! #   async fn get_block_with_transaction(&self, hash: TransactionHash<AppTypes>) -> QueryResult<(BlockQueryData<AppTypes>, TransactionIndex<AppTypes>)> { todo!() }
    -//! #   async fn get_leaf_range<R>(&self, range: R) -> QueryResult<Self::LeafRange<'_, R>>
    +//! #   async fn get_block_with_transaction(&self, hash: TransactionHash<AppTypes>) -> Fetch<(BlockQueryData<AppTypes>, TransactionIndex<AppTypes>)> { todo!() }
    +//! #   async fn get_leaf_range<R>(&self, range: R) -> Self::LeafRange<R>
     //! #   where
     //! #       R: RangeBounds<usize> + Send { todo!() }
    -//! #   async fn get_block_range<R>(&self, range: R) -> QueryResult<Self::BlockRange<'_, R>>
    +//! #   async fn get_block_range<R>(&self, range: R) -> Self::BlockRange<R>
     //! #   where
     //! #       R: RangeBounds<usize> + Send { todo!() }
    -//! #   async fn get_proposals(&self, id: &SignatureKey<AppTypes>, limit: Option<usize>) -> QueryResult<Vec<LeafQueryData<AppTypes>>> { todo!() }
    -//! #   async fn count_proposals(&self, id: &SignatureKey<AppTypes>) -> QueryResult<usize> { todo!() }
    -//! #   async fn subscribe_leaves(&self, height: usize) -> QueryResult<Self::LeafStream> { todo!() }
    -//! #   async fn subscribe_blocks(&self, height: usize) -> QueryResult<Self::BlockStream> { todo!() }
    +//! }
    +//!
    +//! // Implement data source trait for node API by delegating to the underlying data source.
    +//! #[async_trait]
    +//! impl<D: NodeDataSource<AppTypes> + Send + Sync> NodeDataSource<AppTypes> for AppState<D> {
    +//!     async fn block_height(&self) -> QueryResult<usize> {
    +//!         self.hotshot_qs.block_height().await
    +//!     }
    +//!
    +//!     async fn get_proposals(
    +//!         &self,
    +//!         id: &SignatureKey<AppTypes>,
    +//!         limit: Option<usize>,
    +//!     ) -> QueryResult<Vec<LeafQueryData<AppTypes>>> {
    +//!         self.hotshot_qs.get_proposals(id, limit).await
    +//!     }
    +//!
    +//!     async fn count_proposals(&self, id: &SignatureKey<AppTypes>) -> QueryResult<usize> {
    +//!         self.hotshot_qs.count_proposals(id).await
    +//!     }
     //! }
     //!
     //! // Implement data source trait for status API by delegating to the underlying data source.
    @@ -990,23 +1048,25 @@
     //! ```
     //!
     //! In the future, we may provide derive macros for
    -//! [AvailabilityDataSource](availability::AvailabilityDataSource) and
    -//! [StatusDataSource](status::StatusDataSource) to eliminate the boilerplate of implementing them
    -//! for a custom type that has an existing implementation as one of its fields.
    +//! [AvailabilityDataSource](availability::AvailabilityDataSource),
    +//! [NodeDataSource](node::NodeDataSource), and [StatusDataSource](status::StatusDataSource) to
    +//! eliminate the boilerplate of implementing them for a custom type that has an existing
    +//! implementation as one of its fields.
     //!
     //! Once you have created your `AppState` type aggregating the state for each API module, you can
     //! initialize the state as normal, instantiating `D` with a concrete implementation of a data
     //! source and initializing `hotshot_qs` as you normally would that data source.
     //!
    -//! _However_, this only works if you want the persistent storage for the availability and status
    +//! _However_, this only works if you want the persistent storage for the availability and node
     //! modules (managed by `hotshot_qs`) to be independent of the persistent storage for other modules.
     //! You may well want to synchronize the storage for all modules together, so that updates to the
     //! entire application state can be done atomically. This is particularly relevant if one of your
     //! application-specific modules updates its storage based on a stream of HotShot leaves. Since the
    -//! availability module also updates with each new leaf, you probably want these two modules to stay
    -//! in sync. The data source implementations provided by this crate provide means by which you can
    -//! add additional data to the same persistent store and synchronize the entire store together.
    -//! Refer to the documentation for you specific data source for information on how to achieve this.
    +//! availability and node modules also update with each new leaf, you probably want all of these
    +//! modules to stay in sync. The data source implementations provided by this crate provide means by
    +//! which you can add additional data to the same persistent store and synchronize the entire store
    +//! together. Refer to the documentation for you specific data source for information on how to
    +//! achieve this.
     //!
     
     mod api;
    @@ -1014,6 +1074,7 @@
     pub mod data_source;
     mod error;
     pub mod metrics;
    +pub mod node;
     mod resolvable;
     pub mod status;
     pub mod testing;
    @@ -1075,6 +1136,8 @@
         #[clap(flatten)]
         pub availability: availability::Options,
         #[clap(flatten)]
    +    pub node: node::Options,
    +    #[clap(flatten)]
         pub status: status::Options,
         #[clap(short, long, default_value = "8080")]
         pub port: u16,
    @@ -1089,6 +1152,7 @@
     where
         Payload<Types>: availability::QueryablePayload,
         D: availability::AvailabilityDataSource<Types>
    +        + node::NodeDataSource<Types>
             + status::StatusDataSource
             + data_source::UpdateDataSource<Types>
             + data_source::VersionedDataSource
    @@ -1099,12 +1163,15 @@
         // Create API modules.
         let availability_api =
             availability::define_api(&options.availability).map_err(Error::internal)?;
    +    let node_api = node::define_api(&options.node).map_err(Error::internal)?;
         let status_api = status::define_api(&options.status).map_err(Error::internal)?;
     
         // Create app. We wrap `data_source` into an `RwLock` so we can share it with the web server.
         let data_source = Arc::new(RwLock::new(data_source));
         let mut app = App::<_, Error>::with_state(data_source.clone());
         app.register_module("availability", availability_api)
    +        .map_err(Error::internal)?
    +        .register_module("node", node_api)
             .map_err(Error::internal)?
             .register_module("status", status_api)
             .map_err(Error::internal)?;
    @@ -1135,12 +1202,16 @@
         use super::*;
         use crate::{
             availability::{
    -            AvailabilityDataSource, BlockId, BlockQueryData, LeafId, LeafQueryData,
    +            AvailabilityDataSource, BlockId, BlockQueryData, Fetch, LeafId, LeafQueryData,
                 TransactionHash, TransactionIndex,
             },
             metrics::PrometheusMetrics,
    +        node::NodeDataSource,
             status::StatusDataSource,
    -        testing::{consensus::MockDataSource, mocks::MockTypes},
    +        testing::{
    +            consensus::MockDataSource,
    +            mocks::{MockHeader, MockTypes},
    +        },
         };
         use async_std::{sync::RwLock, task::spawn};
         use async_trait::async_trait;
    @@ -1164,54 +1235,57 @@
     
         #[async_trait]
         impl AvailabilityDataSource<MockTypes> for CompositeState {
    -        type LeafStream = <MockDataSource as AvailabilityDataSource<MockTypes>>::LeafStream;
    -        type BlockStream = <MockDataSource as AvailabilityDataSource<MockTypes>>::BlockStream;
    -
    -        type LeafRange<'a, R> =
    +        type LeafRange<R> =
                 <MockDataSource as AvailabilityDataSource<
                     MockTypes,
    -            >>::LeafRange<'a, R>
    +            >>::LeafRange<R>
             where
    -            Self: 'a,
    -            R: RangeBounds<usize> + Send;
    -        type BlockRange<'a, R> =
    +            R: RangeBounds<usize> + Send;
    +        type BlockRange<R> =
                 <MockDataSource as AvailabilityDataSource<
                     MockTypes,
    -            >>::BlockRange<'a, R>
    +            >>::BlockRange<R>
             where
    -            Self: 'a,
    -            R: RangeBounds<usize> + Send;
    +            R: RangeBounds<usize> + Send;
     
    -        async fn get_leaf<ID>(&self, id: ID) -> QueryResult<LeafQueryData<MockTypes>>
    +        async fn get_leaf<ID>(&self, id: ID) -> Fetch<LeafQueryData<MockTypes>>
             where
                 ID: Into<LeafId<MockTypes>> + Send + Sync,
             {
                 self.hotshot_qs.get_leaf(id).await
             }
    -        async fn get_block<ID>(&self, id: ID) -> QueryResult<BlockQueryData<MockTypes>>
    +        async fn get_block<ID>(&self, id: ID) -> Fetch<BlockQueryData<MockTypes>>
             where
                 ID: Into<BlockId<MockTypes>> + Send + Sync,
             {
                 self.hotshot_qs.get_block(id).await
             }
    -        async fn get_leaf_range<R>(&self, range: R) -> QueryResult<Self::LeafRange<'_, R>>
    +        async fn get_leaf_range<R>(&self, range: R) -> Self::LeafRange<R>
             where
    -            R: RangeBounds<usize> + Send,
    +            R: RangeBounds<usize> + Send + 'static,
             {
                 self.hotshot_qs.get_leaf_range(range).await
             }
    -        async fn get_block_range<R>(&self, range: R) -> QueryResult<Self::BlockRange<'_, R>>
    +        async fn get_block_range<R>(&self, range: R) -> Self::BlockRange<R>
             where
    -            R: RangeBounds<usize> + Send,
    +            R: RangeBounds<usize> + Send + 'static,
             {
                 self.hotshot_qs.get_block_range(range).await
             }
             async fn get_block_with_transaction(
                 &self,
                 hash: TransactionHash<MockTypes>,
    -        ) -> QueryResult<(BlockQueryData<MockTypes>, TransactionIndex<MockTypes>)> {
    +        ) -> Fetch<(BlockQueryData<MockTypes>, TransactionIndex<MockTypes>)> {
                 self.hotshot_qs.get_block_with_transaction(hash).await
             }
    +    }
    +
    +    // Imiplement data source trait for node API.
    +    #[async_trait]
    +    impl NodeDataSource<MockTypes> for CompositeState {
    +        async fn block_height(&self) -> QueryResult<usize> {
    +            StatusDataSource::block_height(self).await
    +        }
             async fn get_proposals(
                 &self,
                 proposer: &SignatureKey<MockTypes>,
    @@ -1222,21 +1296,14 @@
             async fn count_proposals(&self, proposer: &SignatureKey<MockTypes>) -> QueryResult<usize> {
                 self.hotshot_qs.count_proposals(proposer).await
             }
    -        async fn subscribe_leaves(&self, height: usize) -> QueryResult<Self::LeafStream> {
    -            self.hotshot_qs.subscribe_leaves(height).await
    -        }
    -        async fn subscribe_blocks(&self, height: usize) -> QueryResult<Self::BlockStream> {
    -            self.hotshot_qs.subscribe_blocks(height).await
    -        }
         }
     
         // Implement data source trait for status API.
         #[async_trait]
         impl StatusDataSource for CompositeState {
             async fn block_height(&self) -> QueryResult<usize> {
    -            self.hotshot_qs.block_height().await
    +            StatusDataSource::block_height(&self.hotshot_qs).await
             }
    -
             fn metrics(&self) -> &PrometheusMetrics {
                 self.hotshot_qs.metrics()
             }
    @@ -1274,6 +1341,8 @@
                 availability::define_api(&Default::default()).unwrap(),
             )
             .unwrap()
    +        .register_module("node", node::define_api(&Default::default()).unwrap())
    +        .unwrap()
             .register_module("status", status::define_api(&Default::default()).unwrap())
             .unwrap()
             .module::<Error>("mod", module_spec)
    @@ -1292,7 +1361,11 @@
                         .module_state
                         .commit_version()
                         .map_err(Error::internal)?;
    -                state.hotshot_qs.skip_version().map_err(Error::internal)?;
    +                state
    +                    .hotshot_qs
    +                    .skip_version()
    +                    .await
    +                    .map_err(Error::internal)?;
                     state.store.commit_version().map_err(Error::internal)
                 }
                 .boxed()
    @@ -1311,7 +1384,7 @@
             // Check that we can still access the built-in modules.
             assert_eq!(
                 client
    -                .get::<u64>("status/latest_block_height")
    +                .get::<u64>("status/block-height")
                     .send()
                     .await
                     .unwrap(),
    @@ -1320,12 +1393,21 @@
             let (key, _) = BLSPubKey::generated_from_seed_indexed([0; 32], 0);
             assert_eq!(
                 client
    -                .get::<u64>(&format!("availability/proposals/{}/count", key.to_bytes()))
    +                .get::<u64>(&format!("node/proposals/{}/count", key.to_bytes()))
                     .send()
                     .await
                     .unwrap(),
                 0
             );
    +        assert_eq!(
    +            client
    +                .get::<MockHeader>("availability/header/0")
    +                .send()
    +                .await
    +                .unwrap()
    +                .block_number,
    +            0
    +        );
         }
     }
     

    \ No newline at end of file diff --git a/src/hotshot_query_service/node.rs.html b/src/hotshot_query_service/node.rs.html new file mode 100644 index 000000000..94ed0c2dd --- /dev/null +++ b/src/hotshot_query_service/node.rs.html @@ -0,0 +1,659 @@ +node.rs - source
    1
    +2
    +3
    +4
    +5
    +6
    +7
    +8
    +9
    +10
    +11
    +12
    +13
    +14
    +15
    +16
    +17
    +18
    +19
    +20
    +21
    +22
    +23
    +24
    +25
    +26
    +27
    +28
    +29
    +30
    +31
    +32
    +33
    +34
    +35
    +36
    +37
    +38
    +39
    +40
    +41
    +42
    +43
    +44
    +45
    +46
    +47
    +48
    +49
    +50
    +51
    +52
    +53
    +54
    +55
    +56
    +57
    +58
    +59
    +60
    +61
    +62
    +63
    +64
    +65
    +66
    +67
    +68
    +69
    +70
    +71
    +72
    +73
    +74
    +75
    +76
    +77
    +78
    +79
    +80
    +81
    +82
    +83
    +84
    +85
    +86
    +87
    +88
    +89
    +90
    +91
    +92
    +93
    +94
    +95
    +96
    +97
    +98
    +99
    +100
    +101
    +102
    +103
    +104
    +105
    +106
    +107
    +108
    +109
    +110
    +111
    +112
    +113
    +114
    +115
    +116
    +117
    +118
    +119
    +120
    +121
    +122
    +123
    +124
    +125
    +126
    +127
    +128
    +129
    +130
    +131
    +132
    +133
    +134
    +135
    +136
    +137
    +138
    +139
    +140
    +141
    +142
    +143
    +144
    +145
    +146
    +147
    +148
    +149
    +150
    +151
    +152
    +153
    +154
    +155
    +156
    +157
    +158
    +159
    +160
    +161
    +162
    +163
    +164
    +165
    +166
    +167
    +168
    +169
    +170
    +171
    +172
    +173
    +174
    +175
    +176
    +177
    +178
    +179
    +180
    +181
    +182
    +183
    +184
    +185
    +186
    +187
    +188
    +189
    +190
    +191
    +192
    +193
    +194
    +195
    +196
    +197
    +198
    +199
    +200
    +201
    +202
    +203
    +204
    +205
    +206
    +207
    +208
    +209
    +210
    +211
    +212
    +213
    +214
    +215
    +216
    +217
    +218
    +219
    +220
    +221
    +222
    +223
    +224
    +225
    +226
    +227
    +228
    +229
    +230
    +231
    +232
    +233
    +234
    +235
    +236
    +237
    +238
    +239
    +240
    +241
    +242
    +243
    +244
    +245
    +246
    +247
    +248
    +249
    +250
    +251
    +252
    +253
    +254
    +255
    +256
    +257
    +258
    +259
    +260
    +261
    +262
    +263
    +264
    +265
    +266
    +267
    +268
    +269
    +270
    +271
    +272
    +273
    +274
    +275
    +276
    +277
    +278
    +279
    +280
    +281
    +282
    +283
    +284
    +285
    +286
    +287
    +288
    +289
    +290
    +291
    +292
    +293
    +294
    +295
    +296
    +297
    +298
    +299
    +300
    +301
    +302
    +303
    +304
    +305
    +306
    +307
    +308
    +309
    +310
    +311
    +312
    +313
    +314
    +315
    +316
    +317
    +318
    +319
    +320
    +321
    +322
    +323
    +324
    +325
    +326
    +327
    +328
    +329
    +
    // Copyright (c) 2022 Espresso Systems (espressosys.com)
    +// This file is part of the HotShot Query Service library.
    +//
    +// This program is free software: you can redistribute it and/or modify it under the terms of the GNU
    +// General Public License as published by the Free Software Foundation, either version 3 of the
    +// License, or (at your option) any later version.
    +// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
    +// even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    +// General Public License for more details.
    +// You should have received a copy of the GNU General Public License along with this program. If not,
    +// see <https://www.gnu.org/licenses/>.
    +
    +//! A node's view of a HotShot chain
    +//!
    +//! The node API provides a subjective view of the HotShot blockchain, from the perspective of
    +//! one particular node. It provides access to information that the
    +//! [availability](crate::availability) API does not, because this information depends on the
    +//! perspective of the node observing it, and may be subject to eventual consistency. For example,
    +//! `/node/block-height` and `/node/proposals/:proposer_id/count` may both return smaller counts
    +//! than expected, if the node being queried is not fully synced with the entire history of the
    +//! chain. However, the node will _eventually_ sync and return the expected counts.
    +
    +use crate::{api::load_api, QueryError, SignatureKey};
    +use clap::Args;
    +use derive_more::From;
    +use futures::FutureExt;
    +use hotshot::types::SignatureKey as _;
    +use hotshot_types::traits::{node_implementation::NodeType, signature_key::EncodedPublicKey};
    +use serde::{Deserialize, Serialize};
    +use snafu::{OptionExt, ResultExt, Snafu};
    +use std::fmt::Display;
    +use std::path::PathBuf;
    +use tide_disco::{api::ApiError, method::ReadState, Api, RequestError, RequestParams, StatusCode};
    +
    +pub(crate) mod data_source;
    +pub(crate) mod query_data;
    +pub use data_source::*;
    +pub use query_data::*;
    +
    +#[derive(Args, Default)]
    +pub struct Options {
    +    #[arg(long = "node-api-path", env = "HOTSHOT_NODE_API_PATH")]
    +    pub api_path: Option<PathBuf>,
    +
    +    /// Additional API specification files to merge with `node-api-path`.
    +    ///
    +    /// These optional files may contain route definitions for application-specific routes that have
    +    /// been added as extensions to the basic node API.
    +    #[arg(
    +        long = "node-extension",
    +        env = "HOTSHOT_NODE_EXTENSIONS",
    +        value_delimiter = ','
    +    )]
    +    pub extensions: Vec<toml::Value>,
    +}
    +
    +#[derive(Clone, Debug, From, Snafu, Deserialize, Serialize)]
    +#[snafu(visibility(pub))]
    +pub enum Error {
    +    Request {
    +        source: RequestError,
    +    },
    +    #[snafu(display("{source}"))]
    +    #[from(ignore)]
    +    Query {
    +        source: QueryError,
    +    },
    +    #[snafu(display("error fetching proposals by {proposer}: {source}"))]
    +    #[from(ignore)]
    +    QueryProposals {
    +        source: QueryError,
    +        proposer: EncodedPublicKey,
    +    },
    +    #[snafu(display("malformed signature key"))]
    +    #[from(ignore)]
    +    InvalidSignatureKey,
    +    Custom {
    +        message: String,
    +        status: StatusCode,
    +    },
    +}
    +
    +impl Error {
    +    pub fn internal<M: Display>(message: M) -> Self {
    +        Self::Custom {
    +            message: message.to_string(),
    +            status: StatusCode::InternalServerError,
    +        }
    +    }
    +
    +    pub fn status(&self) -> StatusCode {
    +        match self {
    +            Self::Request { .. } | Self::InvalidSignatureKey => StatusCode::BadRequest,
    +            Self::Query { source, .. } | Self::QueryProposals { source, .. } => source.status(),
    +            Self::Custom { status, .. } => *status,
    +        }
    +    }
    +}
    +
    +pub fn define_api<State, Types: NodeType>(options: &Options) -> Result<Api<State, Error>, ApiError>
    +where
    +    State: 'static + Send + Sync + ReadState,
    +    <State as ReadState>::State: Send + Sync + NodeDataSource<Types>,
    +{
    +    let mut api = load_api::<State, Error>(
    +        options.api_path.as_ref(),
    +        include_str!("../api/node.toml"),
    +        options.extensions.clone(),
    +    )?;
    +    api.with_version("0.0.1".parse().unwrap())
    +        .get("block_height", |_req, state| {
    +            async move { state.block_height().await.context(QuerySnafu) }.boxed()
    +        })?
    +        .get("count_proposals", |req, state| {
    +            async move {
    +                let proposer = proposer_param::<Types>(&req, "proposer_id")?;
    +                state
    +                    .count_proposals(&proposer)
    +                    .await
    +                    .context(QueryProposalsSnafu {
    +                        proposer: proposer.to_bytes(),
    +                    })
    +            }
    +            .boxed()
    +        })?
    +        .get("get_proposals", |req, state| {
    +            async move {
    +                let proposer = proposer_param::<Types>(&req, "proposer_id")?;
    +                let limit = req.opt_integer_param("count")?;
    +                state
    +                    .get_proposals(&proposer, limit)
    +                    .await
    +                    .context(QueryProposalsSnafu {
    +                        proposer: proposer.to_bytes(),
    +                    })
    +            }
    +            .boxed()
    +        })?;
    +    Ok(api)
    +}
    +
    +fn proposer_param<Types: NodeType>(
    +    req: &RequestParams,
    +    param: &str,
    +) -> Result<SignatureKey<Types>, Error> {
    +    // The HotShot signature key trait temporarily lacks the trait bounds required to convert
    +    // directly from TaggedBase64. As a workaround, we parse the TaggedBase64 as an
    +    // EncodedPublicKey and then decode to the actual signature key type.
    +    //
    +    // This can be simplified after https://github.com/EspressoSystems/HotShot/issues/2374.
    +    let encoded: EncodedPublicKey = req.blob_param(param)?;
    +    SignatureKey::<Types>::from_bytes(&encoded).context(InvalidSignatureKeySnafu)
    +}
    +
    +#[cfg(test)]
    +mod test {
    +    use super::*;
    +    use crate::{
    +        data_source::{ExtensibleDataSource, FileSystemDataSource},
    +        testing::{
    +            consensus::{MockDataSource, MockNetwork},
    +            mocks::MockTypes,
    +            setup_test,
    +        },
    +        Error,
    +    };
    +    use async_std::{
    +        sync::RwLock,
    +        task::{sleep, spawn},
    +    };
    +    use futures::FutureExt;
    +    use hotshot::types::SignatureKey;
    +    use hotshot_signature_key::bn254::BLSPubKey;
    +    use portpicker::pick_unused_port;
    +    use std::time::Duration;
    +    use surf_disco::Client;
    +    use tempdir::TempDir;
    +    use tide_disco::App;
    +    use toml::toml;
    +
    +    #[async_std::test]
    +    async fn test_api() {
    +        setup_test();
    +
    +        // Create the consensus network.
    +        let mut network = MockNetwork::<MockDataSource>::init().await;
    +        network.start().await;
    +
    +        // Start the web server.
    +        let port = pick_unused_port().unwrap();
    +        let mut app = App::<_, Error>::with_state(network.data_source());
    +        app.register_module("node", define_api(&Default::default()).unwrap())
    +            .unwrap();
    +        spawn(app.serve(format!("0.0.0.0:{}", port)));
    +
    +        // Start a client.
    +        let client =
    +            Client::<Error>::new(format!("http://localhost:{}/node", port).parse().unwrap());
    +        assert!(client.connect(Some(Duration::from_secs(60))).await);
    +
    +        // Wait for each node to propose a block.
    +        while client.get::<usize>("block-height").send().await.unwrap() < network.num_nodes() + 1 {
    +            sleep(Duration::from_secs(1)).await;
    +        }
    +
    +        // Check proposals for node 0.
    +        let proposals: Vec<LeafQueryData<MockTypes>> = client
    +            .get(&format!("proposals/{}", network.proposer(0).to_bytes()))
    +            .send()
    +            .await
    +            .unwrap();
    +        assert!(!proposals.is_empty());
    +        for proposal in &proposals {
    +            assert_eq!(proposal.proposer(), network.proposer(0));
    +        }
    +        // Check the `proposals/limit` and `proposals/count` features.
    +        assert!(
    +            client
    +                .get::<u64>(&format!(
    +                    "proposals/{}/count",
    +                    network.proposer(0).to_bytes()
    +                ))
    +                .send()
    +                .await
    +                .unwrap()
    +                >= proposals.len() as u64
    +        );
    +        // For the limit queries, we just check the count. We don't know exactly which blocks to
    +        // expect in the response, since it returns the most recent `count` blocks which may
    +        // include new empty blocks committed since we started checking.
    +        assert_eq!(
    +            client
    +                .get::<Vec<LeafQueryData<MockTypes>>>(&format!(
    +                    "proposals/{}/limit/1",
    +                    network.proposer(0).to_bytes()
    +                ))
    +                .send()
    +                .await
    +                .unwrap()
    +                .len(),
    +            1
    +        );
    +        assert_eq!(
    +            client
    +                .get::<Vec<LeafQueryData<MockTypes>>>(&format!(
    +                    "proposals/{}/limit/0",
    +                    network.proposer(0).to_bytes()
    +                ))
    +                .send()
    +                .await
    +                .unwrap()
    +                .len(),
    +            0
    +        );
    +
    +        network.shut_down().await;
    +    }
    +
    +    #[async_std::test]
    +    async fn test_extensions() {
    +        setup_test();
    +
    +        let dir = TempDir::new("test_node_extensions").unwrap();
    +        let data_source = ExtensibleDataSource::new(
    +            FileSystemDataSource::<MockTypes>::create(dir.path())
    +                .await
    +                .unwrap(),
    +            0,
    +        );
    +
    +        // Create the API extensions specification.
    +        let extensions = toml! {
    +            [route.post_ext]
    +            PATH = ["/ext/:val"]
    +            METHOD = "POST"
    +            ":val" = "Integer"
    +
    +            [route.get_ext]
    +            PATH = ["/ext"]
    +            METHOD = "GET"
    +        };
    +
    +        let mut api = define_api::<
    +            RwLock<ExtensibleDataSource<FileSystemDataSource<MockTypes>, u64>>,
    +            MockTypes,
    +        >(&Options {
    +            extensions: vec![extensions.into()],
    +            ..Default::default()
    +        })
    +        .unwrap();
    +        api.get("get_ext", |_, state| {
    +            async move { Ok(*state.as_ref()) }.boxed()
    +        })
    +        .unwrap()
    +        .post("post_ext", |req, state| {
    +            async move {
    +                *state.as_mut() = req.integer_param("val")?;
    +                Ok(())
    +            }
    +            .boxed()
    +        })
    +        .unwrap();
    +
    +        let mut app = App::<_, Error>::with_state(RwLock::new(data_source));
    +        app.register_module("node", api).unwrap();
    +
    +        let port = pick_unused_port().unwrap();
    +        spawn(app.serve(format!("0.0.0.0:{}", port)));
    +
    +        let client =
    +            Client::<Error>::new(format!("http://localhost:{}/node", port).parse().unwrap());
    +        assert!(client.connect(Some(Duration::from_secs(60))).await);
    +
    +        assert_eq!(client.get::<u64>("ext").send().await.unwrap(), 0);
    +        client.post::<()>("ext/42").send().await.unwrap();
    +        assert_eq!(client.get::<u64>("ext").send().await.unwrap(), 42);
    +
    +        // Ensure we can still access the built-in functionality.
    +        let (key, _) = BLSPubKey::generated_from_seed_indexed([0; 32], 0);
    +        assert_eq!(
    +            client
    +                .get::<u64>(&format!("proposals/{}/count", key.to_bytes()))
    +                .send()
    +                .await
    +                .unwrap(),
    +            0
    +        );
    +    }
    +}
    +
    \ No newline at end of file diff --git a/src/hotshot_query_service/node/data_source.rs.html b/src/hotshot_query_service/node/data_source.rs.html new file mode 100644 index 000000000..213a3e3f9 --- /dev/null +++ b/src/hotshot_query_service/node/data_source.rs.html @@ -0,0 +1,71 @@ +data_source.rs - source
    1
    +2
    +3
    +4
    +5
    +6
    +7
    +8
    +9
    +10
    +11
    +12
    +13
    +14
    +15
    +16
    +17
    +18
    +19
    +20
    +21
    +22
    +23
    +24
    +25
    +26
    +27
    +28
    +29
    +30
    +31
    +32
    +33
    +34
    +35
    +
    // Copyright (c) 2022 Espresso Systems (espressosys.com)
    +// This file is part of the HotShot Query Service library.
    +//
    +// This program is free software: you can redistribute it and/or modify it under the terms of the GNU
    +// General Public License as published by the Free Software Foundation, either version 3 of the
    +// License, or (at your option) any later version.
    +// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
    +// even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    +// General Public License for more details.
    +// You should have received a copy of the GNU General Public License along with this program. If not,
    +// see <https://www.gnu.org/licenses/>.
    +
    +use super::query_data::LeafQueryData;
    +use crate::{QueryResult, SignatureKey};
    +use async_trait::async_trait;
    +use hotshot_types::traits::node_implementation::NodeType;
    +use std::error::Error;
    +use std::fmt::Debug;
    +
    +#[async_trait]
    +pub trait NodeDataSource<Types: NodeType> {
    +    async fn block_height(&self) -> QueryResult<usize>;
    +    async fn get_proposals(
    +        &self,
    +        proposer: &SignatureKey<Types>,
    +        limit: Option<usize>,
    +    ) -> QueryResult<Vec<LeafQueryData<Types>>>;
    +    async fn count_proposals(&self, proposer: &SignatureKey<Types>) -> QueryResult<usize>;
    +}
    +
    +#[async_trait]
    +pub trait UpdateNodeData<Types: NodeType> {
    +    type Error: Error + Debug + Send + Sync + 'static;
    +    async fn insert_leaf(&mut self, leaf: LeafQueryData<Types>) -> Result<(), Self::Error>;
    +}
    +
    \ No newline at end of file diff --git a/src/hotshot_query_service/node/query_data.rs.html b/src/hotshot_query_service/node/query_data.rs.html new file mode 100644 index 000000000..c04f924b6 --- /dev/null +++ b/src/hotshot_query_service/node/query_data.rs.html @@ -0,0 +1,27 @@ +query_data.rs - source
    1
    +2
    +3
    +4
    +5
    +6
    +7
    +8
    +9
    +10
    +11
    +12
    +13
    +
    // Copyright (c) 2022 Espresso Systems (espressosys.com)
    +// This file is part of the HotShot Query Service library.
    +//
    +// This program is free software: you can redistribute it and/or modify it under the terms of the GNU
    +// General Public License as published by the Free Software Foundation, either version 3 of the
    +// License, or (at your option) any later version.
    +// This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without
    +// even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    +// General Public License for more details.
    +// You should have received a copy of the GNU General Public License along with this program. If not,
    +// see <https://www.gnu.org/licenses/>.
    +
    +pub use crate::availability::LeafQueryData;
    +
    \ No newline at end of file diff --git a/src/hotshot_query_service/status.rs.html b/src/hotshot_query_service/status.rs.html index 9ef29d470..573dad139 100644 --- a/src/hotshot_query_service/status.rs.html +++ b/src/hotshot_query_service/status.rs.html @@ -288,12 +288,6 @@ 288 289 290 -291 -292 -293 -294 -295 -296

    // Copyright (c) 2022 Espresso Systems (espressosys.com)
     // This file is part of the HotShot Query Service library.
     //
    @@ -306,6 +300,20 @@
     // You should have received a copy of the GNU General Public License along with this program. If not,
     // see <https://www.gnu.org/licenses/>.
     
    +//! Queries for node-specific state and uncommitted data.
    +//!
    +//! Unlike the [availability](crate::availability) and [node](crate::node) APIs, which deal only
    +//! with committed data (albeit with different consistency properties), the status API offers a
    +//! glimpse into internal consensus state and uncommitted data. Here you can find low-level
    +//! information about a particular node, such as consensus and networking metrics. You can also find
    +//! information about pending blocks and transactions in the mempool.
    +//!
    +//! The status API is intended to be a lightweight way to inspect the activities and health of a
    +//! consensus node. It is the only API that can be run without any persistent storage, and its
    +//! memory overhead is also very low. As a consequence, it only serves two types of data:
    +//! * snapshots of the state right now, with no way to query historical snapshots
    +//! * summary statistics
    +
     use crate::api::load_api;
     use clap::Args;
     use derive_more::From;
    @@ -371,7 +379,7 @@
             options.extensions.clone(),
         )?;
         api.with_version("0.0.1".parse().unwrap())
    -        .get("latest_block_height", |_, state| {
    +        .get("block_height", |_, state| {
                 async { state.block_height().await.map_err(internal) }.boxed()
             })?
             .get("mempool_info", |_, state| {
    @@ -436,7 +444,7 @@
             network.submit_transaction(txn.clone()).await;
             loop {
                 let mempool = client
    -                .get::<MempoolQueryData>("mempool_info")
    +                .get::<MempoolQueryData>("mempool-info")
                     .send()
                     .await
                     .unwrap();
    @@ -454,14 +462,7 @@
                 sleep(Duration::from_secs(1)).await;
             }
             // The block height is initially 1 (for the genesis block).
    -        assert_eq!(
    -            client
    -                .get::<u64>("latest_block_height")
    -                .send()
    -                .await
    -                .unwrap(),
    -            1
    -        );
    +        assert_eq!(client.get::<u64>("block-height").send().await.unwrap(), 1);
     
             // Test Prometheus export.
             let mut res = surf::get(&format!("{url}/metrics")).send().await.unwrap();
    @@ -488,7 +489,7 @@
             // Start the validators and wait for the block to be finalized.
             network.start().await;
             while client
    -            .get::<MempoolQueryData>("mempool_info")
    +            .get::<MempoolQueryData>("mempool-info")
                 .send()
                 .await
                 .unwrap()
    @@ -502,17 +503,11 @@
             // Check updated block height. There can be a brief delay between the mempool statistics
             // being updated and the decide event being published. Retry this a few times until it
             // succeeds.
    -        while client
    -            .get::<u64>("latest_block_height")
    -            .send()
    -            .await
    -            .unwrap()
    -            == 1
    -        {
    +        while client.get::<u64>("block-height").send().await.unwrap() == 1 {
                 tracing::info!("waiting for block height to update");
                 sleep(Duration::from_secs(1)).await;
             }
    -        let success_rate = client.get::<f64>("success_rate").send().await.unwrap();
    +        let success_rate = client.get::<f64>("success-rate").send().await.unwrap();
             // If metrics are populating correctly, we should get a finite number. If not, we might get
             // NaN or infinity due to division by 0.
             assert!(success_rate.is_finite(), "{success_rate}");
    @@ -580,14 +575,7 @@
             assert_eq!(client.get::<u64>("ext").send().await.unwrap(), 42);
     
             // Ensure we can still access the built-in functionality.
    -        assert_eq!(
    -            client
    -                .get::<u64>("latest_block_height")
    -                .send()
    -                .await
    -                .unwrap(),
    -            1
    -        );
    +        assert_eq!(client.get::<u64>("block-height").send().await.unwrap(), 1);
         }
     }
     
    \ No newline at end of file diff --git a/trait.impl/clap_builder/derive/trait.Args.js b/trait.impl/clap_builder/derive/trait.Args.js index 88128810f..0e853bdf3 100644 --- a/trait.impl/clap_builder/derive/trait.Args.js +++ b/trait.impl/clap_builder/derive/trait.Args.js @@ -1,3 +1,3 @@ (function() {var implementors = { -"hotshot_query_service":[["impl Args for Options"],["impl Args for Options"],["impl Args for Options"]] +"hotshot_query_service":[["impl Args for Options"],["impl Args for Options"],["impl Args for Options"],["impl Args for Options"]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/clap_builder/derive/trait.FromArgMatches.js b/trait.impl/clap_builder/derive/trait.FromArgMatches.js index a14b299bd..67bb51712 100644 --- a/trait.impl/clap_builder/derive/trait.FromArgMatches.js +++ b/trait.impl/clap_builder/derive/trait.FromArgMatches.js @@ -1,3 +1,3 @@ (function() {var implementors = { -"hotshot_query_service":[["impl FromArgMatches for Options"],["impl FromArgMatches for Options"],["impl FromArgMatches for Options"]] +"hotshot_query_service":[["impl FromArgMatches for Options"],["impl FromArgMatches for Options"],["impl FromArgMatches for Options"],["impl FromArgMatches for Options"]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/clone/trait.Clone.js b/trait.impl/core/clone/trait.Clone.js index 222023648..cffc2a125 100644 --- a/trait.impl/core/clone/trait.Clone.js +++ b/trait.impl/core/clone/trait.Clone.js @@ -1,3 +1,3 @@ (function() {var implementors = { -"hotshot_query_service":[["impl Clone for Counter"],["impl Clone for NotFoundSnafu"],["impl<__T0: Clone, __T1: Clone> Clone for LeafStreamSnafu<__T0, __T1>"],["impl<__T0: Clone, __T1: Clone> Clone for BlockStreamSnafu<__T0, __T1>"],["impl<__T0: Clone> Clone for QueryTransactionSnafu<__T0>"],["impl Clone for StreamBlockSnafu"],["impl Clone for MetricsDataSource"],["impl Clone for Label"],["impl<__T0: Clone> Clone for QueryBlockSnafu<__T0>"],["impl<D: Clone, U: Clone> Clone for ExtensibleDataSource<D, U>"],["impl<__T0: Clone> Clone for Snafu<__T0>"],["impl<__T0: Clone, __T1: Clone> Clone for InvalidTransactionIndexSnafu<__T0, __T1>"],["impl<Types: Clone + NodeType> Clone for LeafQueryData<Types>"],["impl Clone for PrometheusMetrics"],["impl Clone for InvalidSignatureKeySnafu"],["impl<Types: Clone + NodeType> Clone for BlockQueryData<Types>"],["impl Clone for Config"],["impl<Types: Clone + NodeType> Clone for TransactionQueryData<Types>where\n Payload<Types>: QueryablePayload,"],["impl<__T0: Clone> Clone for QueryProposalsSnafu<__T0>"],["impl<T: Committable> Clone for ResourceId<T>"],["impl<__T0: Clone> Clone for QueryLeafSnafu<__T0>"],["impl Clone for Error"],["impl Clone for RequestSnafu"],["impl Clone for Gauge"],["impl Clone for StreamLeafSnafu"],["impl Clone for QueryError"],["impl Clone for MissingSnafu"],["impl<Types: Clone + NodeType> Clone for InconsistentLeafError<Types>"],["impl Clone for Histogram"],["impl Clone for Error"],["impl<__T0: Clone, __T1: Clone> Clone for CustomSnafu<__T0, __T1>"],["impl Clone for MempoolQueryData"],["impl Clone for Error"]] +"hotshot_query_service":[["impl Clone for NotFoundSnafu"],["impl Clone for QuerySnafu"],["impl Clone for Error"],["impl<__T0: Clone> Clone for FetchTransactionSnafu<__T0>"],["impl Clone for Histogram"],["impl<__T0: Clone, __T1: Clone> Clone for InvalidTransactionIndexSnafu<__T0, __T1>"],["impl<Types: Clone + NodeType> Clone for BlockQueryData<Types>"],["impl Clone for Error"],["impl<__T0: Clone, __T1: Clone> Clone for CustomSnafu<__T0, __T1>"],["impl<D: Clone, U: Clone> Clone for ExtensibleDataSource<D, U>"],["impl Clone for RequestSnafu"],["impl<__T0: Clone, __T1: Clone> Clone for CustomSnafu<__T0, __T1>"],["impl<__T0: Clone> Clone for QueryProposalsSnafu<__T0>"],["impl<T: Committable> Clone for ResourceId<T>"],["impl Clone for Gauge"],["impl Clone for InvalidSignatureKeySnafu"],["impl<Types: Clone + NodeType> Clone for InconsistentLeafError<Types>"],["impl<Types: Clone + NodeType> Clone for LeafQueryData<Types>"],["impl Clone for Config"],["impl<__T0: Clone> Clone for Snafu<__T0>"],["impl<__T0: Clone> Clone for FetchBlockSnafu<__T0>"],["impl Clone for Error"],["impl<Types, S, P> Clone for FetchingDataSource<Types, S, P>where\n Types: NodeType,"],["impl Clone for MissingSnafu"],["impl Clone for Error"],["impl Clone for Label"],["impl Clone for MetricsDataSource"],["impl Clone for QueryError"],["impl<__T0: Clone> Clone for FetchLeafSnafu<__T0>"],["impl Clone for PrometheusMetrics"],["impl Clone for Counter"],["impl Clone for MempoolQueryData"],["impl<Types: Clone + NodeType> Clone for TransactionQueryData<Types>where\n Payload<Types>: QueryablePayload,"],["impl Clone for RequestSnafu"]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/cmp/trait.Eq.js b/trait.impl/core/cmp/trait.Eq.js index ee2308e86..35f8e28a1 100644 --- a/trait.impl/core/cmp/trait.Eq.js +++ b/trait.impl/core/cmp/trait.Eq.js @@ -1,3 +1,3 @@ (function() {var implementors = { -"hotshot_query_service":[["impl Eq for MempoolQueryData"],["impl<Types: Eq + NodeType> Eq for TransactionQueryData<Types>where\n Payload<Types>: QueryablePayload,"],["impl<T: Committable> Eq for ResourceId<T>"],["impl<Types: Eq + NodeType> Eq for BlockQueryData<Types>"],["impl<Types: Eq + NodeType> Eq for LeafQueryData<Types>"]] +"hotshot_query_service":[["impl<T: Committable> Eq for ResourceId<T>"],["impl Eq for MempoolQueryData"],["impl<Types: Eq + NodeType> Eq for TransactionQueryData<Types>where\n Payload<Types>: QueryablePayload,"],["impl<Types: Eq + NodeType> Eq for BlockQueryData<Types>"],["impl<Types: Eq + NodeType> Eq for LeafQueryData<Types>"]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/cmp/trait.PartialEq.js b/trait.impl/core/cmp/trait.PartialEq.js index 7ad73eff2..2873f78de 100644 --- a/trait.impl/core/cmp/trait.PartialEq.js +++ b/trait.impl/core/cmp/trait.PartialEq.js @@ -1,3 +1,3 @@ (function() {var implementors = { -"hotshot_query_service":[["impl<Types: PartialEq + NodeType> PartialEq for BlockQueryData<Types>"],["impl<T: Committable> PartialEq for ResourceId<T>"],["impl<Types: PartialEq + NodeType> PartialEq for TransactionQueryData<Types>where\n Payload<Types>: QueryablePayload,"],["impl PartialEq for MempoolQueryData"],["impl<Types: PartialEq + NodeType> PartialEq for LeafQueryData<Types>"]] +"hotshot_query_service":[["impl<Types: PartialEq + NodeType> PartialEq for BlockQueryData<Types>"],["impl<T: Committable> PartialEq for ResourceId<T>"],["impl<Types: PartialEq + NodeType> PartialEq for LeafQueryData<Types>"],["impl<Types: PartialEq + NodeType> PartialEq for TransactionQueryData<Types>where\n Payload<Types>: QueryablePayload,"],["impl PartialEq for MempoolQueryData"]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/convert/trait.From.js b/trait.impl/core/convert/trait.From.js index 0e9d922d0..4e22da942 100644 --- a/trait.impl/core/convert/trait.From.js +++ b/trait.impl/core/convert/trait.From.js @@ -1,3 +1,3 @@ (function() {var implementors = { -"hotshot_query_service":[["impl From<String> for Error"],["impl From<Error> for Error"],["impl From<RequestError> for Error"],["impl From<(String, StatusCode)> for Error"],["impl From<(String, StatusCode)> for Error"],["impl<T: Committable> From<Commitment<T>> for ResourceId<T>"],["impl From<RequestError> for Error"],["impl From<Config> for Config"],["impl<T: Committable> From<usize> for ResourceId<T>"],["impl From<Error> for Error"],["impl From<Error> for MetricsError"]] +"hotshot_query_service":[["impl From<Config> for Config"],["impl From<Error> for MetricsError"],["impl From<(String, StatusCode)> for Error"],["impl From<RequestError> for Error"],["impl From<(String, StatusCode)> for Error"],["impl From<String> for Error"],["impl From<RequestError> for Error"],["impl<T: Committable> From<usize> for ResourceId<T>"],["impl From<(String, StatusCode)> for Error"],["impl From<Error> for Error"],["impl From<RequestError> for Error"],["impl From<Error> for Error"],["impl From<Error> for Error"],["impl<T: Committable> From<Commitment<T>> for ResourceId<T>"]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/default/trait.Default.js b/trait.impl/core/default/trait.Default.js index ad42e8b9d..67e8bf92a 100644 --- a/trait.impl/core/default/trait.Default.js +++ b/trait.impl/core/default/trait.Default.js @@ -1,3 +1,3 @@ (function() {var implementors = { -"hotshot_query_service":[["impl Default for Options"],["impl Default for Options"],["impl Default for PrometheusMetrics"],["impl Default for Options"],["impl Default for Config"],["impl Default for MetricsDataSource"],["impl Default for MempoolQueryData"]] +"hotshot_query_service":[["impl Default for Options"],["impl Default for MetricsDataSource"],["impl Default for PrometheusMetrics"],["impl Default for Config"],["impl Default for MempoolQueryData"],["impl Default for Options"],["impl Default for Options"],["impl Default for Options"]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/error/trait.Error.js b/trait.impl/core/error/trait.Error.js index 6e77647fd..0048c6a29 100644 --- a/trait.impl/core/error/trait.Error.js +++ b/trait.impl/core/error/trait.Error.js @@ -1,3 +1,3 @@ (function() {var implementors = { -"hotshot_query_service":[["impl Error for QueryErrorwhere\n Self: Debug + Display,"],["impl Error for Errorwhere\n Self: Debug + Display,"],["impl Error for Errorwhere\n Self: Debug + Display,"],["impl Error for Errorwhere\n Self: Debug + Display,"],["impl Error for MetricsErrorwhere\n Self: Debug + Display,"],["impl<Types: NodeType> Error for InconsistentLeafError<Types>where\n Self: Debug + Display,"]] +"hotshot_query_service":[["impl Error for QueryErrorwhere\n Self: Debug + Display,"],["impl Error for Errorwhere\n Self: Debug + Display,"],["impl Error for Errorwhere\n Self: Debug + Display,"],["impl Error for MetricsErrorwhere\n Self: Debug + Display,"],["impl Error for Errorwhere\n Self: Debug + Display,"],["impl<Types: NodeType> Error for InconsistentLeafError<Types>where\n Self: Debug + Display,"],["impl Error for Errorwhere\n Self: Debug + Display,"]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/fmt/trait.Debug.js b/trait.impl/core/fmt/trait.Debug.js index f691eac18..93cab1e89 100644 --- a/trait.impl/core/fmt/trait.Debug.js +++ b/trait.impl/core/fmt/trait.Debug.js @@ -1,3 +1,3 @@ (function() {var implementors = { -"hotshot_query_service":[["impl Debug for PrometheusMetrics"],["impl Debug for Error"],["impl<T: Committable> Debug for ResourceId<T>"],["impl Debug for MempoolQueryData"],["impl<__T0: Debug> Debug for QueryProposalsSnafu<__T0>"],["impl<__T0: Debug> Debug for Snafu<__T0>"],["impl Debug for QueryError"],["impl Debug for Counter"],["impl Debug for Label"],["impl<__T0: Debug> Debug for QueryTransactionSnafu<__T0>"],["impl Debug for MissingSnafu"],["impl Debug for MetricsDataSource"],["impl<Types: Debug + NodeType> Debug for LeafQueryData<Types>"],["impl Debug for Error"],["impl<__T0: Debug> Debug for QueryBlockSnafu<__T0>"],["impl<Types: Debug + NodeType> Debug for BlockQueryData<Types>"],["impl<__T0: Debug, __T1: Debug> Debug for BlockStreamSnafu<__T0, __T1>"],["impl<__T0: Debug> Debug for QueryLeafSnafu<__T0>"],["impl Debug for Histogram"],["impl Debug for InvalidSignatureKeySnafu"],["impl<Types> Debug for SqlDataSource<Types>where\n Types: NodeType + Debug,"],["impl<Types: NodeType> Debug for FileSystemDataSource<Types>where\n Payload<Types>: QueryablePayload,\n HashMap<LeafHash<Types>, u64>: Debug,\n HashMap<BlockHash<Types>, u64>: Debug,\n HashMap<TransactionHash<Types>, (u64, TransactionIndex<Types>)>: Debug,\n HashMap<SignatureKey<Types>, Vec<u64>>: Debug,\n LedgerLog<LeafQueryData<Types>>: Debug,\n LedgerLog<BlockQueryData<Types>>: Debug,"],["impl Debug for RequestSnafu"],["impl Debug for Error"],["impl<Types: Debug + NodeType> Debug for InconsistentLeafError<Types>"],["impl<Types: Debug + NodeType> Debug for TransactionQueryData<Types>where\n Payload<Types>: QueryablePayload,"],["impl Debug for MetricsError"],["impl Debug for Gauge"],["impl<__T0: Debug, __T1: Debug> Debug for CustomSnafu<__T0, __T1>"],["impl<__T0: Debug, __T1: Debug> Debug for LeafStreamSnafu<__T0, __T1>"],["impl<D: Debug, U: Debug> Debug for ExtensibleDataSource<D, U>"],["impl Debug for NotFoundSnafu"],["impl Debug for StreamLeafSnafu"],["impl<__T0: Debug, __T1: Debug> Debug for InvalidTransactionIndexSnafu<__T0, __T1>"],["impl Debug for StreamBlockSnafu"],["impl Debug for Config"]] +"hotshot_query_service":[["impl Debug for SqlStorage"],["impl Debug for Gauge"],["impl<Types: Debug + NodeType> Debug for BlockQueryData<Types>"],["impl Debug for Error"],["impl Debug for Label"],["impl Debug for RequestSnafu"],["impl<D: Debug, U: Debug> Debug for ExtensibleDataSource<D, U>"],["impl<__T0: Debug> Debug for FetchLeafSnafu<__T0>"],["impl Debug for MetricsError"],["impl<__T0: Debug> Debug for Snafu<__T0>"],["impl<Types: Debug + NodeType> Debug for InconsistentLeafError<Types>"],["impl Debug for InvalidSignatureKeySnafu"],["impl Debug for Error"],["impl Debug for MissingSnafu"],["impl<__T0: Debug> Debug for QueryProposalsSnafu<__T0>"],["impl Debug for MempoolQueryData"],["impl<__T0: Debug, __T1: Debug> Debug for CustomSnafu<__T0, __T1>"],["impl<__T0: Debug> Debug for FetchBlockSnafu<__T0>"],["impl Debug for Counter"],["impl Debug for Histogram"],["impl<__T0: Debug> Debug for FetchTransactionSnafu<__T0>"],["impl<Types: Debug + NodeType> Debug for LeafQueryData<Types>"],["impl Debug for Error"],["impl Debug for NotFoundSnafu"],["impl<Types: NodeType> Debug for FileSystemStorage<Types>where\n Payload<Types>: QueryablePayload,\n HashMap<LeafHash<Types>, u64>: Debug,\n HashMap<BlockHash<Types>, u64>: Debug,\n HashMap<TransactionHash<Types>, (u64, TransactionIndex<Types>)>: Debug,\n HashMap<SignatureKey<Types>, Vec<u64>>: Debug,\n LedgerLog<LeafQueryData<Types>>: Debug,\n LedgerLog<BlockQueryData<Types>>: Debug,"],["impl Debug for QueryError"],["impl<Types, S, P> Debug for FetchingDataSource<Types, S, P>where\n Types: NodeType,\n S: Debug,\n P: Debug,"],["impl Debug for PrometheusMetrics"],["impl Debug for MetricsDataSource"],["impl<T: Committable> Debug for ResourceId<T>"],["impl<__T0: Debug, __T1: Debug> Debug for InvalidTransactionIndexSnafu<__T0, __T1>"],["impl Debug for Error"],["impl Debug for Config"],["impl<Types: Debug + NodeType> Debug for TransactionQueryData<Types>where\n Payload<Types>: QueryablePayload,"],["impl Debug for QuerySnafu"],["impl Debug for RequestSnafu"],["impl<__T0: Debug, __T1: Debug> Debug for CustomSnafu<__T0, __T1>"]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/fmt/trait.Display.js b/trait.impl/core/fmt/trait.Display.js index 60dd415c2..cb26ee293 100644 --- a/trait.impl/core/fmt/trait.Display.js +++ b/trait.impl/core/fmt/trait.Display.js @@ -1,3 +1,3 @@ (function() {var implementors = { -"hotshot_query_service":[["impl<T: Committable> Display for ResourceId<T>"],["impl<Types: NodeType> Display for InconsistentLeafError<Types>"],["impl Display for Error"],["impl Display for QueryError"],["impl Display for Error"],["impl Display for Error"],["impl Display for MetricsError"]] +"hotshot_query_service":[["impl Display for Error"],["impl Display for Error"],["impl Display for MetricsError"],["impl Display for Error"],["impl Display for QueryError"],["impl<T: Committable> Display for ResourceId<T>"],["impl<Types: NodeType> Display for InconsistentLeafError<Types>"],["impl Display for Error"]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/future/into_future/trait.IntoFuture.js b/trait.impl/core/future/into_future/trait.IntoFuture.js new file mode 100644 index 000000000..bacab69da --- /dev/null +++ b/trait.impl/core/future/into_future/trait.IntoFuture.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"hotshot_query_service":[["impl<T: Send + 'static> IntoFuture for Fetch<T>"]] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/marker/trait.Copy.js b/trait.impl/core/marker/trait.Copy.js index b395b6849..78a0771ff 100644 --- a/trait.impl/core/marker/trait.Copy.js +++ b/trait.impl/core/marker/trait.Copy.js @@ -1,3 +1,3 @@ (function() {var implementors = { -"hotshot_query_service":[["impl Copy for StreamBlockSnafu"],["impl<__T0: Copy, __T1: Copy> Copy for CustomSnafu<__T0, __T1>"],["impl Copy for MissingSnafu"],["impl Copy for NotFoundSnafu"],["impl Copy for InvalidSignatureKeySnafu"],["impl<D: Copy, U: Copy> Copy for ExtensibleDataSource<D, U>"],["impl<__T0: Copy> Copy for QueryBlockSnafu<__T0>"],["impl<__T0: Copy, __T1: Copy> Copy for BlockStreamSnafu<__T0, __T1>"],["impl<__T0: Copy> Copy for QueryProposalsSnafu<__T0>"],["impl<__T0: Copy> Copy for QueryLeafSnafu<__T0>"],["impl<__T0: Copy> Copy for QueryTransactionSnafu<__T0>"],["impl<__T0: Copy, __T1: Copy> Copy for LeafStreamSnafu<__T0, __T1>"],["impl Copy for RequestSnafu"],["impl<T: Committable> Copy for ResourceId<T>"],["impl Copy for StreamLeafSnafu"],["impl<__T0: Copy, __T1: Copy> Copy for InvalidTransactionIndexSnafu<__T0, __T1>"],["impl<__T0: Copy> Copy for Snafu<__T0>"]] +"hotshot_query_service":[["impl<__T0: Copy> Copy for Snafu<__T0>"],["impl<__T0: Copy, __T1: Copy> Copy for InvalidTransactionIndexSnafu<__T0, __T1>"],["impl<__T0: Copy> Copy for FetchBlockSnafu<__T0>"],["impl<__T0: Copy> Copy for FetchLeafSnafu<__T0>"],["impl Copy for InvalidSignatureKeySnafu"],["impl<__T0: Copy> Copy for QueryProposalsSnafu<__T0>"],["impl Copy for RequestSnafu"],["impl Copy for NotFoundSnafu"],["impl<D: Copy, U: Copy> Copy for ExtensibleDataSource<D, U>"],["impl Copy for RequestSnafu"],["impl<__T0: Copy> Copy for FetchTransactionSnafu<__T0>"],["impl<T: Committable> Copy for ResourceId<T>"],["impl<__T0: Copy, __T1: Copy> Copy for CustomSnafu<__T0, __T1>"],["impl Copy for MissingSnafu"],["impl Copy for QuerySnafu"],["impl<__T0: Copy, __T1: Copy> Copy for CustomSnafu<__T0, __T1>"]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/marker/trait.Freeze.js b/trait.impl/core/marker/trait.Freeze.js index 20d5177cf..5c6af697f 100644 --- a/trait.impl/core/marker/trait.Freeze.js +++ b/trait.impl/core/marker/trait.Freeze.js @@ -1,3 +1,3 @@ (function() {var implementors = { -"hotshot_query_service":[["impl<T> Freeze for ResourceId<T>",1,["hotshot_query_service::availability::data_source::ResourceId"]],["impl<Types> Freeze for LeafQueryData<Types>where\n <Types as NodeType>::BlockHeader: Freeze,\n <Types as NodeType>::BlockPayload: Freeze,\n <<Types as NodeType>::SignatureKey as SignatureKey>::QCType: Freeze,\n <Types as NodeType>::SignatureKey: Freeze,\n <Types as NodeType>::Time: Freeze,",1,["hotshot_query_service::availability::query_data::LeafQueryData"]],["impl<Types> Freeze for InconsistentLeafError<Types>",1,["hotshot_query_service::availability::query_data::InconsistentLeafError"]],["impl<Types> Freeze for BlockQueryData<Types>where\n <Types as NodeType>::BlockHeader: Freeze,\n <Types as NodeType>::BlockPayload: Freeze,",1,["hotshot_query_service::availability::query_data::BlockQueryData"]],["impl<Types> Freeze for TransactionQueryData<Types>where\n <<Types as NodeType>::BlockPayload as QueryablePayload>::InclusionProof: Freeze,\n <Types as NodeType>::Transaction: Freeze,",1,["hotshot_query_service::availability::query_data::TransactionQueryData"]],["impl Freeze for Options",1,["hotshot_query_service::availability::Options"]],["impl Freeze for Error",1,["hotshot_query_service::availability::Error"]],["impl Freeze for RequestSnafu",1,["hotshot_query_service::availability::RequestSnafu"]],["impl<__T0> Freeze for QueryLeafSnafu<__T0>where\n __T0: Freeze,",1,["hotshot_query_service::availability::QueryLeafSnafu"]],["impl Freeze for StreamLeafSnafu",1,["hotshot_query_service::availability::StreamLeafSnafu"]],["impl<__T0> Freeze for QueryBlockSnafu<__T0>where\n __T0: Freeze,",1,["hotshot_query_service::availability::QueryBlockSnafu"]],["impl Freeze for StreamBlockSnafu",1,["hotshot_query_service::availability::StreamBlockSnafu"]],["impl<__T0> Freeze for QueryTransactionSnafu<__T0>where\n __T0: Freeze,",1,["hotshot_query_service::availability::QueryTransactionSnafu"]],["impl<__T0> Freeze for QueryProposalsSnafu<__T0>where\n __T0: Freeze,",1,["hotshot_query_service::availability::QueryProposalsSnafu"]],["impl<__T0, __T1> Freeze for InvalidTransactionIndexSnafu<__T0, __T1>where\n __T0: Freeze,\n __T1: Freeze,",1,["hotshot_query_service::availability::InvalidTransactionIndexSnafu"]],["impl<__T0, __T1> Freeze for LeafStreamSnafu<__T0, __T1>where\n __T0: Freeze,\n __T1: Freeze,",1,["hotshot_query_service::availability::LeafStreamSnafu"]],["impl<__T0, __T1> Freeze for BlockStreamSnafu<__T0, __T1>where\n __T0: Freeze,\n __T1: Freeze,",1,["hotshot_query_service::availability::BlockStreamSnafu"]],["impl Freeze for InvalidSignatureKeySnafu",1,["hotshot_query_service::availability::InvalidSignatureKeySnafu"]],["impl<__T0, __T1> Freeze for CustomSnafu<__T0, __T1>where\n __T0: Freeze,\n __T1: Freeze,",1,["hotshot_query_service::availability::CustomSnafu"]],["impl<D, U> Freeze for ExtensibleDataSource<D, U>where\n D: Freeze,\n U: Freeze,",1,["hotshot_query_service::data_source::extension::ExtensibleDataSource"]],["impl<Types> Freeze for FileSystemDataSource<Types>",1,["hotshot_query_service::data_source::fs::FileSystemDataSource"]],["impl Freeze for MetricsDataSource",1,["hotshot_query_service::data_source::metrics::MetricsDataSource"]],["impl Freeze for Config",1,["hotshot_query_service::data_source::sql::Config"]],["impl<Types> Freeze for SqlDataSource<Types>",1,["hotshot_query_service::data_source::sql::SqlDataSource"]],["impl<'a> Freeze for Transaction<'a>",1,["hotshot_query_service::data_source::sql::Transaction"]],["impl Freeze for Error",1,["hotshot_query_service::error::Error"]],["impl Freeze for MetricsError",1,["hotshot_query_service::metrics::MetricsError"]],["impl Freeze for PrometheusMetrics",1,["hotshot_query_service::metrics::PrometheusMetrics"]],["impl Freeze for Counter",1,["hotshot_query_service::metrics::Counter"]],["impl Freeze for Gauge",1,["hotshot_query_service::metrics::Gauge"]],["impl Freeze for Histogram",1,["hotshot_query_service::metrics::Histogram"]],["impl Freeze for Label",1,["hotshot_query_service::metrics::Label"]],["impl Freeze for MempoolQueryData",1,["hotshot_query_service::status::query_data::MempoolQueryData"]],["impl Freeze for Options",1,["hotshot_query_service::status::Options"]],["impl Freeze for Error",1,["hotshot_query_service::status::Error"]],["impl Freeze for QueryError",1,["hotshot_query_service::QueryError"]],["impl Freeze for NotFoundSnafu",1,["hotshot_query_service::NotFoundSnafu"]],["impl Freeze for MissingSnafu",1,["hotshot_query_service::MissingSnafu"]],["impl<__T0> Freeze for Snafu<__T0>where\n __T0: Freeze,",1,["hotshot_query_service::Snafu"]],["impl Freeze for Options",1,["hotshot_query_service::Options"]]] +"hotshot_query_service":[["impl<T> Freeze for ResourceId<T>",1,["hotshot_query_service::availability::data_source::ResourceId"]],["impl<T> Freeze for Fetch<T>where\n T: Freeze,",1,["hotshot_query_service::availability::fetch::Fetch"]],["impl<Types> Freeze for LeafQueryData<Types>where\n <Types as NodeType>::BlockHeader: Freeze,\n <Types as NodeType>::BlockPayload: Freeze,\n <<Types as NodeType>::SignatureKey as SignatureKey>::QCType: Freeze,\n <Types as NodeType>::SignatureKey: Freeze,\n <Types as NodeType>::Time: Freeze,",1,["hotshot_query_service::availability::query_data::LeafQueryData"]],["impl<Types> Freeze for InconsistentLeafError<Types>",1,["hotshot_query_service::availability::query_data::InconsistentLeafError"]],["impl<Types> Freeze for BlockQueryData<Types>where\n <Types as NodeType>::BlockHeader: Freeze,\n <Types as NodeType>::BlockPayload: Freeze,",1,["hotshot_query_service::availability::query_data::BlockQueryData"]],["impl<Types> Freeze for TransactionQueryData<Types>where\n <<Types as NodeType>::BlockPayload as QueryablePayload>::InclusionProof: Freeze,\n <Types as NodeType>::Transaction: Freeze,",1,["hotshot_query_service::availability::query_data::TransactionQueryData"]],["impl Freeze for Options",1,["hotshot_query_service::availability::Options"]],["impl Freeze for Error",1,["hotshot_query_service::availability::Error"]],["impl Freeze for RequestSnafu",1,["hotshot_query_service::availability::RequestSnafu"]],["impl<__T0> Freeze for FetchLeafSnafu<__T0>where\n __T0: Freeze,",1,["hotshot_query_service::availability::FetchLeafSnafu"]],["impl<__T0> Freeze for FetchBlockSnafu<__T0>where\n __T0: Freeze,",1,["hotshot_query_service::availability::FetchBlockSnafu"]],["impl<__T0> Freeze for FetchTransactionSnafu<__T0>where\n __T0: Freeze,",1,["hotshot_query_service::availability::FetchTransactionSnafu"]],["impl<__T0, __T1> Freeze for InvalidTransactionIndexSnafu<__T0, __T1>where\n __T0: Freeze,\n __T1: Freeze,",1,["hotshot_query_service::availability::InvalidTransactionIndexSnafu"]],["impl<__T0, __T1> Freeze for CustomSnafu<__T0, __T1>where\n __T0: Freeze,\n __T1: Freeze,",1,["hotshot_query_service::availability::CustomSnafu"]],["impl<D, U> Freeze for ExtensibleDataSource<D, U>where\n D: Freeze,\n U: Freeze,",1,["hotshot_query_service::data_source::extension::ExtensibleDataSource"]],["impl<Types, S, P> Freeze for FetchingDataSource<Types, S, P>",1,["hotshot_query_service::data_source::fetching::FetchingDataSource"]],["impl Freeze for MetricsDataSource",1,["hotshot_query_service::data_source::metrics::MetricsDataSource"]],["impl<Types> Freeze for FileSystemStorage<Types>",1,["hotshot_query_service::data_source::storage::fs::FileSystemStorage"]],["impl Freeze for Config",1,["hotshot_query_service::data_source::storage::sql::Config"]],["impl Freeze for SqlStorage",1,["hotshot_query_service::data_source::storage::sql::SqlStorage"]],["impl<'a> Freeze for Transaction<'a>",1,["hotshot_query_service::data_source::storage::sql::Transaction"]],["impl Freeze for Error",1,["hotshot_query_service::error::Error"]],["impl Freeze for MetricsError",1,["hotshot_query_service::metrics::MetricsError"]],["impl Freeze for PrometheusMetrics",1,["hotshot_query_service::metrics::PrometheusMetrics"]],["impl Freeze for Counter",1,["hotshot_query_service::metrics::Counter"]],["impl Freeze for Gauge",1,["hotshot_query_service::metrics::Gauge"]],["impl Freeze for Histogram",1,["hotshot_query_service::metrics::Histogram"]],["impl Freeze for Label",1,["hotshot_query_service::metrics::Label"]],["impl Freeze for Options",1,["hotshot_query_service::node::Options"]],["impl Freeze for Error",1,["hotshot_query_service::node::Error"]],["impl Freeze for RequestSnafu",1,["hotshot_query_service::node::RequestSnafu"]],["impl Freeze for QuerySnafu",1,["hotshot_query_service::node::QuerySnafu"]],["impl<__T0> Freeze for QueryProposalsSnafu<__T0>where\n __T0: Freeze,",1,["hotshot_query_service::node::QueryProposalsSnafu"]],["impl Freeze for InvalidSignatureKeySnafu",1,["hotshot_query_service::node::InvalidSignatureKeySnafu"]],["impl<__T0, __T1> Freeze for CustomSnafu<__T0, __T1>where\n __T0: Freeze,\n __T1: Freeze,",1,["hotshot_query_service::node::CustomSnafu"]],["impl Freeze for MempoolQueryData",1,["hotshot_query_service::status::query_data::MempoolQueryData"]],["impl Freeze for Options",1,["hotshot_query_service::status::Options"]],["impl Freeze for Error",1,["hotshot_query_service::status::Error"]],["impl Freeze for QueryError",1,["hotshot_query_service::QueryError"]],["impl Freeze for NotFoundSnafu",1,["hotshot_query_service::NotFoundSnafu"]],["impl Freeze for MissingSnafu",1,["hotshot_query_service::MissingSnafu"]],["impl<__T0> Freeze for Snafu<__T0>where\n __T0: Freeze,",1,["hotshot_query_service::Snafu"]],["impl Freeze for Options",1,["hotshot_query_service::Options"]]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/marker/trait.Send.js b/trait.impl/core/marker/trait.Send.js index 2e294f85a..963d71d58 100644 --- a/trait.impl/core/marker/trait.Send.js +++ b/trait.impl/core/marker/trait.Send.js @@ -1,3 +1,3 @@ (function() {var implementors = { -"hotshot_query_service":[["impl<T> Send for ResourceId<T>",1,["hotshot_query_service::availability::data_source::ResourceId"]],["impl<Types> Send for LeafQueryData<Types>",1,["hotshot_query_service::availability::query_data::LeafQueryData"]],["impl<Types> Send for InconsistentLeafError<Types>",1,["hotshot_query_service::availability::query_data::InconsistentLeafError"]],["impl<Types> Send for BlockQueryData<Types>",1,["hotshot_query_service::availability::query_data::BlockQueryData"]],["impl<Types> Send for TransactionQueryData<Types>where\n <<Types as NodeType>::BlockPayload as QueryablePayload>::InclusionProof: Send,",1,["hotshot_query_service::availability::query_data::TransactionQueryData"]],["impl Send for Options",1,["hotshot_query_service::availability::Options"]],["impl Send for Error",1,["hotshot_query_service::availability::Error"]],["impl Send for RequestSnafu",1,["hotshot_query_service::availability::RequestSnafu"]],["impl<__T0> Send for QueryLeafSnafu<__T0>where\n __T0: Send,",1,["hotshot_query_service::availability::QueryLeafSnafu"]],["impl Send for StreamLeafSnafu",1,["hotshot_query_service::availability::StreamLeafSnafu"]],["impl<__T0> Send for QueryBlockSnafu<__T0>where\n __T0: Send,",1,["hotshot_query_service::availability::QueryBlockSnafu"]],["impl Send for StreamBlockSnafu",1,["hotshot_query_service::availability::StreamBlockSnafu"]],["impl<__T0> Send for QueryTransactionSnafu<__T0>where\n __T0: Send,",1,["hotshot_query_service::availability::QueryTransactionSnafu"]],["impl<__T0> Send for QueryProposalsSnafu<__T0>where\n __T0: Send,",1,["hotshot_query_service::availability::QueryProposalsSnafu"]],["impl<__T0, __T1> Send for InvalidTransactionIndexSnafu<__T0, __T1>where\n __T0: Send,\n __T1: Send,",1,["hotshot_query_service::availability::InvalidTransactionIndexSnafu"]],["impl<__T0, __T1> Send for LeafStreamSnafu<__T0, __T1>where\n __T0: Send,\n __T1: Send,",1,["hotshot_query_service::availability::LeafStreamSnafu"]],["impl<__T0, __T1> Send for BlockStreamSnafu<__T0, __T1>where\n __T0: Send,\n __T1: Send,",1,["hotshot_query_service::availability::BlockStreamSnafu"]],["impl Send for InvalidSignatureKeySnafu",1,["hotshot_query_service::availability::InvalidSignatureKeySnafu"]],["impl<__T0, __T1> Send for CustomSnafu<__T0, __T1>where\n __T0: Send,\n __T1: Send,",1,["hotshot_query_service::availability::CustomSnafu"]],["impl<D, U> Send for ExtensibleDataSource<D, U>where\n D: Send,\n U: Send,",1,["hotshot_query_service::data_source::extension::ExtensibleDataSource"]],["impl<Types> Send for FileSystemDataSource<Types>",1,["hotshot_query_service::data_source::fs::FileSystemDataSource"]],["impl Send for MetricsDataSource",1,["hotshot_query_service::data_source::metrics::MetricsDataSource"]],["impl Send for Config",1,["hotshot_query_service::data_source::sql::Config"]],["impl<Types> Send for SqlDataSource<Types>",1,["hotshot_query_service::data_source::sql::SqlDataSource"]],["impl<'a> Send for Transaction<'a>",1,["hotshot_query_service::data_source::sql::Transaction"]],["impl Send for Error",1,["hotshot_query_service::error::Error"]],["impl Send for MetricsError",1,["hotshot_query_service::metrics::MetricsError"]],["impl Send for PrometheusMetrics",1,["hotshot_query_service::metrics::PrometheusMetrics"]],["impl Send for Counter",1,["hotshot_query_service::metrics::Counter"]],["impl Send for Gauge",1,["hotshot_query_service::metrics::Gauge"]],["impl Send for Histogram",1,["hotshot_query_service::metrics::Histogram"]],["impl Send for Label",1,["hotshot_query_service::metrics::Label"]],["impl Send for MempoolQueryData",1,["hotshot_query_service::status::query_data::MempoolQueryData"]],["impl Send for Options",1,["hotshot_query_service::status::Options"]],["impl Send for Error",1,["hotshot_query_service::status::Error"]],["impl Send for QueryError",1,["hotshot_query_service::QueryError"]],["impl Send for NotFoundSnafu",1,["hotshot_query_service::NotFoundSnafu"]],["impl Send for MissingSnafu",1,["hotshot_query_service::MissingSnafu"]],["impl<__T0> Send for Snafu<__T0>where\n __T0: Send,",1,["hotshot_query_service::Snafu"]],["impl Send for Options",1,["hotshot_query_service::Options"]]] +"hotshot_query_service":[["impl<T> Send for ResourceId<T>",1,["hotshot_query_service::availability::data_source::ResourceId"]],["impl<T> Send for Fetch<T>where\n T: Send,",1,["hotshot_query_service::availability::fetch::Fetch"]],["impl<Types> Send for LeafQueryData<Types>",1,["hotshot_query_service::availability::query_data::LeafQueryData"]],["impl<Types> Send for InconsistentLeafError<Types>",1,["hotshot_query_service::availability::query_data::InconsistentLeafError"]],["impl<Types> Send for BlockQueryData<Types>",1,["hotshot_query_service::availability::query_data::BlockQueryData"]],["impl<Types> Send for TransactionQueryData<Types>where\n <<Types as NodeType>::BlockPayload as QueryablePayload>::InclusionProof: Send,",1,["hotshot_query_service::availability::query_data::TransactionQueryData"]],["impl Send for Options",1,["hotshot_query_service::availability::Options"]],["impl Send for Error",1,["hotshot_query_service::availability::Error"]],["impl Send for RequestSnafu",1,["hotshot_query_service::availability::RequestSnafu"]],["impl<__T0> Send for FetchLeafSnafu<__T0>where\n __T0: Send,",1,["hotshot_query_service::availability::FetchLeafSnafu"]],["impl<__T0> Send for FetchBlockSnafu<__T0>where\n __T0: Send,",1,["hotshot_query_service::availability::FetchBlockSnafu"]],["impl<__T0> Send for FetchTransactionSnafu<__T0>where\n __T0: Send,",1,["hotshot_query_service::availability::FetchTransactionSnafu"]],["impl<__T0, __T1> Send for InvalidTransactionIndexSnafu<__T0, __T1>where\n __T0: Send,\n __T1: Send,",1,["hotshot_query_service::availability::InvalidTransactionIndexSnafu"]],["impl<__T0, __T1> Send for CustomSnafu<__T0, __T1>where\n __T0: Send,\n __T1: Send,",1,["hotshot_query_service::availability::CustomSnafu"]],["impl<D, U> Send for ExtensibleDataSource<D, U>where\n D: Send,\n U: Send,",1,["hotshot_query_service::data_source::extension::ExtensibleDataSource"]],["impl<Types, S, P> Send for FetchingDataSource<Types, S, P>where\n P: Send + Sync,\n S: Send + Sync,",1,["hotshot_query_service::data_source::fetching::FetchingDataSource"]],["impl Send for MetricsDataSource",1,["hotshot_query_service::data_source::metrics::MetricsDataSource"]],["impl<Types> Send for FileSystemStorage<Types>",1,["hotshot_query_service::data_source::storage::fs::FileSystemStorage"]],["impl Send for Config",1,["hotshot_query_service::data_source::storage::sql::Config"]],["impl Send for SqlStorage",1,["hotshot_query_service::data_source::storage::sql::SqlStorage"]],["impl<'a> Send for Transaction<'a>",1,["hotshot_query_service::data_source::storage::sql::Transaction"]],["impl Send for Error",1,["hotshot_query_service::error::Error"]],["impl Send for MetricsError",1,["hotshot_query_service::metrics::MetricsError"]],["impl Send for PrometheusMetrics",1,["hotshot_query_service::metrics::PrometheusMetrics"]],["impl Send for Counter",1,["hotshot_query_service::metrics::Counter"]],["impl Send for Gauge",1,["hotshot_query_service::metrics::Gauge"]],["impl Send for Histogram",1,["hotshot_query_service::metrics::Histogram"]],["impl Send for Label",1,["hotshot_query_service::metrics::Label"]],["impl Send for Options",1,["hotshot_query_service::node::Options"]],["impl Send for Error",1,["hotshot_query_service::node::Error"]],["impl Send for RequestSnafu",1,["hotshot_query_service::node::RequestSnafu"]],["impl Send for QuerySnafu",1,["hotshot_query_service::node::QuerySnafu"]],["impl<__T0> Send for QueryProposalsSnafu<__T0>where\n __T0: Send,",1,["hotshot_query_service::node::QueryProposalsSnafu"]],["impl Send for InvalidSignatureKeySnafu",1,["hotshot_query_service::node::InvalidSignatureKeySnafu"]],["impl<__T0, __T1> Send for CustomSnafu<__T0, __T1>where\n __T0: Send,\n __T1: Send,",1,["hotshot_query_service::node::CustomSnafu"]],["impl Send for MempoolQueryData",1,["hotshot_query_service::status::query_data::MempoolQueryData"]],["impl Send for Options",1,["hotshot_query_service::status::Options"]],["impl Send for Error",1,["hotshot_query_service::status::Error"]],["impl Send for QueryError",1,["hotshot_query_service::QueryError"]],["impl Send for NotFoundSnafu",1,["hotshot_query_service::NotFoundSnafu"]],["impl Send for MissingSnafu",1,["hotshot_query_service::MissingSnafu"]],["impl<__T0> Send for Snafu<__T0>where\n __T0: Send,",1,["hotshot_query_service::Snafu"]],["impl Send for Options",1,["hotshot_query_service::Options"]]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/marker/trait.StructuralEq.js b/trait.impl/core/marker/trait.StructuralEq.js index 4c431ed39..dad34455d 100644 --- a/trait.impl/core/marker/trait.StructuralEq.js +++ b/trait.impl/core/marker/trait.StructuralEq.js @@ -1,3 +1,3 @@ (function() {var implementors = { -"hotshot_query_service":[["impl<Types: NodeType> StructuralEq for TransactionQueryData<Types>where\n Payload<Types>: QueryablePayload,"],["impl<Types: NodeType> StructuralEq for BlockQueryData<Types>"],["impl StructuralEq for MempoolQueryData"],["impl<Types: NodeType> StructuralEq for LeafQueryData<Types>"]] +"hotshot_query_service":[["impl<Types: NodeType> StructuralEq for TransactionQueryData<Types>where\n Payload<Types>: QueryablePayload,"],["impl StructuralEq for MempoolQueryData"],["impl<Types: NodeType> StructuralEq for LeafQueryData<Types>"],["impl<Types: NodeType> StructuralEq for BlockQueryData<Types>"]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/marker/trait.StructuralPartialEq.js b/trait.impl/core/marker/trait.StructuralPartialEq.js index 255aabf8d..47fb8c925 100644 --- a/trait.impl/core/marker/trait.StructuralPartialEq.js +++ b/trait.impl/core/marker/trait.StructuralPartialEq.js @@ -1,3 +1,3 @@ (function() {var implementors = { -"hotshot_query_service":[["impl<Types: NodeType> StructuralPartialEq for TransactionQueryData<Types>where\n Payload<Types>: QueryablePayload,"],["impl<Types: NodeType> StructuralPartialEq for BlockQueryData<Types>"],["impl<Types: NodeType> StructuralPartialEq for LeafQueryData<Types>"],["impl StructuralPartialEq for MempoolQueryData"]] +"hotshot_query_service":[["impl<Types: NodeType> StructuralPartialEq for LeafQueryData<Types>"],["impl StructuralPartialEq for MempoolQueryData"],["impl<Types: NodeType> StructuralPartialEq for BlockQueryData<Types>"],["impl<Types: NodeType> StructuralPartialEq for TransactionQueryData<Types>where\n Payload<Types>: QueryablePayload,"]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/marker/trait.Sync.js b/trait.impl/core/marker/trait.Sync.js index cda459b8c..dccb7ad74 100644 --- a/trait.impl/core/marker/trait.Sync.js +++ b/trait.impl/core/marker/trait.Sync.js @@ -1,3 +1,3 @@ (function() {var implementors = { -"hotshot_query_service":[["impl<T> Sync for ResourceId<T>",1,["hotshot_query_service::availability::data_source::ResourceId"]],["impl<Types> Sync for LeafQueryData<Types>",1,["hotshot_query_service::availability::query_data::LeafQueryData"]],["impl<Types> Sync for InconsistentLeafError<Types>",1,["hotshot_query_service::availability::query_data::InconsistentLeafError"]],["impl<Types> Sync for BlockQueryData<Types>",1,["hotshot_query_service::availability::query_data::BlockQueryData"]],["impl<Types> Sync for TransactionQueryData<Types>where\n <<Types as NodeType>::BlockPayload as QueryablePayload>::InclusionProof: Sync,",1,["hotshot_query_service::availability::query_data::TransactionQueryData"]],["impl Sync for Options",1,["hotshot_query_service::availability::Options"]],["impl Sync for Error",1,["hotshot_query_service::availability::Error"]],["impl Sync for RequestSnafu",1,["hotshot_query_service::availability::RequestSnafu"]],["impl<__T0> Sync for QueryLeafSnafu<__T0>where\n __T0: Sync,",1,["hotshot_query_service::availability::QueryLeafSnafu"]],["impl Sync for StreamLeafSnafu",1,["hotshot_query_service::availability::StreamLeafSnafu"]],["impl<__T0> Sync for QueryBlockSnafu<__T0>where\n __T0: Sync,",1,["hotshot_query_service::availability::QueryBlockSnafu"]],["impl Sync for StreamBlockSnafu",1,["hotshot_query_service::availability::StreamBlockSnafu"]],["impl<__T0> Sync for QueryTransactionSnafu<__T0>where\n __T0: Sync,",1,["hotshot_query_service::availability::QueryTransactionSnafu"]],["impl<__T0> Sync for QueryProposalsSnafu<__T0>where\n __T0: Sync,",1,["hotshot_query_service::availability::QueryProposalsSnafu"]],["impl<__T0, __T1> Sync for InvalidTransactionIndexSnafu<__T0, __T1>where\n __T0: Sync,\n __T1: Sync,",1,["hotshot_query_service::availability::InvalidTransactionIndexSnafu"]],["impl<__T0, __T1> Sync for LeafStreamSnafu<__T0, __T1>where\n __T0: Sync,\n __T1: Sync,",1,["hotshot_query_service::availability::LeafStreamSnafu"]],["impl<__T0, __T1> Sync for BlockStreamSnafu<__T0, __T1>where\n __T0: Sync,\n __T1: Sync,",1,["hotshot_query_service::availability::BlockStreamSnafu"]],["impl Sync for InvalidSignatureKeySnafu",1,["hotshot_query_service::availability::InvalidSignatureKeySnafu"]],["impl<__T0, __T1> Sync for CustomSnafu<__T0, __T1>where\n __T0: Sync,\n __T1: Sync,",1,["hotshot_query_service::availability::CustomSnafu"]],["impl<D, U> Sync for ExtensibleDataSource<D, U>where\n D: Sync,\n U: Sync,",1,["hotshot_query_service::data_source::extension::ExtensibleDataSource"]],["impl<Types> Sync for FileSystemDataSource<Types>",1,["hotshot_query_service::data_source::fs::FileSystemDataSource"]],["impl Sync for MetricsDataSource",1,["hotshot_query_service::data_source::metrics::MetricsDataSource"]],["impl Sync for Config",1,["hotshot_query_service::data_source::sql::Config"]],["impl<Types> Sync for SqlDataSource<Types>",1,["hotshot_query_service::data_source::sql::SqlDataSource"]],["impl<'a> Sync for Transaction<'a>",1,["hotshot_query_service::data_source::sql::Transaction"]],["impl Sync for Error",1,["hotshot_query_service::error::Error"]],["impl Sync for MetricsError",1,["hotshot_query_service::metrics::MetricsError"]],["impl Sync for PrometheusMetrics",1,["hotshot_query_service::metrics::PrometheusMetrics"]],["impl Sync for Counter",1,["hotshot_query_service::metrics::Counter"]],["impl Sync for Gauge",1,["hotshot_query_service::metrics::Gauge"]],["impl Sync for Histogram",1,["hotshot_query_service::metrics::Histogram"]],["impl Sync for Label",1,["hotshot_query_service::metrics::Label"]],["impl Sync for MempoolQueryData",1,["hotshot_query_service::status::query_data::MempoolQueryData"]],["impl Sync for Options",1,["hotshot_query_service::status::Options"]],["impl Sync for Error",1,["hotshot_query_service::status::Error"]],["impl Sync for QueryError",1,["hotshot_query_service::QueryError"]],["impl Sync for NotFoundSnafu",1,["hotshot_query_service::NotFoundSnafu"]],["impl Sync for MissingSnafu",1,["hotshot_query_service::MissingSnafu"]],["impl<__T0> Sync for Snafu<__T0>where\n __T0: Sync,",1,["hotshot_query_service::Snafu"]],["impl Sync for Options",1,["hotshot_query_service::Options"]]] +"hotshot_query_service":[["impl<T> Sync for ResourceId<T>",1,["hotshot_query_service::availability::data_source::ResourceId"]],["impl<T> !Sync for Fetch<T>",1,["hotshot_query_service::availability::fetch::Fetch"]],["impl<Types> Sync for LeafQueryData<Types>",1,["hotshot_query_service::availability::query_data::LeafQueryData"]],["impl<Types> Sync for InconsistentLeafError<Types>",1,["hotshot_query_service::availability::query_data::InconsistentLeafError"]],["impl<Types> Sync for BlockQueryData<Types>",1,["hotshot_query_service::availability::query_data::BlockQueryData"]],["impl<Types> Sync for TransactionQueryData<Types>where\n <<Types as NodeType>::BlockPayload as QueryablePayload>::InclusionProof: Sync,",1,["hotshot_query_service::availability::query_data::TransactionQueryData"]],["impl Sync for Options",1,["hotshot_query_service::availability::Options"]],["impl Sync for Error",1,["hotshot_query_service::availability::Error"]],["impl Sync for RequestSnafu",1,["hotshot_query_service::availability::RequestSnafu"]],["impl<__T0> Sync for FetchLeafSnafu<__T0>where\n __T0: Sync,",1,["hotshot_query_service::availability::FetchLeafSnafu"]],["impl<__T0> Sync for FetchBlockSnafu<__T0>where\n __T0: Sync,",1,["hotshot_query_service::availability::FetchBlockSnafu"]],["impl<__T0> Sync for FetchTransactionSnafu<__T0>where\n __T0: Sync,",1,["hotshot_query_service::availability::FetchTransactionSnafu"]],["impl<__T0, __T1> Sync for InvalidTransactionIndexSnafu<__T0, __T1>where\n __T0: Sync,\n __T1: Sync,",1,["hotshot_query_service::availability::InvalidTransactionIndexSnafu"]],["impl<__T0, __T1> Sync for CustomSnafu<__T0, __T1>where\n __T0: Sync,\n __T1: Sync,",1,["hotshot_query_service::availability::CustomSnafu"]],["impl<D, U> Sync for ExtensibleDataSource<D, U>where\n D: Sync,\n U: Sync,",1,["hotshot_query_service::data_source::extension::ExtensibleDataSource"]],["impl<Types, S, P> Sync for FetchingDataSource<Types, S, P>where\n P: Send + Sync,\n S: Send + Sync,",1,["hotshot_query_service::data_source::fetching::FetchingDataSource"]],["impl Sync for MetricsDataSource",1,["hotshot_query_service::data_source::metrics::MetricsDataSource"]],["impl<Types> Sync for FileSystemStorage<Types>",1,["hotshot_query_service::data_source::storage::fs::FileSystemStorage"]],["impl Sync for Config",1,["hotshot_query_service::data_source::storage::sql::Config"]],["impl Sync for SqlStorage",1,["hotshot_query_service::data_source::storage::sql::SqlStorage"]],["impl<'a> Sync for Transaction<'a>",1,["hotshot_query_service::data_source::storage::sql::Transaction"]],["impl Sync for Error",1,["hotshot_query_service::error::Error"]],["impl Sync for MetricsError",1,["hotshot_query_service::metrics::MetricsError"]],["impl Sync for PrometheusMetrics",1,["hotshot_query_service::metrics::PrometheusMetrics"]],["impl Sync for Counter",1,["hotshot_query_service::metrics::Counter"]],["impl Sync for Gauge",1,["hotshot_query_service::metrics::Gauge"]],["impl Sync for Histogram",1,["hotshot_query_service::metrics::Histogram"]],["impl Sync for Label",1,["hotshot_query_service::metrics::Label"]],["impl Sync for Options",1,["hotshot_query_service::node::Options"]],["impl Sync for Error",1,["hotshot_query_service::node::Error"]],["impl Sync for RequestSnafu",1,["hotshot_query_service::node::RequestSnafu"]],["impl Sync for QuerySnafu",1,["hotshot_query_service::node::QuerySnafu"]],["impl<__T0> Sync for QueryProposalsSnafu<__T0>where\n __T0: Sync,",1,["hotshot_query_service::node::QueryProposalsSnafu"]],["impl Sync for InvalidSignatureKeySnafu",1,["hotshot_query_service::node::InvalidSignatureKeySnafu"]],["impl<__T0, __T1> Sync for CustomSnafu<__T0, __T1>where\n __T0: Sync,\n __T1: Sync,",1,["hotshot_query_service::node::CustomSnafu"]],["impl Sync for MempoolQueryData",1,["hotshot_query_service::status::query_data::MempoolQueryData"]],["impl Sync for Options",1,["hotshot_query_service::status::Options"]],["impl Sync for Error",1,["hotshot_query_service::status::Error"]],["impl Sync for QueryError",1,["hotshot_query_service::QueryError"]],["impl Sync for NotFoundSnafu",1,["hotshot_query_service::NotFoundSnafu"]],["impl Sync for MissingSnafu",1,["hotshot_query_service::MissingSnafu"]],["impl<__T0> Sync for Snafu<__T0>where\n __T0: Sync,",1,["hotshot_query_service::Snafu"]],["impl Sync for Options",1,["hotshot_query_service::Options"]]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/marker/trait.Unpin.js b/trait.impl/core/marker/trait.Unpin.js index a91d399f5..e9bb8edac 100644 --- a/trait.impl/core/marker/trait.Unpin.js +++ b/trait.impl/core/marker/trait.Unpin.js @@ -1,3 +1,3 @@ (function() {var implementors = { -"hotshot_query_service":[["impl<T> Unpin for ResourceId<T>",1,["hotshot_query_service::availability::data_source::ResourceId"]],["impl<Types> Unpin for LeafQueryData<Types>where\n Types: Unpin,\n <Types as NodeType>::BlockHeader: Unpin,\n <Types as NodeType>::BlockPayload: Unpin,\n <<Types as NodeType>::SignatureKey as SignatureKey>::QCType: Unpin,\n <Types as NodeType>::SignatureKey: Unpin,\n <Types as NodeType>::Time: Unpin,\n <Types as NodeType>::Transaction: Unpin,",1,["hotshot_query_service::availability::query_data::LeafQueryData"]],["impl<Types> Unpin for InconsistentLeafError<Types>",1,["hotshot_query_service::availability::query_data::InconsistentLeafError"]],["impl<Types> Unpin for BlockQueryData<Types>where\n <Types as NodeType>::BlockHeader: Unpin,\n <Types as NodeType>::BlockPayload: Unpin,",1,["hotshot_query_service::availability::query_data::BlockQueryData"]],["impl<Types> Unpin for TransactionQueryData<Types>where\n <<Types as NodeType>::BlockPayload as QueryablePayload>::InclusionProof: Unpin,\n <Types as NodeType>::Transaction: Unpin,",1,["hotshot_query_service::availability::query_data::TransactionQueryData"]],["impl Unpin for Options",1,["hotshot_query_service::availability::Options"]],["impl Unpin for Error",1,["hotshot_query_service::availability::Error"]],["impl Unpin for RequestSnafu",1,["hotshot_query_service::availability::RequestSnafu"]],["impl<__T0> Unpin for QueryLeafSnafu<__T0>where\n __T0: Unpin,",1,["hotshot_query_service::availability::QueryLeafSnafu"]],["impl Unpin for StreamLeafSnafu",1,["hotshot_query_service::availability::StreamLeafSnafu"]],["impl<__T0> Unpin for QueryBlockSnafu<__T0>where\n __T0: Unpin,",1,["hotshot_query_service::availability::QueryBlockSnafu"]],["impl Unpin for StreamBlockSnafu",1,["hotshot_query_service::availability::StreamBlockSnafu"]],["impl<__T0> Unpin for QueryTransactionSnafu<__T0>where\n __T0: Unpin,",1,["hotshot_query_service::availability::QueryTransactionSnafu"]],["impl<__T0> Unpin for QueryProposalsSnafu<__T0>where\n __T0: Unpin,",1,["hotshot_query_service::availability::QueryProposalsSnafu"]],["impl<__T0, __T1> Unpin for InvalidTransactionIndexSnafu<__T0, __T1>where\n __T0: Unpin,\n __T1: Unpin,",1,["hotshot_query_service::availability::InvalidTransactionIndexSnafu"]],["impl<__T0, __T1> Unpin for LeafStreamSnafu<__T0, __T1>where\n __T0: Unpin,\n __T1: Unpin,",1,["hotshot_query_service::availability::LeafStreamSnafu"]],["impl<__T0, __T1> Unpin for BlockStreamSnafu<__T0, __T1>where\n __T0: Unpin,\n __T1: Unpin,",1,["hotshot_query_service::availability::BlockStreamSnafu"]],["impl Unpin for InvalidSignatureKeySnafu",1,["hotshot_query_service::availability::InvalidSignatureKeySnafu"]],["impl<__T0, __T1> Unpin for CustomSnafu<__T0, __T1>where\n __T0: Unpin,\n __T1: Unpin,",1,["hotshot_query_service::availability::CustomSnafu"]],["impl<D, U> Unpin for ExtensibleDataSource<D, U>where\n D: Unpin,\n U: Unpin,",1,["hotshot_query_service::data_source::extension::ExtensibleDataSource"]],["impl<Types> Unpin for FileSystemDataSource<Types>where\n Types: Unpin,\n <Types as NodeType>::BlockHeader: Unpin,\n <Types as NodeType>::BlockPayload: Unpin,\n <<Types as NodeType>::SignatureKey as SignatureKey>::QCType: Unpin,\n <Types as NodeType>::SignatureKey: Unpin,\n <Types as NodeType>::Time: Unpin,\n <Types as NodeType>::Transaction: Unpin,\n <<Types as NodeType>::BlockPayload as QueryablePayload>::TransactionIndex: Unpin,",1,["hotshot_query_service::data_source::fs::FileSystemDataSource"]],["impl Unpin for MetricsDataSource",1,["hotshot_query_service::data_source::metrics::MetricsDataSource"]],["impl Unpin for Config",1,["hotshot_query_service::data_source::sql::Config"]],["impl<Types> Unpin for SqlDataSource<Types>where\n Types: Unpin,\n <Types as NodeType>::BlockHeader: Unpin,\n <Types as NodeType>::BlockPayload: Unpin,\n <<Types as NodeType>::SignatureKey as SignatureKey>::QCType: Unpin,\n <Types as NodeType>::SignatureKey: Unpin,\n <Types as NodeType>::Time: Unpin,\n <Types as NodeType>::Transaction: Unpin,",1,["hotshot_query_service::data_source::sql::SqlDataSource"]],["impl<'a> Unpin for Transaction<'a>",1,["hotshot_query_service::data_source::sql::Transaction"]],["impl Unpin for Error",1,["hotshot_query_service::error::Error"]],["impl Unpin for MetricsError",1,["hotshot_query_service::metrics::MetricsError"]],["impl Unpin for PrometheusMetrics",1,["hotshot_query_service::metrics::PrometheusMetrics"]],["impl Unpin for Counter",1,["hotshot_query_service::metrics::Counter"]],["impl Unpin for Gauge",1,["hotshot_query_service::metrics::Gauge"]],["impl Unpin for Histogram",1,["hotshot_query_service::metrics::Histogram"]],["impl Unpin for Label",1,["hotshot_query_service::metrics::Label"]],["impl Unpin for MempoolQueryData",1,["hotshot_query_service::status::query_data::MempoolQueryData"]],["impl Unpin for Options",1,["hotshot_query_service::status::Options"]],["impl Unpin for Error",1,["hotshot_query_service::status::Error"]],["impl Unpin for QueryError",1,["hotshot_query_service::QueryError"]],["impl Unpin for NotFoundSnafu",1,["hotshot_query_service::NotFoundSnafu"]],["impl Unpin for MissingSnafu",1,["hotshot_query_service::MissingSnafu"]],["impl<__T0> Unpin for Snafu<__T0>where\n __T0: Unpin,",1,["hotshot_query_service::Snafu"]],["impl Unpin for Options",1,["hotshot_query_service::Options"]]] +"hotshot_query_service":[["impl<T> Unpin for ResourceId<T>",1,["hotshot_query_service::availability::data_source::ResourceId"]],["impl<T> Unpin for Fetch<T>where\n T: Unpin,",1,["hotshot_query_service::availability::fetch::Fetch"]],["impl<Types> Unpin for LeafQueryData<Types>where\n Types: Unpin,\n <Types as NodeType>::BlockHeader: Unpin,\n <Types as NodeType>::BlockPayload: Unpin,\n <<Types as NodeType>::SignatureKey as SignatureKey>::QCType: Unpin,\n <Types as NodeType>::SignatureKey: Unpin,\n <Types as NodeType>::Time: Unpin,\n <Types as NodeType>::Transaction: Unpin,",1,["hotshot_query_service::availability::query_data::LeafQueryData"]],["impl<Types> Unpin for InconsistentLeafError<Types>",1,["hotshot_query_service::availability::query_data::InconsistentLeafError"]],["impl<Types> Unpin for BlockQueryData<Types>where\n <Types as NodeType>::BlockHeader: Unpin,\n <Types as NodeType>::BlockPayload: Unpin,",1,["hotshot_query_service::availability::query_data::BlockQueryData"]],["impl<Types> Unpin for TransactionQueryData<Types>where\n <<Types as NodeType>::BlockPayload as QueryablePayload>::InclusionProof: Unpin,\n <Types as NodeType>::Transaction: Unpin,",1,["hotshot_query_service::availability::query_data::TransactionQueryData"]],["impl Unpin for Options",1,["hotshot_query_service::availability::Options"]],["impl Unpin for Error",1,["hotshot_query_service::availability::Error"]],["impl Unpin for RequestSnafu",1,["hotshot_query_service::availability::RequestSnafu"]],["impl<__T0> Unpin for FetchLeafSnafu<__T0>where\n __T0: Unpin,",1,["hotshot_query_service::availability::FetchLeafSnafu"]],["impl<__T0> Unpin for FetchBlockSnafu<__T0>where\n __T0: Unpin,",1,["hotshot_query_service::availability::FetchBlockSnafu"]],["impl<__T0> Unpin for FetchTransactionSnafu<__T0>where\n __T0: Unpin,",1,["hotshot_query_service::availability::FetchTransactionSnafu"]],["impl<__T0, __T1> Unpin for InvalidTransactionIndexSnafu<__T0, __T1>where\n __T0: Unpin,\n __T1: Unpin,",1,["hotshot_query_service::availability::InvalidTransactionIndexSnafu"]],["impl<__T0, __T1> Unpin for CustomSnafu<__T0, __T1>where\n __T0: Unpin,\n __T1: Unpin,",1,["hotshot_query_service::availability::CustomSnafu"]],["impl<D, U> Unpin for ExtensibleDataSource<D, U>where\n D: Unpin,\n U: Unpin,",1,["hotshot_query_service::data_source::extension::ExtensibleDataSource"]],["impl<Types, S, P> Unpin for FetchingDataSource<Types, S, P>",1,["hotshot_query_service::data_source::fetching::FetchingDataSource"]],["impl Unpin for MetricsDataSource",1,["hotshot_query_service::data_source::metrics::MetricsDataSource"]],["impl<Types> Unpin for FileSystemStorage<Types>where\n Types: Unpin,\n <Types as NodeType>::BlockHeader: Unpin,\n <Types as NodeType>::BlockPayload: Unpin,\n <<Types as NodeType>::SignatureKey as SignatureKey>::QCType: Unpin,\n <Types as NodeType>::SignatureKey: Unpin,\n <Types as NodeType>::Time: Unpin,\n <Types as NodeType>::Transaction: Unpin,\n <<Types as NodeType>::BlockPayload as QueryablePayload>::TransactionIndex: Unpin,",1,["hotshot_query_service::data_source::storage::fs::FileSystemStorage"]],["impl Unpin for Config",1,["hotshot_query_service::data_source::storage::sql::Config"]],["impl Unpin for SqlStorage",1,["hotshot_query_service::data_source::storage::sql::SqlStorage"]],["impl<'a> Unpin for Transaction<'a>",1,["hotshot_query_service::data_source::storage::sql::Transaction"]],["impl Unpin for Error",1,["hotshot_query_service::error::Error"]],["impl Unpin for MetricsError",1,["hotshot_query_service::metrics::MetricsError"]],["impl Unpin for PrometheusMetrics",1,["hotshot_query_service::metrics::PrometheusMetrics"]],["impl Unpin for Counter",1,["hotshot_query_service::metrics::Counter"]],["impl Unpin for Gauge",1,["hotshot_query_service::metrics::Gauge"]],["impl Unpin for Histogram",1,["hotshot_query_service::metrics::Histogram"]],["impl Unpin for Label",1,["hotshot_query_service::metrics::Label"]],["impl Unpin for Options",1,["hotshot_query_service::node::Options"]],["impl Unpin for Error",1,["hotshot_query_service::node::Error"]],["impl Unpin for RequestSnafu",1,["hotshot_query_service::node::RequestSnafu"]],["impl Unpin for QuerySnafu",1,["hotshot_query_service::node::QuerySnafu"]],["impl<__T0> Unpin for QueryProposalsSnafu<__T0>where\n __T0: Unpin,",1,["hotshot_query_service::node::QueryProposalsSnafu"]],["impl Unpin for InvalidSignatureKeySnafu",1,["hotshot_query_service::node::InvalidSignatureKeySnafu"]],["impl<__T0, __T1> Unpin for CustomSnafu<__T0, __T1>where\n __T0: Unpin,\n __T1: Unpin,",1,["hotshot_query_service::node::CustomSnafu"]],["impl Unpin for MempoolQueryData",1,["hotshot_query_service::status::query_data::MempoolQueryData"]],["impl Unpin for Options",1,["hotshot_query_service::status::Options"]],["impl Unpin for Error",1,["hotshot_query_service::status::Error"]],["impl Unpin for QueryError",1,["hotshot_query_service::QueryError"]],["impl Unpin for NotFoundSnafu",1,["hotshot_query_service::NotFoundSnafu"]],["impl Unpin for MissingSnafu",1,["hotshot_query_service::MissingSnafu"]],["impl<__T0> Unpin for Snafu<__T0>where\n __T0: Unpin,",1,["hotshot_query_service::Snafu"]],["impl Unpin for Options",1,["hotshot_query_service::Options"]]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/ops/drop/trait.Drop.js b/trait.impl/core/ops/drop/trait.Drop.js index d9c1b4ade..f37a34b25 100644 --- a/trait.impl/core/ops/drop/trait.Drop.js +++ b/trait.impl/core/ops/drop/trait.Drop.js @@ -1,3 +1,3 @@ (function() {var implementors = { -"hotshot_query_service":[["impl<Types> Drop for SqlDataSource<Types>where\n Types: NodeType,"]] +"hotshot_query_service":[["impl Drop for SqlStorage"]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/panic/unwind_safe/trait.RefUnwindSafe.js b/trait.impl/core/panic/unwind_safe/trait.RefUnwindSafe.js index 71d96e993..abced0468 100644 --- a/trait.impl/core/panic/unwind_safe/trait.RefUnwindSafe.js +++ b/trait.impl/core/panic/unwind_safe/trait.RefUnwindSafe.js @@ -1,3 +1,3 @@ (function() {var implementors = { -"hotshot_query_service":[["impl<T> RefUnwindSafe for ResourceId<T>",1,["hotshot_query_service::availability::data_source::ResourceId"]],["impl<Types> RefUnwindSafe for LeafQueryData<Types>where\n Types: RefUnwindSafe,\n <Types as NodeType>::BlockHeader: RefUnwindSafe,\n <Types as NodeType>::BlockPayload: RefUnwindSafe,\n <<Types as NodeType>::SignatureKey as SignatureKey>::QCType: RefUnwindSafe,\n <Types as NodeType>::SignatureKey: RefUnwindSafe,\n <Types as NodeType>::Time: RefUnwindSafe,\n <Types as NodeType>::Transaction: RefUnwindSafe,",1,["hotshot_query_service::availability::query_data::LeafQueryData"]],["impl<Types> RefUnwindSafe for InconsistentLeafError<Types>",1,["hotshot_query_service::availability::query_data::InconsistentLeafError"]],["impl<Types> RefUnwindSafe for BlockQueryData<Types>where\n <Types as NodeType>::BlockHeader: RefUnwindSafe,\n <Types as NodeType>::BlockPayload: RefUnwindSafe,",1,["hotshot_query_service::availability::query_data::BlockQueryData"]],["impl<Types> RefUnwindSafe for TransactionQueryData<Types>where\n <<Types as NodeType>::BlockPayload as QueryablePayload>::InclusionProof: RefUnwindSafe,\n <Types as NodeType>::Transaction: RefUnwindSafe,",1,["hotshot_query_service::availability::query_data::TransactionQueryData"]],["impl RefUnwindSafe for Options",1,["hotshot_query_service::availability::Options"]],["impl RefUnwindSafe for Error",1,["hotshot_query_service::availability::Error"]],["impl RefUnwindSafe for RequestSnafu",1,["hotshot_query_service::availability::RequestSnafu"]],["impl<__T0> RefUnwindSafe for QueryLeafSnafu<__T0>where\n __T0: RefUnwindSafe,",1,["hotshot_query_service::availability::QueryLeafSnafu"]],["impl RefUnwindSafe for StreamLeafSnafu",1,["hotshot_query_service::availability::StreamLeafSnafu"]],["impl<__T0> RefUnwindSafe for QueryBlockSnafu<__T0>where\n __T0: RefUnwindSafe,",1,["hotshot_query_service::availability::QueryBlockSnafu"]],["impl RefUnwindSafe for StreamBlockSnafu",1,["hotshot_query_service::availability::StreamBlockSnafu"]],["impl<__T0> RefUnwindSafe for QueryTransactionSnafu<__T0>where\n __T0: RefUnwindSafe,",1,["hotshot_query_service::availability::QueryTransactionSnafu"]],["impl<__T0> RefUnwindSafe for QueryProposalsSnafu<__T0>where\n __T0: RefUnwindSafe,",1,["hotshot_query_service::availability::QueryProposalsSnafu"]],["impl<__T0, __T1> RefUnwindSafe for InvalidTransactionIndexSnafu<__T0, __T1>where\n __T0: RefUnwindSafe,\n __T1: RefUnwindSafe,",1,["hotshot_query_service::availability::InvalidTransactionIndexSnafu"]],["impl<__T0, __T1> RefUnwindSafe for LeafStreamSnafu<__T0, __T1>where\n __T0: RefUnwindSafe,\n __T1: RefUnwindSafe,",1,["hotshot_query_service::availability::LeafStreamSnafu"]],["impl<__T0, __T1> RefUnwindSafe for BlockStreamSnafu<__T0, __T1>where\n __T0: RefUnwindSafe,\n __T1: RefUnwindSafe,",1,["hotshot_query_service::availability::BlockStreamSnafu"]],["impl RefUnwindSafe for InvalidSignatureKeySnafu",1,["hotshot_query_service::availability::InvalidSignatureKeySnafu"]],["impl<__T0, __T1> RefUnwindSafe for CustomSnafu<__T0, __T1>where\n __T0: RefUnwindSafe,\n __T1: RefUnwindSafe,",1,["hotshot_query_service::availability::CustomSnafu"]],["impl<D, U> RefUnwindSafe for ExtensibleDataSource<D, U>where\n D: RefUnwindSafe,\n U: RefUnwindSafe,",1,["hotshot_query_service::data_source::extension::ExtensibleDataSource"]],["impl<Types> !RefUnwindSafe for FileSystemDataSource<Types>",1,["hotshot_query_service::data_source::fs::FileSystemDataSource"]],["impl !RefUnwindSafe for MetricsDataSource",1,["hotshot_query_service::data_source::metrics::MetricsDataSource"]],["impl RefUnwindSafe for Config",1,["hotshot_query_service::data_source::sql::Config"]],["impl<Types> !RefUnwindSafe for SqlDataSource<Types>",1,["hotshot_query_service::data_source::sql::SqlDataSource"]],["impl<'a> !RefUnwindSafe for Transaction<'a>",1,["hotshot_query_service::data_source::sql::Transaction"]],["impl RefUnwindSafe for Error",1,["hotshot_query_service::error::Error"]],["impl !RefUnwindSafe for MetricsError",1,["hotshot_query_service::metrics::MetricsError"]],["impl !RefUnwindSafe for PrometheusMetrics",1,["hotshot_query_service::metrics::PrometheusMetrics"]],["impl RefUnwindSafe for Counter",1,["hotshot_query_service::metrics::Counter"]],["impl RefUnwindSafe for Gauge",1,["hotshot_query_service::metrics::Gauge"]],["impl RefUnwindSafe for Histogram",1,["hotshot_query_service::metrics::Histogram"]],["impl RefUnwindSafe for Label",1,["hotshot_query_service::metrics::Label"]],["impl RefUnwindSafe for MempoolQueryData",1,["hotshot_query_service::status::query_data::MempoolQueryData"]],["impl RefUnwindSafe for Options",1,["hotshot_query_service::status::Options"]],["impl RefUnwindSafe for Error",1,["hotshot_query_service::status::Error"]],["impl RefUnwindSafe for QueryError",1,["hotshot_query_service::QueryError"]],["impl RefUnwindSafe for NotFoundSnafu",1,["hotshot_query_service::NotFoundSnafu"]],["impl RefUnwindSafe for MissingSnafu",1,["hotshot_query_service::MissingSnafu"]],["impl<__T0> RefUnwindSafe for Snafu<__T0>where\n __T0: RefUnwindSafe,",1,["hotshot_query_service::Snafu"]],["impl RefUnwindSafe for Options",1,["hotshot_query_service::Options"]]] +"hotshot_query_service":[["impl<T> RefUnwindSafe for ResourceId<T>",1,["hotshot_query_service::availability::data_source::ResourceId"]],["impl<T> !RefUnwindSafe for Fetch<T>",1,["hotshot_query_service::availability::fetch::Fetch"]],["impl<Types> RefUnwindSafe for LeafQueryData<Types>where\n Types: RefUnwindSafe,\n <Types as NodeType>::BlockHeader: RefUnwindSafe,\n <Types as NodeType>::BlockPayload: RefUnwindSafe,\n <<Types as NodeType>::SignatureKey as SignatureKey>::QCType: RefUnwindSafe,\n <Types as NodeType>::SignatureKey: RefUnwindSafe,\n <Types as NodeType>::Time: RefUnwindSafe,\n <Types as NodeType>::Transaction: RefUnwindSafe,",1,["hotshot_query_service::availability::query_data::LeafQueryData"]],["impl<Types> RefUnwindSafe for InconsistentLeafError<Types>",1,["hotshot_query_service::availability::query_data::InconsistentLeafError"]],["impl<Types> RefUnwindSafe for BlockQueryData<Types>where\n <Types as NodeType>::BlockHeader: RefUnwindSafe,\n <Types as NodeType>::BlockPayload: RefUnwindSafe,",1,["hotshot_query_service::availability::query_data::BlockQueryData"]],["impl<Types> RefUnwindSafe for TransactionQueryData<Types>where\n <<Types as NodeType>::BlockPayload as QueryablePayload>::InclusionProof: RefUnwindSafe,\n <Types as NodeType>::Transaction: RefUnwindSafe,",1,["hotshot_query_service::availability::query_data::TransactionQueryData"]],["impl RefUnwindSafe for Options",1,["hotshot_query_service::availability::Options"]],["impl RefUnwindSafe for Error",1,["hotshot_query_service::availability::Error"]],["impl RefUnwindSafe for RequestSnafu",1,["hotshot_query_service::availability::RequestSnafu"]],["impl<__T0> RefUnwindSafe for FetchLeafSnafu<__T0>where\n __T0: RefUnwindSafe,",1,["hotshot_query_service::availability::FetchLeafSnafu"]],["impl<__T0> RefUnwindSafe for FetchBlockSnafu<__T0>where\n __T0: RefUnwindSafe,",1,["hotshot_query_service::availability::FetchBlockSnafu"]],["impl<__T0> RefUnwindSafe for FetchTransactionSnafu<__T0>where\n __T0: RefUnwindSafe,",1,["hotshot_query_service::availability::FetchTransactionSnafu"]],["impl<__T0, __T1> RefUnwindSafe for InvalidTransactionIndexSnafu<__T0, __T1>where\n __T0: RefUnwindSafe,\n __T1: RefUnwindSafe,",1,["hotshot_query_service::availability::InvalidTransactionIndexSnafu"]],["impl<__T0, __T1> RefUnwindSafe for CustomSnafu<__T0, __T1>where\n __T0: RefUnwindSafe,\n __T1: RefUnwindSafe,",1,["hotshot_query_service::availability::CustomSnafu"]],["impl<D, U> RefUnwindSafe for ExtensibleDataSource<D, U>where\n D: RefUnwindSafe,\n U: RefUnwindSafe,",1,["hotshot_query_service::data_source::extension::ExtensibleDataSource"]],["impl<Types, S, P> !RefUnwindSafe for FetchingDataSource<Types, S, P>",1,["hotshot_query_service::data_source::fetching::FetchingDataSource"]],["impl !RefUnwindSafe for MetricsDataSource",1,["hotshot_query_service::data_source::metrics::MetricsDataSource"]],["impl<Types> RefUnwindSafe for FileSystemStorage<Types>where\n Types: RefUnwindSafe,\n <Types as NodeType>::BlockHeader: RefUnwindSafe,\n <Types as NodeType>::BlockPayload: RefUnwindSafe,\n <<Types as NodeType>::SignatureKey as SignatureKey>::QCType: RefUnwindSafe,\n <Types as NodeType>::SignatureKey: RefUnwindSafe,\n <Types as NodeType>::Time: RefUnwindSafe,\n <Types as NodeType>::Transaction: RefUnwindSafe,\n <<Types as NodeType>::BlockPayload as QueryablePayload>::TransactionIndex: RefUnwindSafe,",1,["hotshot_query_service::data_source::storage::fs::FileSystemStorage"]],["impl RefUnwindSafe for Config",1,["hotshot_query_service::data_source::storage::sql::Config"]],["impl !RefUnwindSafe for SqlStorage",1,["hotshot_query_service::data_source::storage::sql::SqlStorage"]],["impl<'a> !RefUnwindSafe for Transaction<'a>",1,["hotshot_query_service::data_source::storage::sql::Transaction"]],["impl RefUnwindSafe for Error",1,["hotshot_query_service::error::Error"]],["impl !RefUnwindSafe for MetricsError",1,["hotshot_query_service::metrics::MetricsError"]],["impl !RefUnwindSafe for PrometheusMetrics",1,["hotshot_query_service::metrics::PrometheusMetrics"]],["impl RefUnwindSafe for Counter",1,["hotshot_query_service::metrics::Counter"]],["impl RefUnwindSafe for Gauge",1,["hotshot_query_service::metrics::Gauge"]],["impl RefUnwindSafe for Histogram",1,["hotshot_query_service::metrics::Histogram"]],["impl RefUnwindSafe for Label",1,["hotshot_query_service::metrics::Label"]],["impl RefUnwindSafe for Options",1,["hotshot_query_service::node::Options"]],["impl RefUnwindSafe for Error",1,["hotshot_query_service::node::Error"]],["impl RefUnwindSafe for RequestSnafu",1,["hotshot_query_service::node::RequestSnafu"]],["impl RefUnwindSafe for QuerySnafu",1,["hotshot_query_service::node::QuerySnafu"]],["impl<__T0> RefUnwindSafe for QueryProposalsSnafu<__T0>where\n __T0: RefUnwindSafe,",1,["hotshot_query_service::node::QueryProposalsSnafu"]],["impl RefUnwindSafe for InvalidSignatureKeySnafu",1,["hotshot_query_service::node::InvalidSignatureKeySnafu"]],["impl<__T0, __T1> RefUnwindSafe for CustomSnafu<__T0, __T1>where\n __T0: RefUnwindSafe,\n __T1: RefUnwindSafe,",1,["hotshot_query_service::node::CustomSnafu"]],["impl RefUnwindSafe for MempoolQueryData",1,["hotshot_query_service::status::query_data::MempoolQueryData"]],["impl RefUnwindSafe for Options",1,["hotshot_query_service::status::Options"]],["impl RefUnwindSafe for Error",1,["hotshot_query_service::status::Error"]],["impl RefUnwindSafe for QueryError",1,["hotshot_query_service::QueryError"]],["impl RefUnwindSafe for NotFoundSnafu",1,["hotshot_query_service::NotFoundSnafu"]],["impl RefUnwindSafe for MissingSnafu",1,["hotshot_query_service::MissingSnafu"]],["impl<__T0> RefUnwindSafe for Snafu<__T0>where\n __T0: RefUnwindSafe,",1,["hotshot_query_service::Snafu"]],["impl RefUnwindSafe for Options",1,["hotshot_query_service::Options"]]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/panic/unwind_safe/trait.UnwindSafe.js b/trait.impl/core/panic/unwind_safe/trait.UnwindSafe.js index 1a67a8286..521476b74 100644 --- a/trait.impl/core/panic/unwind_safe/trait.UnwindSafe.js +++ b/trait.impl/core/panic/unwind_safe/trait.UnwindSafe.js @@ -1,3 +1,3 @@ (function() {var implementors = { -"hotshot_query_service":[["impl<T> UnwindSafe for ResourceId<T>",1,["hotshot_query_service::availability::data_source::ResourceId"]],["impl<Types> UnwindSafe for LeafQueryData<Types>where\n Types: UnwindSafe,\n <Types as NodeType>::BlockHeader: UnwindSafe,\n <Types as NodeType>::BlockPayload: UnwindSafe,\n <<Types as NodeType>::SignatureKey as SignatureKey>::QCType: UnwindSafe,\n <Types as NodeType>::SignatureKey: UnwindSafe,\n <Types as NodeType>::Time: UnwindSafe,\n <Types as NodeType>::Transaction: UnwindSafe,",1,["hotshot_query_service::availability::query_data::LeafQueryData"]],["impl<Types> UnwindSafe for InconsistentLeafError<Types>",1,["hotshot_query_service::availability::query_data::InconsistentLeafError"]],["impl<Types> UnwindSafe for BlockQueryData<Types>where\n <Types as NodeType>::BlockHeader: UnwindSafe,\n <Types as NodeType>::BlockPayload: UnwindSafe,",1,["hotshot_query_service::availability::query_data::BlockQueryData"]],["impl<Types> UnwindSafe for TransactionQueryData<Types>where\n <<Types as NodeType>::BlockPayload as QueryablePayload>::InclusionProof: UnwindSafe,\n <Types as NodeType>::Transaction: UnwindSafe,",1,["hotshot_query_service::availability::query_data::TransactionQueryData"]],["impl UnwindSafe for Options",1,["hotshot_query_service::availability::Options"]],["impl UnwindSafe for Error",1,["hotshot_query_service::availability::Error"]],["impl UnwindSafe for RequestSnafu",1,["hotshot_query_service::availability::RequestSnafu"]],["impl<__T0> UnwindSafe for QueryLeafSnafu<__T0>where\n __T0: UnwindSafe,",1,["hotshot_query_service::availability::QueryLeafSnafu"]],["impl UnwindSafe for StreamLeafSnafu",1,["hotshot_query_service::availability::StreamLeafSnafu"]],["impl<__T0> UnwindSafe for QueryBlockSnafu<__T0>where\n __T0: UnwindSafe,",1,["hotshot_query_service::availability::QueryBlockSnafu"]],["impl UnwindSafe for StreamBlockSnafu",1,["hotshot_query_service::availability::StreamBlockSnafu"]],["impl<__T0> UnwindSafe for QueryTransactionSnafu<__T0>where\n __T0: UnwindSafe,",1,["hotshot_query_service::availability::QueryTransactionSnafu"]],["impl<__T0> UnwindSafe for QueryProposalsSnafu<__T0>where\n __T0: UnwindSafe,",1,["hotshot_query_service::availability::QueryProposalsSnafu"]],["impl<__T0, __T1> UnwindSafe for InvalidTransactionIndexSnafu<__T0, __T1>where\n __T0: UnwindSafe,\n __T1: UnwindSafe,",1,["hotshot_query_service::availability::InvalidTransactionIndexSnafu"]],["impl<__T0, __T1> UnwindSafe for LeafStreamSnafu<__T0, __T1>where\n __T0: UnwindSafe,\n __T1: UnwindSafe,",1,["hotshot_query_service::availability::LeafStreamSnafu"]],["impl<__T0, __T1> UnwindSafe for BlockStreamSnafu<__T0, __T1>where\n __T0: UnwindSafe,\n __T1: UnwindSafe,",1,["hotshot_query_service::availability::BlockStreamSnafu"]],["impl UnwindSafe for InvalidSignatureKeySnafu",1,["hotshot_query_service::availability::InvalidSignatureKeySnafu"]],["impl<__T0, __T1> UnwindSafe for CustomSnafu<__T0, __T1>where\n __T0: UnwindSafe,\n __T1: UnwindSafe,",1,["hotshot_query_service::availability::CustomSnafu"]],["impl<D, U> UnwindSafe for ExtensibleDataSource<D, U>where\n D: UnwindSafe,\n U: UnwindSafe,",1,["hotshot_query_service::data_source::extension::ExtensibleDataSource"]],["impl<Types> !UnwindSafe for FileSystemDataSource<Types>",1,["hotshot_query_service::data_source::fs::FileSystemDataSource"]],["impl !UnwindSafe for MetricsDataSource",1,["hotshot_query_service::data_source::metrics::MetricsDataSource"]],["impl UnwindSafe for Config",1,["hotshot_query_service::data_source::sql::Config"]],["impl<Types> !UnwindSafe for SqlDataSource<Types>",1,["hotshot_query_service::data_source::sql::SqlDataSource"]],["impl<'a> !UnwindSafe for Transaction<'a>",1,["hotshot_query_service::data_source::sql::Transaction"]],["impl UnwindSafe for Error",1,["hotshot_query_service::error::Error"]],["impl !UnwindSafe for MetricsError",1,["hotshot_query_service::metrics::MetricsError"]],["impl !UnwindSafe for PrometheusMetrics",1,["hotshot_query_service::metrics::PrometheusMetrics"]],["impl UnwindSafe for Counter",1,["hotshot_query_service::metrics::Counter"]],["impl UnwindSafe for Gauge",1,["hotshot_query_service::metrics::Gauge"]],["impl UnwindSafe for Histogram",1,["hotshot_query_service::metrics::Histogram"]],["impl UnwindSafe for Label",1,["hotshot_query_service::metrics::Label"]],["impl UnwindSafe for MempoolQueryData",1,["hotshot_query_service::status::query_data::MempoolQueryData"]],["impl UnwindSafe for Options",1,["hotshot_query_service::status::Options"]],["impl UnwindSafe for Error",1,["hotshot_query_service::status::Error"]],["impl UnwindSafe for QueryError",1,["hotshot_query_service::QueryError"]],["impl UnwindSafe for NotFoundSnafu",1,["hotshot_query_service::NotFoundSnafu"]],["impl UnwindSafe for MissingSnafu",1,["hotshot_query_service::MissingSnafu"]],["impl<__T0> UnwindSafe for Snafu<__T0>where\n __T0: UnwindSafe,",1,["hotshot_query_service::Snafu"]],["impl UnwindSafe for Options",1,["hotshot_query_service::Options"]]] +"hotshot_query_service":[["impl<T> UnwindSafe for ResourceId<T>",1,["hotshot_query_service::availability::data_source::ResourceId"]],["impl<T> !UnwindSafe for Fetch<T>",1,["hotshot_query_service::availability::fetch::Fetch"]],["impl<Types> UnwindSafe for LeafQueryData<Types>where\n Types: UnwindSafe,\n <Types as NodeType>::BlockHeader: UnwindSafe,\n <Types as NodeType>::BlockPayload: UnwindSafe,\n <<Types as NodeType>::SignatureKey as SignatureKey>::QCType: UnwindSafe,\n <Types as NodeType>::SignatureKey: UnwindSafe,\n <Types as NodeType>::Time: UnwindSafe,\n <Types as NodeType>::Transaction: UnwindSafe,",1,["hotshot_query_service::availability::query_data::LeafQueryData"]],["impl<Types> UnwindSafe for InconsistentLeafError<Types>",1,["hotshot_query_service::availability::query_data::InconsistentLeafError"]],["impl<Types> UnwindSafe for BlockQueryData<Types>where\n <Types as NodeType>::BlockHeader: UnwindSafe,\n <Types as NodeType>::BlockPayload: UnwindSafe,",1,["hotshot_query_service::availability::query_data::BlockQueryData"]],["impl<Types> UnwindSafe for TransactionQueryData<Types>where\n <<Types as NodeType>::BlockPayload as QueryablePayload>::InclusionProof: UnwindSafe,\n <Types as NodeType>::Transaction: UnwindSafe,",1,["hotshot_query_service::availability::query_data::TransactionQueryData"]],["impl UnwindSafe for Options",1,["hotshot_query_service::availability::Options"]],["impl UnwindSafe for Error",1,["hotshot_query_service::availability::Error"]],["impl UnwindSafe for RequestSnafu",1,["hotshot_query_service::availability::RequestSnafu"]],["impl<__T0> UnwindSafe for FetchLeafSnafu<__T0>where\n __T0: UnwindSafe,",1,["hotshot_query_service::availability::FetchLeafSnafu"]],["impl<__T0> UnwindSafe for FetchBlockSnafu<__T0>where\n __T0: UnwindSafe,",1,["hotshot_query_service::availability::FetchBlockSnafu"]],["impl<__T0> UnwindSafe for FetchTransactionSnafu<__T0>where\n __T0: UnwindSafe,",1,["hotshot_query_service::availability::FetchTransactionSnafu"]],["impl<__T0, __T1> UnwindSafe for InvalidTransactionIndexSnafu<__T0, __T1>where\n __T0: UnwindSafe,\n __T1: UnwindSafe,",1,["hotshot_query_service::availability::InvalidTransactionIndexSnafu"]],["impl<__T0, __T1> UnwindSafe for CustomSnafu<__T0, __T1>where\n __T0: UnwindSafe,\n __T1: UnwindSafe,",1,["hotshot_query_service::availability::CustomSnafu"]],["impl<D, U> UnwindSafe for ExtensibleDataSource<D, U>where\n D: UnwindSafe,\n U: UnwindSafe,",1,["hotshot_query_service::data_source::extension::ExtensibleDataSource"]],["impl<Types, S, P> !UnwindSafe for FetchingDataSource<Types, S, P>",1,["hotshot_query_service::data_source::fetching::FetchingDataSource"]],["impl !UnwindSafe for MetricsDataSource",1,["hotshot_query_service::data_source::metrics::MetricsDataSource"]],["impl<Types> UnwindSafe for FileSystemStorage<Types>where\n Types: UnwindSafe,\n <Types as NodeType>::BlockHeader: UnwindSafe,\n <Types as NodeType>::BlockPayload: UnwindSafe,\n <<Types as NodeType>::SignatureKey as SignatureKey>::QCType: UnwindSafe,\n <Types as NodeType>::SignatureKey: UnwindSafe,\n <Types as NodeType>::Time: UnwindSafe,\n <Types as NodeType>::Transaction: UnwindSafe,\n <<Types as NodeType>::BlockPayload as QueryablePayload>::TransactionIndex: UnwindSafe,",1,["hotshot_query_service::data_source::storage::fs::FileSystemStorage"]],["impl UnwindSafe for Config",1,["hotshot_query_service::data_source::storage::sql::Config"]],["impl !UnwindSafe for SqlStorage",1,["hotshot_query_service::data_source::storage::sql::SqlStorage"]],["impl<'a> !UnwindSafe for Transaction<'a>",1,["hotshot_query_service::data_source::storage::sql::Transaction"]],["impl UnwindSafe for Error",1,["hotshot_query_service::error::Error"]],["impl !UnwindSafe for MetricsError",1,["hotshot_query_service::metrics::MetricsError"]],["impl !UnwindSafe for PrometheusMetrics",1,["hotshot_query_service::metrics::PrometheusMetrics"]],["impl UnwindSafe for Counter",1,["hotshot_query_service::metrics::Counter"]],["impl UnwindSafe for Gauge",1,["hotshot_query_service::metrics::Gauge"]],["impl UnwindSafe for Histogram",1,["hotshot_query_service::metrics::Histogram"]],["impl UnwindSafe for Label",1,["hotshot_query_service::metrics::Label"]],["impl UnwindSafe for Options",1,["hotshot_query_service::node::Options"]],["impl UnwindSafe for Error",1,["hotshot_query_service::node::Error"]],["impl UnwindSafe for RequestSnafu",1,["hotshot_query_service::node::RequestSnafu"]],["impl UnwindSafe for QuerySnafu",1,["hotshot_query_service::node::QuerySnafu"]],["impl<__T0> UnwindSafe for QueryProposalsSnafu<__T0>where\n __T0: UnwindSafe,",1,["hotshot_query_service::node::QueryProposalsSnafu"]],["impl UnwindSafe for InvalidSignatureKeySnafu",1,["hotshot_query_service::node::InvalidSignatureKeySnafu"]],["impl<__T0, __T1> UnwindSafe for CustomSnafu<__T0, __T1>where\n __T0: UnwindSafe,\n __T1: UnwindSafe,",1,["hotshot_query_service::node::CustomSnafu"]],["impl UnwindSafe for MempoolQueryData",1,["hotshot_query_service::status::query_data::MempoolQueryData"]],["impl UnwindSafe for Options",1,["hotshot_query_service::status::Options"]],["impl UnwindSafe for Error",1,["hotshot_query_service::status::Error"]],["impl UnwindSafe for QueryError",1,["hotshot_query_service::QueryError"]],["impl UnwindSafe for NotFoundSnafu",1,["hotshot_query_service::NotFoundSnafu"]],["impl UnwindSafe for MissingSnafu",1,["hotshot_query_service::MissingSnafu"]],["impl<__T0> UnwindSafe for Snafu<__T0>where\n __T0: UnwindSafe,",1,["hotshot_query_service::Snafu"]],["impl UnwindSafe for Options",1,["hotshot_query_service::Options"]]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/core/str/traits/trait.FromStr.js b/trait.impl/core/str/traits/trait.FromStr.js index de6b086d7..6cc76f4fd 100644 --- a/trait.impl/core/str/traits/trait.FromStr.js +++ b/trait.impl/core/str/traits/trait.FromStr.js @@ -1,3 +1,3 @@ (function() {var implementors = { -"hotshot_query_service":[["impl FromStr for Config"]] +"hotshot_query_service":[["impl FromStr for Config"]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/hotshot_query_service/data_source/sql/trait.Query.js b/trait.impl/hotshot_query_service/data_source/storage/sql/trait.Query.js similarity index 100% rename from trait.impl/hotshot_query_service/data_source/sql/trait.Query.js rename to trait.impl/hotshot_query_service/data_source/storage/sql/trait.Query.js diff --git a/trait.impl/hotshot_query_service/data_source/storage/trait.AvailabilityStorage.js b/trait.impl/hotshot_query_service/data_source/storage/trait.AvailabilityStorage.js new file mode 100644 index 000000000..146940164 --- /dev/null +++ b/trait.impl/hotshot_query_service/data_source/storage/trait.AvailabilityStorage.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"hotshot_query_service":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/hotshot_query_service/node/data_source/trait.NodeDataSource.js b/trait.impl/hotshot_query_service/node/data_source/trait.NodeDataSource.js new file mode 100644 index 000000000..146940164 --- /dev/null +++ b/trait.impl/hotshot_query_service/node/data_source/trait.NodeDataSource.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"hotshot_query_service":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/hotshot_query_service/node/data_source/trait.UpdateNodeData.js b/trait.impl/hotshot_query_service/node/data_source/trait.UpdateNodeData.js new file mode 100644 index 000000000..146940164 --- /dev/null +++ b/trait.impl/hotshot_query_service/node/data_source/trait.UpdateNodeData.js @@ -0,0 +1,3 @@ +(function() {var implementors = { +"hotshot_query_service":[] +};if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/serde/de/trait.Deserialize.js b/trait.impl/serde/de/trait.Deserialize.js index c10ba9410..aa73135b7 100644 --- a/trait.impl/serde/de/trait.Deserialize.js +++ b/trait.impl/serde/de/trait.Deserialize.js @@ -1,3 +1,3 @@ (function() {var implementors = { -"hotshot_query_service":[["impl<'de> Deserialize<'de> for MempoolQueryData"],["impl<'de> Deserialize<'de> for Error"],["impl<'de> Deserialize<'de> for Error"],["impl<'de, Types: NodeType> Deserialize<'de> for LeafQueryData<Types>"],["impl<'de, Types: NodeType> Deserialize<'de> for TransactionQueryData<Types>where\n Payload<Types>: QueryablePayload,"],["impl<'de> Deserialize<'de> for Error"],["impl<'de, Types: NodeType> Deserialize<'de> for BlockQueryData<Types>"],["impl<'de> Deserialize<'de> for QueryError"]] +"hotshot_query_service":[["impl<'de> Deserialize<'de> for MempoolQueryData"],["impl<'de> Deserialize<'de> for Error"],["impl<'de, Types: NodeType> Deserialize<'de> for BlockQueryData<Types>"],["impl<'de> Deserialize<'de> for QueryError"],["impl<'de> Deserialize<'de> for Error"],["impl<'de> Deserialize<'de> for Error"],["impl<'de, Types: NodeType> Deserialize<'de> for LeafQueryData<Types>"],["impl<'de> Deserialize<'de> for Error"],["impl<'de, Types: NodeType> Deserialize<'de> for TransactionQueryData<Types>where\n Payload<Types>: QueryablePayload,"]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/serde/ser/trait.Serialize.js b/trait.impl/serde/ser/trait.Serialize.js index 7e69f384b..44772bfb9 100644 --- a/trait.impl/serde/ser/trait.Serialize.js +++ b/trait.impl/serde/ser/trait.Serialize.js @@ -1,3 +1,3 @@ (function() {var implementors = { -"hotshot_query_service":[["impl Serialize for MempoolQueryData"],["impl Serialize for Error"],["impl<Types: NodeType> Serialize for LeafQueryData<Types>"],["impl Serialize for Error"],["impl<Types: NodeType> Serialize for TransactionQueryData<Types>where\n Payload<Types>: QueryablePayload,"],["impl Serialize for Error"],["impl<Types: NodeType> Serialize for BlockQueryData<Types>"],["impl Serialize for QueryError"]] +"hotshot_query_service":[["impl<Types: NodeType> Serialize for LeafQueryData<Types>"],["impl Serialize for Error"],["impl Serialize for Error"],["impl Serialize for QueryError"],["impl Serialize for Error"],["impl<Types: NodeType> Serialize for BlockQueryData<Types>"],["impl<Types: NodeType> Serialize for TransactionQueryData<Types>where\n Payload<Types>: QueryablePayload,"],["impl Serialize for MempoolQueryData"],["impl Serialize for Error"]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/snafu/trait.ErrorCompat.js b/trait.impl/snafu/trait.ErrorCompat.js index c464c03ea..ab1992a44 100644 --- a/trait.impl/snafu/trait.ErrorCompat.js +++ b/trait.impl/snafu/trait.ErrorCompat.js @@ -1,3 +1,3 @@ (function() {var implementors = { -"hotshot_query_service":[["impl ErrorCompat for MetricsError"],["impl ErrorCompat for Error"],["impl<Types: NodeType> ErrorCompat for InconsistentLeafError<Types>"],["impl ErrorCompat for Error"],["impl ErrorCompat for QueryError"],["impl ErrorCompat for Error"]] +"hotshot_query_service":[["impl ErrorCompat for Error"],["impl<Types: NodeType> ErrorCompat for InconsistentLeafError<Types>"],["impl ErrorCompat for MetricsError"],["impl ErrorCompat for QueryError"],["impl ErrorCompat for Error"],["impl ErrorCompat for Error"],["impl ErrorCompat for Error"]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/trait.impl/snafu/trait.IntoError.js b/trait.impl/snafu/trait.IntoError.js index c98c5096b..a88854fc0 100644 --- a/trait.impl/snafu/trait.IntoError.js +++ b/trait.impl/snafu/trait.IntoError.js @@ -1,3 +1,3 @@ (function() {var implementors = { -"hotshot_query_service":[["impl<__T0, __T1> IntoError<Error> for LeafStreamSnafu<__T0, __T1>where\n Error: Error + ErrorCompat,\n __T0: Into<usize>,\n __T1: Into<String>,"],["impl<__T0, __T1> IntoError<Error> for BlockStreamSnafu<__T0, __T1>where\n Error: Error + ErrorCompat,\n __T0: Into<usize>,\n __T1: Into<String>,"],["impl<__T0> IntoError<Error> for QueryProposalsSnafu<__T0>where\n Error: Error + ErrorCompat,\n __T0: Into<EncodedPublicKey>,"],["impl<__T0> IntoError<Error> for QueryBlockSnafu<__T0>where\n Error: Error + ErrorCompat,\n __T0: Into<String>,"],["impl IntoError<Error> for InvalidSignatureKeySnafuwhere\n Error: Error + ErrorCompat,"],["impl<__T0> IntoError<Error> for QueryLeafSnafu<__T0>where\n Error: Error + ErrorCompat,\n __T0: Into<String>,"],["impl<__T0, __T1> IntoError<Error> for InvalidTransactionIndexSnafu<__T0, __T1>where\n Error: Error + ErrorCompat,\n __T0: Into<u64>,\n __T1: Into<u64>,"],["impl IntoError<QueryError> for NotFoundSnafuwhere\n QueryError: Error + ErrorCompat,"],["impl<__T0> IntoError<Error> for QueryTransactionSnafu<__T0>where\n Error: Error + ErrorCompat,\n __T0: Into<String>,"],["impl IntoError<Error> for StreamBlockSnafuwhere\n Error: Error + ErrorCompat,"],["impl IntoError<Error> for RequestSnafuwhere\n Error: Error + ErrorCompat,"],["impl<__T0> IntoError<QueryError> for Snafu<__T0>where\n QueryError: Error + ErrorCompat,\n __T0: Into<String>,"],["impl IntoError<Error> for StreamLeafSnafuwhere\n Error: Error + ErrorCompat,"],["impl IntoError<QueryError> for MissingSnafuwhere\n QueryError: Error + ErrorCompat,"],["impl<__T0, __T1> IntoError<Error> for CustomSnafu<__T0, __T1>where\n Error: Error + ErrorCompat,\n __T0: Into<String>,\n __T1: Into<StatusCode>,"]] +"hotshot_query_service":[["impl<__T0> IntoError<QueryError> for Snafu<__T0>where\n QueryError: Error + ErrorCompat,\n __T0: Into<String>,"],["impl IntoError<QueryError> for MissingSnafuwhere\n QueryError: Error + ErrorCompat,"],["impl<__T0, __T1> IntoError<Error> for InvalidTransactionIndexSnafu<__T0, __T1>where\n Error: Error + ErrorCompat,\n __T0: Into<u64>,\n __T1: Into<u64>,"],["impl<__T0> IntoError<Error> for FetchTransactionSnafu<__T0>where\n Error: Error + ErrorCompat,\n __T0: Into<String>,"],["impl IntoError<Error> for RequestSnafuwhere\n Error: Error + ErrorCompat,"],["impl IntoError<Error> for RequestSnafuwhere\n Error: Error + ErrorCompat,"],["impl<__T0, __T1> IntoError<Error> for CustomSnafu<__T0, __T1>where\n Error: Error + ErrorCompat,\n __T0: Into<String>,\n __T1: Into<StatusCode>,"],["impl<__T0> IntoError<Error> for FetchLeafSnafu<__T0>where\n Error: Error + ErrorCompat,\n __T0: Into<String>,"],["impl IntoError<Error> for QuerySnafuwhere\n Error: Error + ErrorCompat,"],["impl<__T0> IntoError<Error> for QueryProposalsSnafu<__T0>where\n Error: Error + ErrorCompat,\n __T0: Into<EncodedPublicKey>,"],["impl IntoError<Error> for InvalidSignatureKeySnafuwhere\n Error: Error + ErrorCompat,"],["impl<__T0> IntoError<Error> for FetchBlockSnafu<__T0>where\n Error: Error + ErrorCompat,\n __T0: Into<String>,"],["impl IntoError<QueryError> for NotFoundSnafuwhere\n QueryError: Error + ErrorCompat,"],["impl<__T0, __T1> IntoError<Error> for CustomSnafu<__T0, __T1>where\n Error: Error + ErrorCompat,\n __T0: Into<String>,\n __T1: Into<StatusCode>,"]] };if (window.register_implementors) {window.register_implementors(implementors);} else {window.pending_implementors = implementors;}})() \ No newline at end of file diff --git a/type.impl/core/result/enum.Result.js b/type.impl/core/result/enum.Result.js index 73be28786..101382384 100644 --- a/type.impl/core/result/enum.Result.js +++ b/type.impl/core/result/enum.Result.js @@ -1,3 +1,3 @@ (function() {var type_impls = { -"hotshot_query_service":[["
    source§

    impl<T, E> Result<T, E>

    1.0.0 (const: 1.48.0) · source

    pub const fn is_ok(&self) -> bool

    Returns true if the result is Ok.

    \n
    Examples
    \n
    let x: Result<i32, &str> = Ok(-3);\nassert_eq!(x.is_ok(), true);\n\nlet x: Result<i32, &str> = Err("Some error message");\nassert_eq!(x.is_ok(), false);
    \n
    1.70.0 · source

    pub fn is_ok_and(self, f: impl FnOnce(T) -> bool) -> bool

    Returns true if the result is Ok and the value inside of it matches a predicate.

    \n
    Examples
    \n
    let x: Result<u32, &str> = Ok(2);\nassert_eq!(x.is_ok_and(|x| x > 1), true);\n\nlet x: Result<u32, &str> = Ok(0);\nassert_eq!(x.is_ok_and(|x| x > 1), false);\n\nlet x: Result<u32, &str> = Err("hey");\nassert_eq!(x.is_ok_and(|x| x > 1), false);
    \n
    1.0.0 (const: 1.48.0) · source

    pub const fn is_err(&self) -> bool

    Returns true if the result is Err.

    \n
    Examples
    \n
    let x: Result<i32, &str> = Ok(-3);\nassert_eq!(x.is_err(), false);\n\nlet x: Result<i32, &str> = Err("Some error message");\nassert_eq!(x.is_err(), true);
    \n
    1.70.0 · source

    pub fn is_err_and(self, f: impl FnOnce(E) -> bool) -> bool

    Returns true if the result is Err and the value inside of it matches a predicate.

    \n
    Examples
    \n
    use std::io::{Error, ErrorKind};\n\nlet x: Result<u32, Error> = Err(Error::new(ErrorKind::NotFound, "!"));\nassert_eq!(x.is_err_and(|x| x.kind() == ErrorKind::NotFound), true);\n\nlet x: Result<u32, Error> = Err(Error::new(ErrorKind::PermissionDenied, "!"));\nassert_eq!(x.is_err_and(|x| x.kind() == ErrorKind::NotFound), false);\n\nlet x: Result<u32, Error> = Ok(123);\nassert_eq!(x.is_err_and(|x| x.kind() == ErrorKind::NotFound), false);
    \n
    1.0.0 · source

    pub fn ok(self) -> Option<T>

    Converts from Result<T, E> to Option<T>.

    \n

    Converts self into an Option<T>, consuming self,\nand discarding the error, if any.

    \n
    Examples
    \n
    let x: Result<u32, &str> = Ok(2);\nassert_eq!(x.ok(), Some(2));\n\nlet x: Result<u32, &str> = Err("Nothing here");\nassert_eq!(x.ok(), None);
    \n
    1.0.0 · source

    pub fn err(self) -> Option<E>

    Converts from Result<T, E> to Option<E>.

    \n

    Converts self into an Option<E>, consuming self,\nand discarding the success value, if any.

    \n
    Examples
    \n
    let x: Result<u32, &str> = Ok(2);\nassert_eq!(x.err(), None);\n\nlet x: Result<u32, &str> = Err("Nothing here");\nassert_eq!(x.err(), Some("Nothing here"));
    \n
    1.0.0 (const: 1.48.0) · source

    pub const fn as_ref(&self) -> Result<&T, &E>

    Converts from &Result<T, E> to Result<&T, &E>.

    \n

    Produces a new Result, containing a reference\ninto the original, leaving the original in place.

    \n
    Examples
    \n
    let x: Result<u32, &str> = Ok(2);\nassert_eq!(x.as_ref(), Ok(&2));\n\nlet x: Result<u32, &str> = Err("Error");\nassert_eq!(x.as_ref(), Err(&"Error"));
    \n
    1.0.0 (const: unstable) · source

    pub fn as_mut(&mut self) -> Result<&mut T, &mut E>

    Converts from &mut Result<T, E> to Result<&mut T, &mut E>.

    \n
    Examples
    \n
    fn mutate(r: &mut Result<i32, i32>) {\n    match r.as_mut() {\n        Ok(v) => *v = 42,\n        Err(e) => *e = 0,\n    }\n}\n\nlet mut x: Result<i32, i32> = Ok(2);\nmutate(&mut x);\nassert_eq!(x.unwrap(), 42);\n\nlet mut x: Result<i32, i32> = Err(13);\nmutate(&mut x);\nassert_eq!(x.unwrap_err(), 0);
    \n
    1.0.0 · source

    pub fn map<U, F>(self, op: F) -> Result<U, E>where\n F: FnOnce(T) -> U,

    Maps a Result<T, E> to Result<U, E> by applying a function to a\ncontained Ok value, leaving an Err value untouched.

    \n

    This function can be used to compose the results of two functions.

    \n
    Examples
    \n

    Print the numbers on each line of a string multiplied by two.

    \n\n
    let line = "1\\n2\\n3\\n4\\n";\n\nfor num in line.lines() {\n    match num.parse::<i32>().map(|i| i * 2) {\n        Ok(n) => println!("{n}"),\n        Err(..) => {}\n    }\n}
    \n
    1.41.0 · source

    pub fn map_or<U, F>(self, default: U, f: F) -> Uwhere\n F: FnOnce(T) -> U,

    Returns the provided default (if Err), or\napplies a function to the contained value (if Ok).

    \n

    Arguments passed to map_or are eagerly evaluated; if you are passing\nthe result of a function call, it is recommended to use map_or_else,\nwhich is lazily evaluated.

    \n
    Examples
    \n
    let x: Result<_, &str> = Ok("foo");\nassert_eq!(x.map_or(42, |v| v.len()), 3);\n\nlet x: Result<&str, _> = Err("bar");\nassert_eq!(x.map_or(42, |v| v.len()), 42);
    \n
    1.41.0 · source

    pub fn map_or_else<U, D, F>(self, default: D, f: F) -> Uwhere\n D: FnOnce(E) -> U,\n F: FnOnce(T) -> U,

    Maps a Result<T, E> to U by applying fallback function default to\na contained Err value, or function f to a contained Ok value.

    \n

    This function can be used to unpack a successful result\nwhile handling an error.

    \n
    Examples
    \n
    let k = 21;\n\nlet x : Result<_, &str> = Ok("foo");\nassert_eq!(x.map_or_else(|e| k * 2, |v| v.len()), 3);\n\nlet x : Result<&str, _> = Err("bar");\nassert_eq!(x.map_or_else(|e| k * 2, |v| v.len()), 42);
    \n
    1.0.0 · source

    pub fn map_err<F, O>(self, op: O) -> Result<T, F>where\n O: FnOnce(E) -> F,

    Maps a Result<T, E> to Result<T, F> by applying a function to a\ncontained Err value, leaving an Ok value untouched.

    \n

    This function can be used to pass through a successful result while handling\nan error.

    \n
    Examples
    \n
    fn stringify(x: u32) -> String { format!("error code: {x}") }\n\nlet x: Result<u32, u32> = Ok(2);\nassert_eq!(x.map_err(stringify), Ok(2));\n\nlet x: Result<u32, u32> = Err(13);\nassert_eq!(x.map_err(stringify), Err("error code: 13".to_string()));
    \n
    source

    pub fn inspect<F>(self, f: F) -> Result<T, E>where\n F: FnOnce(&T),

    🔬This is a nightly-only experimental API. (result_option_inspect)

    Calls the provided closure with a reference to the contained value (if Ok).

    \n
    Examples
    \n
    #![feature(result_option_inspect)]\n\nlet x: u8 = "4"\n    .parse::<u8>()\n    .inspect(|x| println!("original: {x}"))\n    .map(|x| x.pow(3))\n    .expect("failed to parse number");
    \n
    source

    pub fn inspect_err<F>(self, f: F) -> Result<T, E>where\n F: FnOnce(&E),

    🔬This is a nightly-only experimental API. (result_option_inspect)

    Calls the provided closure with a reference to the contained error (if Err).

    \n
    Examples
    \n
    #![feature(result_option_inspect)]\n\nuse std::{fs, io};\n\nfn read() -> io::Result<String> {\n    fs::read_to_string("address.txt")\n        .inspect_err(|e| eprintln!("failed to read file: {e}"))\n}
    \n
    1.47.0 · source

    pub fn as_deref(&self) -> Result<&<T as Deref>::Target, &E>where\n T: Deref,

    Converts from Result<T, E> (or &Result<T, E>) to Result<&<T as Deref>::Target, &E>.

    \n

    Coerces the Ok variant of the original Result via Deref\nand returns the new Result.

    \n
    Examples
    \n
    let x: Result<String, u32> = Ok("hello".to_string());\nlet y: Result<&str, &u32> = Ok("hello");\nassert_eq!(x.as_deref(), y);\n\nlet x: Result<String, u32> = Err(42);\nlet y: Result<&str, &u32> = Err(&42);\nassert_eq!(x.as_deref(), y);
    \n
    1.47.0 · source

    pub fn as_deref_mut(&mut self) -> Result<&mut <T as Deref>::Target, &mut E>where\n T: DerefMut,

    Converts from Result<T, E> (or &mut Result<T, E>) to Result<&mut <T as DerefMut>::Target, &mut E>.

    \n

    Coerces the Ok variant of the original Result via DerefMut\nand returns the new Result.

    \n
    Examples
    \n
    let mut s = "HELLO".to_string();\nlet mut x: Result<String, u32> = Ok("hello".to_string());\nlet y: Result<&mut str, &mut u32> = Ok(&mut s);\nassert_eq!(x.as_deref_mut().map(|x| { x.make_ascii_uppercase(); x }), y);\n\nlet mut i = 42;\nlet mut x: Result<String, u32> = Err(42);\nlet y: Result<&mut str, &mut u32> = Err(&mut i);\nassert_eq!(x.as_deref_mut().map(|x| { x.make_ascii_uppercase(); x }), y);
    \n
    1.0.0 · source

    pub fn iter(&self) -> Iter<'_, T>

    Returns an iterator over the possibly contained value.

    \n

    The iterator yields one value if the result is Result::Ok, otherwise none.

    \n
    Examples
    \n
    let x: Result<u32, &str> = Ok(7);\nassert_eq!(x.iter().next(), Some(&7));\n\nlet x: Result<u32, &str> = Err("nothing!");\nassert_eq!(x.iter().next(), None);
    \n
    1.0.0 · source

    pub fn iter_mut(&mut self) -> IterMut<'_, T>

    Returns a mutable iterator over the possibly contained value.

    \n

    The iterator yields one value if the result is Result::Ok, otherwise none.

    \n
    Examples
    \n
    let mut x: Result<u32, &str> = Ok(7);\nmatch x.iter_mut().next() {\n    Some(v) => *v = 40,\n    None => {},\n}\nassert_eq!(x, Ok(40));\n\nlet mut x: Result<u32, &str> = Err("nothing!");\nassert_eq!(x.iter_mut().next(), None);
    \n
    1.4.0 · source

    pub fn expect(self, msg: &str) -> Twhere\n E: Debug,

    Returns the contained Ok value, consuming the self value.

    \n

    Because this function may panic, its use is generally discouraged.\nInstead, prefer to use pattern matching and handle the Err\ncase explicitly, or call unwrap_or, unwrap_or_else, or\nunwrap_or_default.

    \n
    Panics
    \n

    Panics if the value is an Err, with a panic message including the\npassed message, and the content of the Err.

    \n
    Examples
    \n
    let x: Result<u32, &str> = Err("emergency failure");\nx.expect("Testing expect"); // panics with `Testing expect: emergency failure`
    \n
    Recommended Message Style
    \n

    We recommend that expect messages are used to describe the reason you\nexpect the Result should be Ok.

    \n\n
    let path = std::env::var("IMPORTANT_PATH")\n    .expect("env variable `IMPORTANT_PATH` should be set by `wrapper_script.sh`");
    \n

    Hint: If you’re having trouble remembering how to phrase expect\nerror messages remember to focus on the word “should” as in “env\nvariable should be set by blah” or “the given binary should be available\nand executable by the current user”.

    \n

    For more detail on expect message styles and the reasoning behind our recommendation please\nrefer to the section on “Common Message\nStyles” in the\nstd::error module docs.

    \n
    1.0.0 · source

    pub fn unwrap(self) -> Twhere\n E: Debug,

    Returns the contained Ok value, consuming the self value.

    \n

    Because this function may panic, its use is generally discouraged.\nInstead, prefer to use pattern matching and handle the Err\ncase explicitly, or call unwrap_or, unwrap_or_else, or\nunwrap_or_default.

    \n
    Panics
    \n

    Panics if the value is an Err, with a panic message provided by the\nErr’s value.

    \n
    Examples
    \n

    Basic usage:

    \n\n
    let x: Result<u32, &str> = Ok(2);\nassert_eq!(x.unwrap(), 2);
    \n\n
    let x: Result<u32, &str> = Err("emergency failure");\nx.unwrap(); // panics with `emergency failure`
    \n
    1.16.0 · source

    pub fn unwrap_or_default(self) -> Twhere\n T: Default,

    Returns the contained Ok value or a default

    \n

    Consumes the self argument then, if Ok, returns the contained\nvalue, otherwise if Err, returns the default value for that\ntype.

    \n
    Examples
    \n

    Converts a string to an integer, turning poorly-formed strings\ninto 0 (the default value for integers). parse converts\na string to any other type that implements FromStr, returning an\nErr on error.

    \n\n
    let good_year_from_input = "1909";\nlet bad_year_from_input = "190blarg";\nlet good_year = good_year_from_input.parse().unwrap_or_default();\nlet bad_year = bad_year_from_input.parse().unwrap_or_default();\n\nassert_eq!(1909, good_year);\nassert_eq!(0, bad_year);
    \n
    1.17.0 · source

    pub fn expect_err(self, msg: &str) -> Ewhere\n T: Debug,

    Returns the contained Err value, consuming the self value.

    \n
    Panics
    \n

    Panics if the value is an Ok, with a panic message including the\npassed message, and the content of the Ok.

    \n
    Examples
    \n
    let x: Result<u32, &str> = Ok(10);\nx.expect_err("Testing expect_err"); // panics with `Testing expect_err: 10`
    \n
    1.0.0 · source

    pub fn unwrap_err(self) -> Ewhere\n T: Debug,

    Returns the contained Err value, consuming the self value.

    \n
    Panics
    \n

    Panics if the value is an Ok, with a custom panic message provided\nby the Ok’s value.

    \n
    Examples
    \n
    let x: Result<u32, &str> = Ok(2);\nx.unwrap_err(); // panics with `2`
    \n\n
    let x: Result<u32, &str> = Err("emergency failure");\nassert_eq!(x.unwrap_err(), "emergency failure");
    \n
    source

    pub fn into_ok(self) -> Twhere\n E: Into<!>,

    🔬This is a nightly-only experimental API. (unwrap_infallible)

    Returns the contained Ok value, but never panics.

    \n

    Unlike unwrap, this method is known to never panic on the\nresult types it is implemented for. Therefore, it can be used\ninstead of unwrap as a maintainability safeguard that will fail\nto compile if the error type of the Result is later changed\nto an error that can actually occur.

    \n
    Examples
    \n
    \nfn only_good_news() -> Result<String, !> {\n    Ok("this is fine".into())\n}\n\nlet s: String = only_good_news().into_ok();\nprintln!("{s}");
    \n
    source

    pub fn into_err(self) -> Ewhere\n T: Into<!>,

    🔬This is a nightly-only experimental API. (unwrap_infallible)

    Returns the contained Err value, but never panics.

    \n

    Unlike unwrap_err, this method is known to never panic on the\nresult types it is implemented for. Therefore, it can be used\ninstead of unwrap_err as a maintainability safeguard that will fail\nto compile if the ok type of the Result is later changed\nto a type that can actually occur.

    \n
    Examples
    \n
    \nfn only_bad_news() -> Result<!, String> {\n    Err("Oops, it failed".into())\n}\n\nlet error: String = only_bad_news().into_err();\nprintln!("{error}");
    \n
    1.0.0 · source

    pub fn and<U>(self, res: Result<U, E>) -> Result<U, E>

    Returns res if the result is Ok, otherwise returns the Err value of self.

    \n

    Arguments passed to and are eagerly evaluated; if you are passing the\nresult of a function call, it is recommended to use and_then, which is\nlazily evaluated.

    \n
    Examples
    \n
    let x: Result<u32, &str> = Ok(2);\nlet y: Result<&str, &str> = Err("late error");\nassert_eq!(x.and(y), Err("late error"));\n\nlet x: Result<u32, &str> = Err("early error");\nlet y: Result<&str, &str> = Ok("foo");\nassert_eq!(x.and(y), Err("early error"));\n\nlet x: Result<u32, &str> = Err("not a 2");\nlet y: Result<&str, &str> = Err("late error");\nassert_eq!(x.and(y), Err("not a 2"));\n\nlet x: Result<u32, &str> = Ok(2);\nlet y: Result<&str, &str> = Ok("different result type");\nassert_eq!(x.and(y), Ok("different result type"));
    \n
    1.0.0 · source

    pub fn and_then<U, F>(self, op: F) -> Result<U, E>where\n F: FnOnce(T) -> Result<U, E>,

    Calls op if the result is Ok, otherwise returns the Err value of self.

    \n

    This function can be used for control flow based on Result values.

    \n
    Examples
    \n
    fn sq_then_to_string(x: u32) -> Result<String, &'static str> {\n    x.checked_mul(x).map(|sq| sq.to_string()).ok_or("overflowed")\n}\n\nassert_eq!(Ok(2).and_then(sq_then_to_string), Ok(4.to_string()));\nassert_eq!(Ok(1_000_000).and_then(sq_then_to_string), Err("overflowed"));\nassert_eq!(Err("not a number").and_then(sq_then_to_string), Err("not a number"));
    \n

    Often used to chain fallible operations that may return Err.

    \n\n
    use std::{io::ErrorKind, path::Path};\n\n// Note: on Windows "/" maps to "C:\\"\nlet root_modified_time = Path::new("/").metadata().and_then(|md| md.modified());\nassert!(root_modified_time.is_ok());\n\nlet should_fail = Path::new("/bad/path").metadata().and_then(|md| md.modified());\nassert!(should_fail.is_err());\nassert_eq!(should_fail.unwrap_err().kind(), ErrorKind::NotFound);
    \n
    1.0.0 · source

    pub fn or<F>(self, res: Result<T, F>) -> Result<T, F>

    Returns res if the result is Err, otherwise returns the Ok value of self.

    \n

    Arguments passed to or are eagerly evaluated; if you are passing the\nresult of a function call, it is recommended to use or_else, which is\nlazily evaluated.

    \n
    Examples
    \n
    let x: Result<u32, &str> = Ok(2);\nlet y: Result<u32, &str> = Err("late error");\nassert_eq!(x.or(y), Ok(2));\n\nlet x: Result<u32, &str> = Err("early error");\nlet y: Result<u32, &str> = Ok(2);\nassert_eq!(x.or(y), Ok(2));\n\nlet x: Result<u32, &str> = Err("not a 2");\nlet y: Result<u32, &str> = Err("late error");\nassert_eq!(x.or(y), Err("late error"));\n\nlet x: Result<u32, &str> = Ok(2);\nlet y: Result<u32, &str> = Ok(100);\nassert_eq!(x.or(y), Ok(2));
    \n
    1.0.0 · source

    pub fn or_else<F, O>(self, op: O) -> Result<T, F>where\n O: FnOnce(E) -> Result<T, F>,

    Calls op if the result is Err, otherwise returns the Ok value of self.

    \n

    This function can be used for control flow based on result values.

    \n
    Examples
    \n
    fn sq(x: u32) -> Result<u32, u32> { Ok(x * x) }\nfn err(x: u32) -> Result<u32, u32> { Err(x) }\n\nassert_eq!(Ok(2).or_else(sq).or_else(sq), Ok(2));\nassert_eq!(Ok(2).or_else(err).or_else(sq), Ok(2));\nassert_eq!(Err(3).or_else(sq).or_else(err), Ok(9));\nassert_eq!(Err(3).or_else(err).or_else(err), Err(3));
    \n
    1.0.0 · source

    pub fn unwrap_or(self, default: T) -> T

    Returns the contained Ok value or a provided default.

    \n

    Arguments passed to unwrap_or are eagerly evaluated; if you are passing\nthe result of a function call, it is recommended to use unwrap_or_else,\nwhich is lazily evaluated.

    \n
    Examples
    \n
    let default = 2;\nlet x: Result<u32, &str> = Ok(9);\nassert_eq!(x.unwrap_or(default), 9);\n\nlet x: Result<u32, &str> = Err("error");\nassert_eq!(x.unwrap_or(default), default);
    \n
    1.0.0 · source

    pub fn unwrap_or_else<F>(self, op: F) -> Twhere\n F: FnOnce(E) -> T,

    Returns the contained Ok value or computes it from a closure.

    \n
    Examples
    \n
    fn count(x: &str) -> usize { x.len() }\n\nassert_eq!(Ok(2).unwrap_or_else(count), 2);\nassert_eq!(Err("foo").unwrap_or_else(count), 3);
    \n
    1.58.0 · source

    pub unsafe fn unwrap_unchecked(self) -> T

    Returns the contained Ok value, consuming the self value,\nwithout checking that the value is not an Err.

    \n
    Safety
    \n

    Calling this method on an Err is undefined behavior.

    \n
    Examples
    \n
    let x: Result<u32, &str> = Ok(2);\nassert_eq!(unsafe { x.unwrap_unchecked() }, 2);
    \n\n
    let x: Result<u32, &str> = Err("emergency failure");\nunsafe { x.unwrap_unchecked(); } // Undefined behavior!
    \n
    1.58.0 · source

    pub unsafe fn unwrap_err_unchecked(self) -> E

    Returns the contained Err value, consuming the self value,\nwithout checking that the value is not an Ok.

    \n
    Safety
    \n

    Calling this method on an Ok is undefined behavior.

    \n
    Examples
    \n
    let x: Result<u32, &str> = Ok(2);\nunsafe { x.unwrap_err_unchecked() }; // Undefined behavior!
    \n\n
    let x: Result<u32, &str> = Err("emergency failure");\nassert_eq!(unsafe { x.unwrap_err_unchecked() }, "emergency failure");
    \n
    ",0,"hotshot_query_service::QueryResult"],["
    source§

    impl<T, E> Result<&T, E>

    1.59.0 · source

    pub fn copied(self) -> Result<T, E>where\n T: Copy,

    Maps a Result<&T, E> to a Result<T, E> by copying the contents of the\nOk part.

    \n
    Examples
    \n
    let val = 12;\nlet x: Result<&i32, i32> = Ok(&val);\nassert_eq!(x, Ok(&12));\nlet copied = x.copied();\nassert_eq!(copied, Ok(12));
    \n
    1.59.0 · source

    pub fn cloned(self) -> Result<T, E>where\n T: Clone,

    Maps a Result<&T, E> to a Result<T, E> by cloning the contents of the\nOk part.

    \n
    Examples
    \n
    let val = 12;\nlet x: Result<&i32, i32> = Ok(&val);\nassert_eq!(x, Ok(&12));\nlet cloned = x.cloned();\nassert_eq!(cloned, Ok(12));
    \n
    ",0,"hotshot_query_service::QueryResult"],["
    source§

    impl<T, E> Result<&mut T, E>

    1.59.0 · source

    pub fn copied(self) -> Result<T, E>where\n T: Copy,

    Maps a Result<&mut T, E> to a Result<T, E> by copying the contents of the\nOk part.

    \n
    Examples
    \n
    let mut val = 12;\nlet x: Result<&mut i32, i32> = Ok(&mut val);\nassert_eq!(x, Ok(&mut 12));\nlet copied = x.copied();\nassert_eq!(copied, Ok(12));
    \n
    1.59.0 · source

    pub fn cloned(self) -> Result<T, E>where\n T: Clone,

    Maps a Result<&mut T, E> to a Result<T, E> by cloning the contents of the\nOk part.

    \n
    Examples
    \n
    let mut val = 12;\nlet x: Result<&mut i32, i32> = Ok(&mut val);\nassert_eq!(x, Ok(&mut 12));\nlet cloned = x.cloned();\nassert_eq!(cloned, Ok(12));
    \n
    ",0,"hotshot_query_service::QueryResult"],["
    source§

    impl<T, E> Result<Option<T>, E>

    1.33.0 (const: unstable) · source

    pub fn transpose(self) -> Option<Result<T, E>>

    Transposes a Result of an Option into an Option of a Result.

    \n

    Ok(None) will be mapped to None.\nOk(Some(_)) and Err(_) will be mapped to Some(Ok(_)) and Some(Err(_)).

    \n
    Examples
    \n
    #[derive(Debug, Eq, PartialEq)]\nstruct SomeErr;\n\nlet x: Result<Option<i32>, SomeErr> = Ok(Some(5));\nlet y: Option<Result<i32, SomeErr>> = Some(Ok(5));\nassert_eq!(x.transpose(), y);
    \n
    ",0,"hotshot_query_service::QueryResult"],["
    source§

    impl<T, E> Result<Result<T, E>, E>

    source

    pub fn flatten(self) -> Result<T, E>

    🔬This is a nightly-only experimental API. (result_flattening)

    Converts from Result<Result<T, E>, E> to Result<T, E>

    \n
    Examples
    \n
    #![feature(result_flattening)]\nlet x: Result<Result<&'static str, u32>, u32> = Ok(Ok("hello"));\nassert_eq!(Ok("hello"), x.flatten());\n\nlet x: Result<Result<&'static str, u32>, u32> = Ok(Err(6));\nassert_eq!(Err(6), x.flatten());\n\nlet x: Result<Result<&'static str, u32>, u32> = Err(6);\nassert_eq!(Err(6), x.flatten());
    \n

    Flattening only removes one level of nesting at a time:

    \n\n
    #![feature(result_flattening)]\nlet x: Result<Result<Result<&'static str, u32>, u32>, u32> = Ok(Ok(Ok("hello")));\nassert_eq!(Ok(Ok("hello")), x.flatten());\nassert_eq!(Ok("hello"), x.flatten().flatten());
    \n
    ",0,"hotshot_query_service::QueryResult"],["
    1.61.0 · source§

    impl<T, E> Termination for Result<T, E>where\n T: Termination,\n E: Debug,

    source§

    fn report(self) -> ExitCode

    Is called to get the representation of the value as status code.\nThis status code is returned to the operating system.
    ","Termination","hotshot_query_service::QueryResult"],["
    source§

    impl<T, E, F> FromResidual<Yeet<E>> for Result<T, F>where\n F: From<E>,

    source§

    fn from_residual(_: Yeet<E>) -> Result<T, F>

    🔬This is a nightly-only experimental API. (try_trait_v2)
    Constructs the type from a compatible Residual type. Read more
    ","FromResidual>","hotshot_query_service::QueryResult"],["
    source§

    impl<T, E, F> FromResidual<Result<Infallible, E>> for Result<T, F>where\n F: From<E>,

    source§

    fn from_residual(residual: Result<Infallible, E>) -> Result<T, F>

    🔬This is a nightly-only experimental API. (try_trait_v2)
    Constructs the type from a compatible Residual type. Read more
    ","FromResidual>","hotshot_query_service::QueryResult"],["
    source§

    impl<T, E> Try for Result<T, E>

    §

    type Output = T

    🔬This is a nightly-only experimental API. (try_trait_v2)
    The type of the value produced by ? when not short-circuiting.
    §

    type Residual = Result<Infallible, E>

    🔬This is a nightly-only experimental API. (try_trait_v2)
    The type of the value passed to FromResidual::from_residual\nas part of ? when short-circuiting. Read more
    source§

    fn from_output(output: <Result<T, E> as Try>::Output) -> Result<T, E>

    🔬This is a nightly-only experimental API. (try_trait_v2)
    Constructs the type from its Output type. Read more
    source§

    fn branch(\n self\n) -> ControlFlow<<Result<T, E> as Try>::Residual, <Result<T, E> as Try>::Output>

    🔬This is a nightly-only experimental API. (try_trait_v2)
    Used in ? to decide whether the operator should produce a value\n(because this returned ControlFlow::Continue)\nor propagate a value back to the caller\n(because this returned ControlFlow::Break). Read more
    ","Try","hotshot_query_service::QueryResult"],["
    1.0.0 · source§

    impl<T, E> StructuralEq for Result<T, E>

    ","StructuralEq","hotshot_query_service::QueryResult"],["
    1.0.0 · source§

    impl<T, E> Eq for Result<T, E>where\n T: Eq,\n E: Eq,

    ","Eq","hotshot_query_service::QueryResult"],["
    1.0.0 · source§

    impl<A, E, V> FromIterator<Result<A, E>> for Result<V, E>where\n V: FromIterator<A>,

    source§

    fn from_iter<I>(iter: I) -> Result<V, E>where\n I: IntoIterator<Item = Result<A, E>>,

    Takes each element in the Iterator: if it is an Err, no further\nelements are taken, and the Err is returned. Should no Err occur, a\ncontainer with the values of each Result is returned.

    \n

    Here is an example which increments every integer in a vector,\nchecking for overflow:

    \n\n
    let v = vec![1, 2];\nlet res: Result<Vec<u32>, &'static str> = v.iter().map(|x: &u32|\n    x.checked_add(1).ok_or("Overflow!")\n).collect();\nassert_eq!(res, Ok(vec![2, 3]));
    \n

    Here is another example that tries to subtract one from another list\nof integers, this time checking for underflow:

    \n\n
    let v = vec![1, 2, 0];\nlet res: Result<Vec<u32>, &'static str> = v.iter().map(|x: &u32|\n    x.checked_sub(1).ok_or("Underflow!")\n).collect();\nassert_eq!(res, Err("Underflow!"));
    \n

    Here is a variation on the previous example, showing that no\nfurther elements are taken from iter after the first Err.

    \n\n
    let v = vec![3, 2, 1, 10];\nlet mut shared = 0;\nlet res: Result<Vec<u32>, &'static str> = v.iter().map(|x: &u32| {\n    shared += x;\n    x.checked_sub(2).ok_or("Underflow!")\n}).collect();\nassert_eq!(res, Err("Underflow!"));\nassert_eq!(shared, 6);
    \n

    Since the third element caused an underflow, no further elements were taken,\nso the final value of shared is 6 (= 3 + 2 + 1), not 16.

    \n
    ","FromIterator>","hotshot_query_service::QueryResult"],["
    1.0.0 · source§

    impl<T, E> Ord for Result<T, E>where\n T: Ord,\n E: Ord,

    source§

    fn cmp(&self, other: &Result<T, E>) -> Ordering

    This method returns an Ordering between self and other. Read more
    1.21.0 · source§

    fn max(self, other: Self) -> Selfwhere\n Self: Sized,

    Compares and returns the maximum of two values. Read more
    1.21.0 · source§

    fn min(self, other: Self) -> Selfwhere\n Self: Sized,

    Compares and returns the minimum of two values. Read more
    1.50.0 · source§

    fn clamp(self, min: Self, max: Self) -> Selfwhere\n Self: Sized + PartialOrd,

    Restrict a value to a certain interval. Read more
    ","Ord","hotshot_query_service::QueryResult"],["
    1.0.0 · source§

    impl<T, E> PartialEq for Result<T, E>where\n T: PartialEq,\n E: PartialEq,

    source§

    fn eq(&self, other: &Result<T, E>) -> bool

    This method tests for self and other values to be equal, and is used\nby ==.
    1.0.0 · source§

    fn ne(&self, other: &Rhs) -> bool

    This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
    ","PartialEq","hotshot_query_service::QueryResult"],["
    1.0.0 · source§

    impl<T, E> Clone for Result<T, E>where\n T: Clone,\n E: Clone,

    source§

    fn clone(&self) -> Result<T, E>

    Returns a copy of the value. Read more
    source§

    fn clone_from(&mut self, source: &Result<T, E>)

    Performs copy-assignment from source. Read more
    ","Clone","hotshot_query_service::QueryResult"],["
    1.0.0 · source§

    impl<T, E> Hash for Result<T, E>where\n T: Hash,\n E: Hash,

    source§

    fn hash<__H>(&self, state: &mut __H)where\n __H: Hasher,

    Feeds this value into the given Hasher. Read more
    1.3.0 · source§

    fn hash_slice<H>(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,

    Feeds a slice of this type into the given Hasher. Read more
    ","Hash","hotshot_query_service::QueryResult"],["
    1.0.0 · source§

    impl<T, E> IntoIterator for Result<T, E>

    source§

    fn into_iter(self) -> IntoIter<T>

    Returns a consuming iterator over the possibly contained value.

    \n

    The iterator yields one value if the result is Result::Ok, otherwise none.

    \n
    Examples
    \n
    let x: Result<u32, &str> = Ok(5);\nlet v: Vec<u32> = x.into_iter().collect();\nassert_eq!(v, [5]);\n\nlet x: Result<u32, &str> = Err("nothing!");\nlet v: Vec<u32> = x.into_iter().collect();\nassert_eq!(v, []);
    \n
    §

    type Item = T

    The type of the elements being iterated over.
    §

    type IntoIter = IntoIter<T>

    Which kind of iterator are we turning this into?
    ","IntoIterator","hotshot_query_service::QueryResult"],["
    source§

    impl<T, E> Residual<T> for Result<Infallible, E>

    §

    type TryType = Result<T, E>

    🔬This is a nightly-only experimental API. (try_trait_v2_residual)
    The “return” type of this meta-function.
    ","Residual","hotshot_query_service::QueryResult"],["
    1.0.0 · source§

    impl<T, E> StructuralPartialEq for Result<T, E>

    ","StructuralPartialEq","hotshot_query_service::QueryResult"],["
    1.16.0 · source§

    impl<T, U, E> Sum<Result<U, E>> for Result<T, E>where\n T: Sum<U>,

    source§

    fn sum<I>(iter: I) -> Result<T, E>where\n I: Iterator<Item = Result<U, E>>,

    Takes each element in the Iterator: if it is an Err, no further\nelements are taken, and the Err is returned. Should no Err\noccur, the sum of all elements is returned.

    \n
    Examples
    \n

    This sums up every integer in a vector, rejecting the sum if a negative\nelement is encountered:

    \n\n
    let f = |&x: &i32| if x < 0 { Err("Negative element found") } else { Ok(x) };\nlet v = vec![1, 2];\nlet res: Result<i32, _> = v.iter().map(f).sum();\nassert_eq!(res, Ok(3));\nlet v = vec![1, -2];\nlet res: Result<i32, _> = v.iter().map(f).sum();\nassert_eq!(res, Err("Negative element found"));
    \n
    ","Sum>","hotshot_query_service::QueryResult"],["
    1.0.0 · source§

    impl<T, E> Debug for Result<T, E>where\n T: Debug,\n E: Debug,

    source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

    Formats the value using the given formatter. Read more
    ","Debug","hotshot_query_service::QueryResult"],["
    1.0.0 · source§

    impl<T, E> PartialOrd for Result<T, E>where\n T: PartialOrd,\n E: PartialOrd,

    source§

    fn partial_cmp(&self, other: &Result<T, E>) -> Option<Ordering>

    This method returns an ordering between self and other values if one exists. Read more
    1.0.0 · source§

    fn lt(&self, other: &Rhs) -> bool

    This method tests less than (for self and other) and is used by the < operator. Read more
    1.0.0 · source§

    fn le(&self, other: &Rhs) -> bool

    This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more
    1.0.0 · source§

    fn gt(&self, other: &Rhs) -> bool

    This method tests greater than (for self and other) and is used by the > operator. Read more
    1.0.0 · source§

    fn ge(&self, other: &Rhs) -> bool

    This method tests greater than or equal to (for self and other) and is used by the >=\noperator. Read more
    ","PartialOrd","hotshot_query_service::QueryResult"],["
    1.0.0 · source§

    impl<T, E> Copy for Result<T, E>where\n T: Copy,\n E: Copy,

    ","Copy","hotshot_query_service::QueryResult"],["
    1.16.0 · source§

    impl<T, U, E> Product<Result<U, E>> for Result<T, E>where\n T: Product<U>,

    source§

    fn product<I>(iter: I) -> Result<T, E>where\n I: Iterator<Item = Result<U, E>>,

    Takes each element in the Iterator: if it is an Err, no further\nelements are taken, and the Err is returned. Should no Err\noccur, the product of all elements is returned.

    \n
    Examples
    \n

    This multiplies each number in a vector of strings,\nif a string could not be parsed the operation returns Err:

    \n\n
    let nums = vec!["5", "10", "1", "2"];\nlet total: Result<usize, _> = nums.iter().map(|w| w.parse::<usize>()).product();\nassert_eq!(total, Ok(100));\nlet nums = vec!["5", "10", "one", "2"];\nlet total: Result<usize, _> = nums.iter().map(|w| w.parse::<usize>()).product();\nassert!(total.is_err());
    \n
    ","Product>","hotshot_query_service::QueryResult"],["
    §

    impl<T, U, E> Product<Result<U, E>> for Result<T, E>where\n T: Product<U>,

    §

    fn product<'a, S>(stream: S) -> Pin<Box<dyn Future<Output = Result<T, E>> + 'a>>where\n S: Stream<Item = Result<U, E>> + 'a,

    Takes each element in the Stream: if it is an Err, no further\nelements are taken, and the Err is returned. Should no Err occur,\nthe product of all elements is returned.

    \n
    Examples
    \n

    This multiplies every integer in a vector, rejecting the product if a negative element is\nencountered:

    \n\n
    use async_std::prelude::*;\nuse async_std::stream;\n\nlet v = stream::from_iter(vec![1, 2, 4]);\nlet res: Result<i32, &'static str> = v.map(|x|\n    if x < 0 {\n        Err("Negative element found")\n    } else {\n        Ok(x)\n    }).product().await;\nassert_eq!(res, Ok(8));
    \n
    ","Product>","hotshot_query_service::QueryResult"],["
    §

    impl<T, U, E> Sum<Result<U, E>> for Result<T, E>where\n T: Sum<U>,

    §

    fn sum<'a, S>(stream: S) -> Pin<Box<dyn Future<Output = Result<T, E>> + 'a>>where\n S: Stream<Item = Result<U, E>> + 'a,

    Takes each element in the Stream: if it is an Err, no further\nelements are taken, and the Err is returned. Should no Err occur,\nthe sum of all elements is returned.

    \n
    Examples
    \n

    This sums up every integer in a vector, rejecting the sum if a negative\nelement is encountered:

    \n\n
    use async_std::prelude::*;\nuse async_std::stream;\n\nlet v = stream::from_iter(vec![1, 2]);\nlet res: Result<i32, &'static str> = v.map(|x|\n    if x < 0 {\n        Err("Negative element found")\n    } else {\n        Ok(x)\n    }).sum().await;\nassert_eq!(res, Ok(3));
    \n
    ","Sum>","hotshot_query_service::QueryResult"],["
    §

    impl<T, E, V> FromStream<Result<T, E>> for Result<V, E>where\n T: Send,\n E: Send,\n V: FromStream<T>,

    §

    fn from_stream<'a, S>(\n stream: S\n) -> Pin<Box<dyn Future<Output = Result<V, E>> + Send + 'a>>where\n S: IntoStream<Item = Result<T, E>> + 'a,\n <S as IntoStream>::IntoStream: Send,

    Takes each element in the stream: if it is an Err, no further\nelements are taken, and the Err is returned. Should no Err\noccur, a container with the values of each Result is returned.

    \n
    Examples
    \n
    use async_std::prelude::*;\nuse async_std::stream;\n\nlet v = stream::from_iter(vec![1, 2]);\nlet res: Result<Vec<u32>, &'static str> = v.map(|x: u32|\n    x.checked_add(1).ok_or("Overflow!")\n).collect().await;\nassert_eq!(res, Ok(vec![2, 3]));
    \n
    ","FromStream>","hotshot_query_service::QueryResult"],["
    source§

    impl<T, E> Serialize for Result<T, E>where\n T: Serialize,\n E: Serialize,

    source§

    fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,

    Serialize this value into the given Serde serializer. Read more
    ","Serialize","hotshot_query_service::QueryResult"],["
    source§

    impl<'de, T, E> Deserialize<'de> for Result<T, E>where\n T: Deserialize<'de>,\n E: Deserialize<'de>,

    source§

    fn deserialize<D>(\n deserializer: D\n) -> Result<Result<T, E>, <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,

    Deserialize this value from the given Serde deserializer. Read more
    ","Deserialize<'de>","hotshot_query_service::QueryResult"],["
    §

    impl<T, E> ResultExt<T, E> for Result<T, E>

    §

    fn context<C, E2>(self, context: C) -> Result<T, E2>where\n C: IntoError<E2, Source = E>,\n E2: Error + ErrorCompat,

    Extend a Result’s error with additional context-sensitive information. Read more
    §

    fn with_context<F, C, E2>(self, context: F) -> Result<T, E2>where\n F: FnOnce(&mut E) -> C,\n C: IntoError<E2, Source = E>,\n E2: Error + ErrorCompat,

    Extend a Result’s error with lazily-generated context-sensitive information. Read more
    §

    fn whatever_context<S, E2>(self, context: S) -> Result<T, E2>where\n S: Into<String>,\n E2: FromString,\n E: Into<<E2 as FromString>::Source>,

    Extend a Result’s error with information from a string. Read more
    §

    fn with_whatever_context<F, S, E2>(self, context: F) -> Result<T, E2>where\n F: FnOnce(&mut E) -> S,\n S: Into<String>,\n E2: FromString,\n E: Into<<E2 as FromString>::Source>,

    Extend a Result’s error with information from a\nlazily-generated string. Read more
    ","ResultExt","hotshot_query_service::QueryResult"],["
    §

    impl<T, E> Status<T, E> for Result<T, E>where\n E: Error + Send + Sync + 'static,

    §

    fn status<S>(self, status: S) -> Result<T, Error>where\n S: TryInto<StatusCode>,\n <S as TryInto<StatusCode>>::Error: Debug,

    Wrap the error value with an additional status code.

    \n
    Panics
    \n

    Panics if Status is not a valid StatusCode.

    \n
    §

    fn with_status<S, F>(self, f: F) -> Result<T, Error>where\n S: TryInto<StatusCode>,\n <S as TryInto<StatusCode>>::Error: Debug,\n F: FnOnce() -> S,

    Wrap the error value with an additional status code that is evaluated\nlazily only once an error does occur.

    \n
    Panics
    \n

    Panics if Status is not a valid StatusCode.

    \n
    ","Status","hotshot_query_service::QueryResult"],["
    source§

    impl<T, E> Context<T, E> for Result<T, E>where\n E: StdError + Send + Sync + 'static,

    source§

    fn context<C>(self, context: C) -> Result<T, Error>where\n C: Display + Send + Sync + 'static,

    Wrap the error value with additional context.
    source§

    fn with_context<C, F>(self, context: F) -> Result<T, Error>where\n C: Display + Send + Sync + 'static,\n F: FnOnce() -> C,

    Wrap the error value with additional context that is evaluated lazily\nonly once an error does occur.
    ","Context","hotshot_query_service::QueryResult"],["
    source§

    impl<'de, T, TAs, E, EAs> DeserializeAs<'de, Result<T, E>> for Result<TAs, EAs>where\n TAs: DeserializeAs<'de, T>,\n EAs: DeserializeAs<'de, E>,

    source§

    fn deserialize_as<D>(\n deserializer: D\n) -> Result<Result<T, E>, <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,

    Deserialize this value from the given Serde deserializer.
    ","DeserializeAs<'de, Result>","hotshot_query_service::QueryResult"],["
    source§

    impl<T, TAs, E, EAs> SerializeAs<Result<T, E>> for Result<TAs, EAs>where\n TAs: SerializeAs<T>,\n EAs: SerializeAs<E>,

    source§

    fn serialize_as<S>(\n source: &Result<T, E>,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,

    Serialize this value into the given Serde serializer.
    ","SerializeAs>","hotshot_query_service::QueryResult"],["
    §

    impl<T, E> NonBlockingResult for Result<T, E>where\n E: NonBlockingError,

    §

    type Result = Result<Option<T>, E>

    Type of the converted result: Result<Option<T>, E>
    §

    fn no_block(self) -> <Result<T, E> as NonBlockingResult>::Result

    Perform the non-block conversion.
    ","NonBlockingResult","hotshot_query_service::QueryResult"],["
    §

    impl<'a, A, B> Arbitrary<'a> for Result<A, B>where\n A: Arbitrary<'a>,\n B: Arbitrary<'a>,

    §

    fn arbitrary(u: &mut Unstructured<'a>) -> Result<Result<A, B>, Error>

    Generate an arbitrary value of Self from the given unstructured data. Read more
    §

    fn size_hint(depth: usize) -> (usize, Option<usize>)

    Get a size hint for how many bytes out of an Unstructured this type\nneeds to construct itself. Read more
    §

    fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>

    Generate an arbitrary value of Self from the entirety of the given\nunstructured data. Read more
    ","Arbitrary<'a>","hotshot_query_service::QueryResult"],["
    §

    impl<T, E> TapFallible for Result<T, E>

    §

    type Ok = T

    The interior type used to indicate a successful construction.
    §

    type Err = E

    The interior type used to indicate a failed construction.
    §

    fn tap_ok(self, func: impl FnOnce(&T)) -> Result<T, E>

    Immutably accesses an interior success value. Read more
    §

    fn tap_ok_mut(self, func: impl FnOnce(&mut T)) -> Result<T, E>

    Mutably accesses an interior success value. Read more
    §

    fn tap_err(self, func: impl FnOnce(&E)) -> Result<T, E>

    Immutably accesses an interior failure value. Read more
    §

    fn tap_err_mut(self, func: impl FnOnce(&mut E)) -> Result<T, E>

    Mutably accesses an interior failure value. Read more
    §

    fn tap_ok_dbg(self, func: impl FnOnce(&Self::Ok)) -> Self

    Calls .tap_ok() only in debug builds, and is erased in release builds.
    §

    fn tap_ok_mut_dbg(self, func: impl FnOnce(&mut Self::Ok)) -> Self

    Calls .tap_ok_mut() only in debug builds, and is erased in release\nbuilds.
    §

    fn tap_err_dbg(self, func: impl FnOnce(&Self::Err)) -> Self

    Calls .tap_err() only in debug builds, and is erased in release\nbuilds.
    §

    fn tap_err_mut_dbg(self, func: impl FnOnce(&mut Self::Err)) -> Self

    Calls .tap_err_mut() only in debug builds, and is erased in release\nbuilds.
    ","TapFallible","hotshot_query_service::QueryResult"],["
    §

    impl<C, T, E> FromParallelIterator<Result<T, E>> for Result<C, E>where\n C: FromParallelIterator<T>,\n T: Send,\n E: Send,

    Collect an arbitrary Result-wrapped collection.

    \n

    If any item is Err, then all previous Ok items collected are\ndiscarded, and it returns that error. If there are multiple errors, the\none returned is not deterministic.

    \n
    §

    fn from_par_iter<I>(par_iter: I) -> Result<C, E>where\n I: IntoParallelIterator<Item = Result<T, E>>,

    Creates an instance of the collection from the parallel iterator par_iter. Read more
    ","FromParallelIterator>","hotshot_query_service::QueryResult"],["
    §

    impl<T, E> IntoParallelIterator for Result<T, E>where\n T: Send,

    §

    type Item = T

    The type of item that the parallel iterator will produce.
    §

    type Iter = IntoIter<T>

    The parallel iterator type that will be created.
    §

    fn into_par_iter(self) -> <Result<T, E> as IntoParallelIterator>::Iter

    Converts self into a parallel iterator. Read more
    ","IntoParallelIterator","hotshot_query_service::QueryResult"],["
    source§

    impl<T, E> InstrumentResult<T> for Result<T, E>where\n E: InstrumentError,

    §

    type Instrumented = <E as InstrumentError>::Instrumented

    The type of the wrapped error after instrumentation
    source§

    fn in_current_span(\n self\n) -> Result<T, <Result<T, E> as InstrumentResult<T>>::Instrumented>

    Instrument an Error by bundling it with a SpanTrace Read more
    ","InstrumentResult","hotshot_query_service::QueryResult"],["
    source§

    impl<T, E> Section for Result<T, E>where\n E: Into<Report>,

    §

    type Return = Result<T, Report>

    The return type of each method after adding context
    source§

    fn note<D>(self, note: D) -> <Result<T, E> as Section>::Returnwhere\n D: Display + Send + Sync + 'static,

    Add a Note to an error report, to be displayed after the chain of errors. Read more
    source§

    fn with_note<D, F>(self, note: F) -> <Result<T, E> as Section>::Returnwhere\n D: Display + Send + Sync + 'static,\n F: FnOnce() -> D,

    Add a Note to an error report, to be displayed after the chain of errors. The closure to\ncreate the Note is lazily evaluated only in the case of an error. Read more
    source§

    fn warning<D>(self, warning: D) -> <Result<T, E> as Section>::Returnwhere\n D: Display + Send + Sync + 'static,

    Add a Warning to an error report, to be displayed after the chain of errors.
    source§

    fn with_warning<D, F>(self, warning: F) -> <Result<T, E> as Section>::Returnwhere\n D: Display + Send + Sync + 'static,\n F: FnOnce() -> D,

    Add a Warning to an error report, to be displayed after the chain of errors. The closure to\ncreate the Warning is lazily evaluated only in the case of an error.
    source§

    fn suggestion<D>(self, suggestion: D) -> <Result<T, E> as Section>::Returnwhere\n D: Display + Send + Sync + 'static,

    Add a Suggestion to an error report, to be displayed after the chain of errors.
    source§

    fn with_suggestion<D, F>(\n self,\n suggestion: F\n) -> <Result<T, E> as Section>::Returnwhere\n D: Display + Send + Sync + 'static,\n F: FnOnce() -> D,

    Add a Suggestion to an error report, to be displayed after the chain of errors. The closure\nto create the Suggestion is lazily evaluated only in the case of an error.
    source§

    fn with_section<D, F>(self, section: F) -> <Result<T, E> as Section>::Returnwhere\n D: Display + Send + Sync + 'static,\n F: FnOnce() -> D,

    Add a Section to an error report, to be displayed after the chain of errors. The closure to\ncreate the Section is lazily evaluated only in the case of an error. Read more
    source§

    fn section<D>(self, section: D) -> <Result<T, E> as Section>::Returnwhere\n D: Display + Send + Sync + 'static,

    Add a section to an error report, to be displayed after the chain of errors. Read more
    source§

    fn error<E2>(self, error: E2) -> <Result<T, E> as Section>::Returnwhere\n E2: Error + Send + Sync + 'static,

    Add an error section to an error report, to be displayed after the primary error message\nsection. Read more
    source§

    fn with_error<E2, F>(self, error: F) -> <Result<T, E> as Section>::Returnwhere\n F: FnOnce() -> E2,\n E2: Error + Send + Sync + 'static,

    Add an error section to an error report, to be displayed after the primary error message\nsection. The closure to create the Section is lazily evaluated only in the case of an error. Read more
    ","Section","hotshot_query_service::QueryResult"],["
    source§

    impl<T, E> WrapErr<T, E> for Result<T, E>where\n E: StdError + Send + Sync + 'static,

    source§

    fn wrap_err<D>(self, msg: D) -> Result<T, Report>where\n D: Display + Send + Sync + 'static,

    Wrap the error value with a new adhoc error
    source§

    fn wrap_err_with<D, F>(self, msg: F) -> Result<T, Report>where\n D: Display + Send + Sync + 'static,\n F: FnOnce() -> D,

    Wrap the error value with a new adhoc error that is evaluated lazily\nonly once an error does occur.
    source§

    fn context<D>(self, msg: D) -> Result<T, Report>where\n D: Display + Send + Sync + 'static,

    Compatibility re-export of wrap_err for interop with anyhow
    source§

    fn with_context<D, F>(self, msg: F) -> Result<T, Report>where\n D: Display + Send + Sync + 'static,\n F: FnOnce() -> D,

    Compatibility re-export of wrap_err_with for interop with anyhow
    ","WrapErr","hotshot_query_service::QueryResult"],["
    §

    impl<E> ResultVoidErrExt<E> for Result<Void, E>

    §

    fn void_unwrap_err(self) -> E

    Get the error out of an always-err Result.

    \n

    Never panics, since it is statically known to be Err.

    \n
    ","ResultVoidErrExt","hotshot_query_service::QueryResult"],["
    §

    impl<R, A> RestrictedMath for Result<R, A>where\n R: RestrictedMath,\n A: 'static + Copy,

    §

    type Arg = <R as RestrictedMath>::Arg

    Argument for the math operations
    §

    type Value = <R as RestrictedMath>::Value

    Return value, generally the same as Arg
    §

    fn checked_add(\n &self,\n arg: <Result<R, A> as RestrictedMath>::Arg\n) -> Result<Restrict<<Result<R, A> as RestrictedMath>::Value>, <Result<R, A> as RestrictedMath>::Arg>

    Checked addition, see usize::checked_add
    §

    fn checked_sub(\n &self,\n arg: <Result<R, A> as RestrictedMath>::Arg\n) -> Result<Restrict<<Result<R, A> as RestrictedMath>::Value>, <Result<R, A> as RestrictedMath>::Arg>

    Checked subtraction, see usize::checked_sub
    §

    fn checked_mul(\n &self,\n arg: <Result<R, A> as RestrictedMath>::Arg\n) -> Result<Restrict<<Result<R, A> as RestrictedMath>::Value>, <Result<R, A> as RestrictedMath>::Arg>

    Checked multiplication, see usize::checked_mul
    ","RestrictedMath","hotshot_query_service::QueryResult"],["
    §

    impl<T, E> ResultExt<T, E> for Result<T, E>

    §

    fn context<X>(self, x: X) -> Result<T, Context<X, E>>

    The method is use to add context information to current operation Read more
    ","ResultExt","hotshot_query_service::QueryResult"],["
    §

    impl<R, A> RestrictedMath for Result<R, A>where\n R: RestrictedMath,\n A: 'static + Copy,

    §

    type Arg = <R as RestrictedMath>::Arg

    Argument for the math operations
    §

    type Value = <R as RestrictedMath>::Value

    Return value, generally the same as Arg
    §

    fn checked_add(\n &self,\n arg: <Result<R, A> as RestrictedMath>::Arg\n) -> Result<Restrict<<Result<R, A> as RestrictedMath>::Value>, <Result<R, A> as RestrictedMath>::Arg>

    Checked addition, see usize::checked_add
    §

    fn checked_sub(\n &self,\n arg: <Result<R, A> as RestrictedMath>::Arg\n) -> Result<Restrict<<Result<R, A> as RestrictedMath>::Value>, <Result<R, A> as RestrictedMath>::Arg>

    Checked subtraction, see usize::checked_sub
    §

    fn checked_mul(\n &self,\n arg: <Result<R, A> as RestrictedMath>::Arg\n) -> Result<Restrict<<Result<R, A> as RestrictedMath>::Value>, <Result<R, A> as RestrictedMath>::Arg>

    Checked multiplication, see usize::checked_mul
    ","RestrictedMath","hotshot_query_service::QueryResult"],["
    source§

    impl<T, E> UnwrapThrowExt<T> for Result<T, E>where\n E: Debug,

    source§

    fn expect_throw(self, message: &str) -> T

    Unwrap this container’s T value, or throw an error to JS with the\ngiven message if the T value is unavailable (e.g. an Option<T> is\nNone).
    source§

    fn unwrap_throw(self) -> T

    Unwrap this Option or Result, but instead of panicking on failure,\nthrow an exception to JavaScript.
    ","UnwrapThrowExt","hotshot_query_service::QueryResult"],["
    source§

    impl<T, E> ReturnWasmAbi for Result<T, E>where\n T: IntoWasmAbi,\n E: Into<JsValue>,\n <T as IntoWasmAbi>::Abi: WasmAbi<Prim3 = (), Prim4 = ()>,

    §

    type Abi = Result<<T as IntoWasmAbi>::Abi, u32>

    Same as IntoWasmAbi::Abi
    source§

    fn return_abi(self) -> <Result<T, E> as ReturnWasmAbi>::Abi

    Same as IntoWasmAbi::into_abi, except that it may throw and never\nreturn in the case of Err.
    ","ReturnWasmAbi","hotshot_query_service::QueryResult"],["
    §

    impl<T, E> NonBlockingResult for Result<T, E>where\n E: NonBlockingError,

    §

    type Result = Result<Option<T>, E>

    Type of the converted result: Result<Option<T>, E>
    §

    fn no_block(self) -> <Result<T, E> as NonBlockingResult>::Result

    Perform the non-block conversion.
    ","NonBlockingResult","hotshot_query_service::QueryResult"],["
    §

    impl<T, E> WrapMigrationError<T, E> for Result<T, E>where\n E: Error + Send + Sync + 'static,

    §

    fn migration_err(\n self,\n msg: &str,\n applied_migrations: Option<&[Migration]>\n) -> Result<T, Error>

    ","WrapMigrationError","hotshot_query_service::QueryResult"]] +"hotshot_query_service":[["
    source§

    impl<T, E> Result<T, E>

    1.0.0 (const: 1.48.0) · source

    pub const fn is_ok(&self) -> bool

    Returns true if the result is Ok.

    \n
    Examples
    \n
    let x: Result<i32, &str> = Ok(-3);\nassert_eq!(x.is_ok(), true);\n\nlet x: Result<i32, &str> = Err("Some error message");\nassert_eq!(x.is_ok(), false);
    \n
    1.70.0 · source

    pub fn is_ok_and(self, f: impl FnOnce(T) -> bool) -> bool

    Returns true if the result is Ok and the value inside of it matches a predicate.

    \n
    Examples
    \n
    let x: Result<u32, &str> = Ok(2);\nassert_eq!(x.is_ok_and(|x| x > 1), true);\n\nlet x: Result<u32, &str> = Ok(0);\nassert_eq!(x.is_ok_and(|x| x > 1), false);\n\nlet x: Result<u32, &str> = Err("hey");\nassert_eq!(x.is_ok_and(|x| x > 1), false);
    \n
    1.0.0 (const: 1.48.0) · source

    pub const fn is_err(&self) -> bool

    Returns true if the result is Err.

    \n
    Examples
    \n
    let x: Result<i32, &str> = Ok(-3);\nassert_eq!(x.is_err(), false);\n\nlet x: Result<i32, &str> = Err("Some error message");\nassert_eq!(x.is_err(), true);
    \n
    1.70.0 · source

    pub fn is_err_and(self, f: impl FnOnce(E) -> bool) -> bool

    Returns true if the result is Err and the value inside of it matches a predicate.

    \n
    Examples
    \n
    use std::io::{Error, ErrorKind};\n\nlet x: Result<u32, Error> = Err(Error::new(ErrorKind::NotFound, "!"));\nassert_eq!(x.is_err_and(|x| x.kind() == ErrorKind::NotFound), true);\n\nlet x: Result<u32, Error> = Err(Error::new(ErrorKind::PermissionDenied, "!"));\nassert_eq!(x.is_err_and(|x| x.kind() == ErrorKind::NotFound), false);\n\nlet x: Result<u32, Error> = Ok(123);\nassert_eq!(x.is_err_and(|x| x.kind() == ErrorKind::NotFound), false);
    \n
    1.0.0 · source

    pub fn ok(self) -> Option<T>

    Converts from Result<T, E> to Option<T>.

    \n

    Converts self into an Option<T>, consuming self,\nand discarding the error, if any.

    \n
    Examples
    \n
    let x: Result<u32, &str> = Ok(2);\nassert_eq!(x.ok(), Some(2));\n\nlet x: Result<u32, &str> = Err("Nothing here");\nassert_eq!(x.ok(), None);
    \n
    1.0.0 · source

    pub fn err(self) -> Option<E>

    Converts from Result<T, E> to Option<E>.

    \n

    Converts self into an Option<E>, consuming self,\nand discarding the success value, if any.

    \n
    Examples
    \n
    let x: Result<u32, &str> = Ok(2);\nassert_eq!(x.err(), None);\n\nlet x: Result<u32, &str> = Err("Nothing here");\nassert_eq!(x.err(), Some("Nothing here"));
    \n
    1.0.0 (const: 1.48.0) · source

    pub const fn as_ref(&self) -> Result<&T, &E>

    Converts from &Result<T, E> to Result<&T, &E>.

    \n

    Produces a new Result, containing a reference\ninto the original, leaving the original in place.

    \n
    Examples
    \n
    let x: Result<u32, &str> = Ok(2);\nassert_eq!(x.as_ref(), Ok(&2));\n\nlet x: Result<u32, &str> = Err("Error");\nassert_eq!(x.as_ref(), Err(&"Error"));
    \n
    1.0.0 (const: unstable) · source

    pub fn as_mut(&mut self) -> Result<&mut T, &mut E>

    Converts from &mut Result<T, E> to Result<&mut T, &mut E>.

    \n
    Examples
    \n
    fn mutate(r: &mut Result<i32, i32>) {\n    match r.as_mut() {\n        Ok(v) => *v = 42,\n        Err(e) => *e = 0,\n    }\n}\n\nlet mut x: Result<i32, i32> = Ok(2);\nmutate(&mut x);\nassert_eq!(x.unwrap(), 42);\n\nlet mut x: Result<i32, i32> = Err(13);\nmutate(&mut x);\nassert_eq!(x.unwrap_err(), 0);
    \n
    1.0.0 · source

    pub fn map<U, F>(self, op: F) -> Result<U, E>where\n F: FnOnce(T) -> U,

    Maps a Result<T, E> to Result<U, E> by applying a function to a\ncontained Ok value, leaving an Err value untouched.

    \n

    This function can be used to compose the results of two functions.

    \n
    Examples
    \n

    Print the numbers on each line of a string multiplied by two.

    \n\n
    let line = "1\\n2\\n3\\n4\\n";\n\nfor num in line.lines() {\n    match num.parse::<i32>().map(|i| i * 2) {\n        Ok(n) => println!("{n}"),\n        Err(..) => {}\n    }\n}
    \n
    1.41.0 · source

    pub fn map_or<U, F>(self, default: U, f: F) -> Uwhere\n F: FnOnce(T) -> U,

    Returns the provided default (if Err), or\napplies a function to the contained value (if Ok).

    \n

    Arguments passed to map_or are eagerly evaluated; if you are passing\nthe result of a function call, it is recommended to use map_or_else,\nwhich is lazily evaluated.

    \n
    Examples
    \n
    let x: Result<_, &str> = Ok("foo");\nassert_eq!(x.map_or(42, |v| v.len()), 3);\n\nlet x: Result<&str, _> = Err("bar");\nassert_eq!(x.map_or(42, |v| v.len()), 42);
    \n
    1.41.0 · source

    pub fn map_or_else<U, D, F>(self, default: D, f: F) -> Uwhere\n D: FnOnce(E) -> U,\n F: FnOnce(T) -> U,

    Maps a Result<T, E> to U by applying fallback function default to\na contained Err value, or function f to a contained Ok value.

    \n

    This function can be used to unpack a successful result\nwhile handling an error.

    \n
    Examples
    \n
    let k = 21;\n\nlet x : Result<_, &str> = Ok("foo");\nassert_eq!(x.map_or_else(|e| k * 2, |v| v.len()), 3);\n\nlet x : Result<&str, _> = Err("bar");\nassert_eq!(x.map_or_else(|e| k * 2, |v| v.len()), 42);
    \n
    1.0.0 · source

    pub fn map_err<F, O>(self, op: O) -> Result<T, F>where\n O: FnOnce(E) -> F,

    Maps a Result<T, E> to Result<T, F> by applying a function to a\ncontained Err value, leaving an Ok value untouched.

    \n

    This function can be used to pass through a successful result while handling\nan error.

    \n
    Examples
    \n
    fn stringify(x: u32) -> String { format!("error code: {x}") }\n\nlet x: Result<u32, u32> = Ok(2);\nassert_eq!(x.map_err(stringify), Ok(2));\n\nlet x: Result<u32, u32> = Err(13);\nassert_eq!(x.map_err(stringify), Err("error code: 13".to_string()));
    \n
    source

    pub fn inspect<F>(self, f: F) -> Result<T, E>where\n F: FnOnce(&T),

    🔬This is a nightly-only experimental API. (result_option_inspect)

    Calls the provided closure with a reference to the contained value (if Ok).

    \n
    Examples
    \n
    #![feature(result_option_inspect)]\n\nlet x: u8 = "4"\n    .parse::<u8>()\n    .inspect(|x| println!("original: {x}"))\n    .map(|x| x.pow(3))\n    .expect("failed to parse number");
    \n
    source

    pub fn inspect_err<F>(self, f: F) -> Result<T, E>where\n F: FnOnce(&E),

    🔬This is a nightly-only experimental API. (result_option_inspect)

    Calls the provided closure with a reference to the contained error (if Err).

    \n
    Examples
    \n
    #![feature(result_option_inspect)]\n\nuse std::{fs, io};\n\nfn read() -> io::Result<String> {\n    fs::read_to_string("address.txt")\n        .inspect_err(|e| eprintln!("failed to read file: {e}"))\n}
    \n
    1.47.0 · source

    pub fn as_deref(&self) -> Result<&<T as Deref>::Target, &E>where\n T: Deref,

    Converts from Result<T, E> (or &Result<T, E>) to Result<&<T as Deref>::Target, &E>.

    \n

    Coerces the Ok variant of the original Result via Deref\nand returns the new Result.

    \n
    Examples
    \n
    let x: Result<String, u32> = Ok("hello".to_string());\nlet y: Result<&str, &u32> = Ok("hello");\nassert_eq!(x.as_deref(), y);\n\nlet x: Result<String, u32> = Err(42);\nlet y: Result<&str, &u32> = Err(&42);\nassert_eq!(x.as_deref(), y);
    \n
    1.47.0 · source

    pub fn as_deref_mut(&mut self) -> Result<&mut <T as Deref>::Target, &mut E>where\n T: DerefMut,

    Converts from Result<T, E> (or &mut Result<T, E>) to Result<&mut <T as DerefMut>::Target, &mut E>.

    \n

    Coerces the Ok variant of the original Result via DerefMut\nand returns the new Result.

    \n
    Examples
    \n
    let mut s = "HELLO".to_string();\nlet mut x: Result<String, u32> = Ok("hello".to_string());\nlet y: Result<&mut str, &mut u32> = Ok(&mut s);\nassert_eq!(x.as_deref_mut().map(|x| { x.make_ascii_uppercase(); x }), y);\n\nlet mut i = 42;\nlet mut x: Result<String, u32> = Err(42);\nlet y: Result<&mut str, &mut u32> = Err(&mut i);\nassert_eq!(x.as_deref_mut().map(|x| { x.make_ascii_uppercase(); x }), y);
    \n
    1.0.0 · source

    pub fn iter(&self) -> Iter<'_, T>

    Returns an iterator over the possibly contained value.

    \n

    The iterator yields one value if the result is Result::Ok, otherwise none.

    \n
    Examples
    \n
    let x: Result<u32, &str> = Ok(7);\nassert_eq!(x.iter().next(), Some(&7));\n\nlet x: Result<u32, &str> = Err("nothing!");\nassert_eq!(x.iter().next(), None);
    \n
    1.0.0 · source

    pub fn iter_mut(&mut self) -> IterMut<'_, T>

    Returns a mutable iterator over the possibly contained value.

    \n

    The iterator yields one value if the result is Result::Ok, otherwise none.

    \n
    Examples
    \n
    let mut x: Result<u32, &str> = Ok(7);\nmatch x.iter_mut().next() {\n    Some(v) => *v = 40,\n    None => {},\n}\nassert_eq!(x, Ok(40));\n\nlet mut x: Result<u32, &str> = Err("nothing!");\nassert_eq!(x.iter_mut().next(), None);
    \n
    1.4.0 · source

    pub fn expect(self, msg: &str) -> Twhere\n E: Debug,

    Returns the contained Ok value, consuming the self value.

    \n

    Because this function may panic, its use is generally discouraged.\nInstead, prefer to use pattern matching and handle the Err\ncase explicitly, or call unwrap_or, unwrap_or_else, or\nunwrap_or_default.

    \n
    Panics
    \n

    Panics if the value is an Err, with a panic message including the\npassed message, and the content of the Err.

    \n
    Examples
    \n
    let x: Result<u32, &str> = Err("emergency failure");\nx.expect("Testing expect"); // panics with `Testing expect: emergency failure`
    \n
    Recommended Message Style
    \n

    We recommend that expect messages are used to describe the reason you\nexpect the Result should be Ok.

    \n\n
    let path = std::env::var("IMPORTANT_PATH")\n    .expect("env variable `IMPORTANT_PATH` should be set by `wrapper_script.sh`");
    \n

    Hint: If you’re having trouble remembering how to phrase expect\nerror messages remember to focus on the word “should” as in “env\nvariable should be set by blah” or “the given binary should be available\nand executable by the current user”.

    \n

    For more detail on expect message styles and the reasoning behind our recommendation please\nrefer to the section on “Common Message\nStyles” in the\nstd::error module docs.

    \n
    1.0.0 · source

    pub fn unwrap(self) -> Twhere\n E: Debug,

    Returns the contained Ok value, consuming the self value.

    \n

    Because this function may panic, its use is generally discouraged.\nInstead, prefer to use pattern matching and handle the Err\ncase explicitly, or call unwrap_or, unwrap_or_else, or\nunwrap_or_default.

    \n
    Panics
    \n

    Panics if the value is an Err, with a panic message provided by the\nErr’s value.

    \n
    Examples
    \n

    Basic usage:

    \n\n
    let x: Result<u32, &str> = Ok(2);\nassert_eq!(x.unwrap(), 2);
    \n\n
    let x: Result<u32, &str> = Err("emergency failure");\nx.unwrap(); // panics with `emergency failure`
    \n
    1.16.0 · source

    pub fn unwrap_or_default(self) -> Twhere\n T: Default,

    Returns the contained Ok value or a default

    \n

    Consumes the self argument then, if Ok, returns the contained\nvalue, otherwise if Err, returns the default value for that\ntype.

    \n
    Examples
    \n

    Converts a string to an integer, turning poorly-formed strings\ninto 0 (the default value for integers). parse converts\na string to any other type that implements FromStr, returning an\nErr on error.

    \n\n
    let good_year_from_input = "1909";\nlet bad_year_from_input = "190blarg";\nlet good_year = good_year_from_input.parse().unwrap_or_default();\nlet bad_year = bad_year_from_input.parse().unwrap_or_default();\n\nassert_eq!(1909, good_year);\nassert_eq!(0, bad_year);
    \n
    1.17.0 · source

    pub fn expect_err(self, msg: &str) -> Ewhere\n T: Debug,

    Returns the contained Err value, consuming the self value.

    \n
    Panics
    \n

    Panics if the value is an Ok, with a panic message including the\npassed message, and the content of the Ok.

    \n
    Examples
    \n
    let x: Result<u32, &str> = Ok(10);\nx.expect_err("Testing expect_err"); // panics with `Testing expect_err: 10`
    \n
    1.0.0 · source

    pub fn unwrap_err(self) -> Ewhere\n T: Debug,

    Returns the contained Err value, consuming the self value.

    \n
    Panics
    \n

    Panics if the value is an Ok, with a custom panic message provided\nby the Ok’s value.

    \n
    Examples
    \n
    let x: Result<u32, &str> = Ok(2);\nx.unwrap_err(); // panics with `2`
    \n\n
    let x: Result<u32, &str> = Err("emergency failure");\nassert_eq!(x.unwrap_err(), "emergency failure");
    \n
    source

    pub fn into_ok(self) -> Twhere\n E: Into<!>,

    🔬This is a nightly-only experimental API. (unwrap_infallible)

    Returns the contained Ok value, but never panics.

    \n

    Unlike unwrap, this method is known to never panic on the\nresult types it is implemented for. Therefore, it can be used\ninstead of unwrap as a maintainability safeguard that will fail\nto compile if the error type of the Result is later changed\nto an error that can actually occur.

    \n
    Examples
    \n
    \nfn only_good_news() -> Result<String, !> {\n    Ok("this is fine".into())\n}\n\nlet s: String = only_good_news().into_ok();\nprintln!("{s}");
    \n
    source

    pub fn into_err(self) -> Ewhere\n T: Into<!>,

    🔬This is a nightly-only experimental API. (unwrap_infallible)

    Returns the contained Err value, but never panics.

    \n

    Unlike unwrap_err, this method is known to never panic on the\nresult types it is implemented for. Therefore, it can be used\ninstead of unwrap_err as a maintainability safeguard that will fail\nto compile if the ok type of the Result is later changed\nto a type that can actually occur.

    \n
    Examples
    \n
    \nfn only_bad_news() -> Result<!, String> {\n    Err("Oops, it failed".into())\n}\n\nlet error: String = only_bad_news().into_err();\nprintln!("{error}");
    \n
    1.0.0 · source

    pub fn and<U>(self, res: Result<U, E>) -> Result<U, E>

    Returns res if the result is Ok, otherwise returns the Err value of self.

    \n

    Arguments passed to and are eagerly evaluated; if you are passing the\nresult of a function call, it is recommended to use and_then, which is\nlazily evaluated.

    \n
    Examples
    \n
    let x: Result<u32, &str> = Ok(2);\nlet y: Result<&str, &str> = Err("late error");\nassert_eq!(x.and(y), Err("late error"));\n\nlet x: Result<u32, &str> = Err("early error");\nlet y: Result<&str, &str> = Ok("foo");\nassert_eq!(x.and(y), Err("early error"));\n\nlet x: Result<u32, &str> = Err("not a 2");\nlet y: Result<&str, &str> = Err("late error");\nassert_eq!(x.and(y), Err("not a 2"));\n\nlet x: Result<u32, &str> = Ok(2);\nlet y: Result<&str, &str> = Ok("different result type");\nassert_eq!(x.and(y), Ok("different result type"));
    \n
    1.0.0 · source

    pub fn and_then<U, F>(self, op: F) -> Result<U, E>where\n F: FnOnce(T) -> Result<U, E>,

    Calls op if the result is Ok, otherwise returns the Err value of self.

    \n

    This function can be used for control flow based on Result values.

    \n
    Examples
    \n
    fn sq_then_to_string(x: u32) -> Result<String, &'static str> {\n    x.checked_mul(x).map(|sq| sq.to_string()).ok_or("overflowed")\n}\n\nassert_eq!(Ok(2).and_then(sq_then_to_string), Ok(4.to_string()));\nassert_eq!(Ok(1_000_000).and_then(sq_then_to_string), Err("overflowed"));\nassert_eq!(Err("not a number").and_then(sq_then_to_string), Err("not a number"));
    \n

    Often used to chain fallible operations that may return Err.

    \n\n
    use std::{io::ErrorKind, path::Path};\n\n// Note: on Windows "/" maps to "C:\\"\nlet root_modified_time = Path::new("/").metadata().and_then(|md| md.modified());\nassert!(root_modified_time.is_ok());\n\nlet should_fail = Path::new("/bad/path").metadata().and_then(|md| md.modified());\nassert!(should_fail.is_err());\nassert_eq!(should_fail.unwrap_err().kind(), ErrorKind::NotFound);
    \n
    1.0.0 · source

    pub fn or<F>(self, res: Result<T, F>) -> Result<T, F>

    Returns res if the result is Err, otherwise returns the Ok value of self.

    \n

    Arguments passed to or are eagerly evaluated; if you are passing the\nresult of a function call, it is recommended to use or_else, which is\nlazily evaluated.

    \n
    Examples
    \n
    let x: Result<u32, &str> = Ok(2);\nlet y: Result<u32, &str> = Err("late error");\nassert_eq!(x.or(y), Ok(2));\n\nlet x: Result<u32, &str> = Err("early error");\nlet y: Result<u32, &str> = Ok(2);\nassert_eq!(x.or(y), Ok(2));\n\nlet x: Result<u32, &str> = Err("not a 2");\nlet y: Result<u32, &str> = Err("late error");\nassert_eq!(x.or(y), Err("late error"));\n\nlet x: Result<u32, &str> = Ok(2);\nlet y: Result<u32, &str> = Ok(100);\nassert_eq!(x.or(y), Ok(2));
    \n
    1.0.0 · source

    pub fn or_else<F, O>(self, op: O) -> Result<T, F>where\n O: FnOnce(E) -> Result<T, F>,

    Calls op if the result is Err, otherwise returns the Ok value of self.

    \n

    This function can be used for control flow based on result values.

    \n
    Examples
    \n
    fn sq(x: u32) -> Result<u32, u32> { Ok(x * x) }\nfn err(x: u32) -> Result<u32, u32> { Err(x) }\n\nassert_eq!(Ok(2).or_else(sq).or_else(sq), Ok(2));\nassert_eq!(Ok(2).or_else(err).or_else(sq), Ok(2));\nassert_eq!(Err(3).or_else(sq).or_else(err), Ok(9));\nassert_eq!(Err(3).or_else(err).or_else(err), Err(3));
    \n
    1.0.0 · source

    pub fn unwrap_or(self, default: T) -> T

    Returns the contained Ok value or a provided default.

    \n

    Arguments passed to unwrap_or are eagerly evaluated; if you are passing\nthe result of a function call, it is recommended to use unwrap_or_else,\nwhich is lazily evaluated.

    \n
    Examples
    \n
    let default = 2;\nlet x: Result<u32, &str> = Ok(9);\nassert_eq!(x.unwrap_or(default), 9);\n\nlet x: Result<u32, &str> = Err("error");\nassert_eq!(x.unwrap_or(default), default);
    \n
    1.0.0 · source

    pub fn unwrap_or_else<F>(self, op: F) -> Twhere\n F: FnOnce(E) -> T,

    Returns the contained Ok value or computes it from a closure.

    \n
    Examples
    \n
    fn count(x: &str) -> usize { x.len() }\n\nassert_eq!(Ok(2).unwrap_or_else(count), 2);\nassert_eq!(Err("foo").unwrap_or_else(count), 3);
    \n
    1.58.0 · source

    pub unsafe fn unwrap_unchecked(self) -> T

    Returns the contained Ok value, consuming the self value,\nwithout checking that the value is not an Err.

    \n
    Safety
    \n

    Calling this method on an Err is undefined behavior.

    \n
    Examples
    \n
    let x: Result<u32, &str> = Ok(2);\nassert_eq!(unsafe { x.unwrap_unchecked() }, 2);
    \n\n
    let x: Result<u32, &str> = Err("emergency failure");\nunsafe { x.unwrap_unchecked(); } // Undefined behavior!
    \n
    1.58.0 · source

    pub unsafe fn unwrap_err_unchecked(self) -> E

    Returns the contained Err value, consuming the self value,\nwithout checking that the value is not an Ok.

    \n
    Safety
    \n

    Calling this method on an Ok is undefined behavior.

    \n
    Examples
    \n
    let x: Result<u32, &str> = Ok(2);\nunsafe { x.unwrap_err_unchecked() }; // Undefined behavior!
    \n\n
    let x: Result<u32, &str> = Err("emergency failure");\nassert_eq!(unsafe { x.unwrap_err_unchecked() }, "emergency failure");
    \n
    ",0,"hotshot_query_service::QueryResult"],["
    source§

    impl<T, E> Result<&T, E>

    1.59.0 · source

    pub fn copied(self) -> Result<T, E>where\n T: Copy,

    Maps a Result<&T, E> to a Result<T, E> by copying the contents of the\nOk part.

    \n
    Examples
    \n
    let val = 12;\nlet x: Result<&i32, i32> = Ok(&val);\nassert_eq!(x, Ok(&12));\nlet copied = x.copied();\nassert_eq!(copied, Ok(12));
    \n
    1.59.0 · source

    pub fn cloned(self) -> Result<T, E>where\n T: Clone,

    Maps a Result<&T, E> to a Result<T, E> by cloning the contents of the\nOk part.

    \n
    Examples
    \n
    let val = 12;\nlet x: Result<&i32, i32> = Ok(&val);\nassert_eq!(x, Ok(&12));\nlet cloned = x.cloned();\nassert_eq!(cloned, Ok(12));
    \n
    ",0,"hotshot_query_service::QueryResult"],["
    source§

    impl<T, E> Result<&mut T, E>

    1.59.0 · source

    pub fn copied(self) -> Result<T, E>where\n T: Copy,

    Maps a Result<&mut T, E> to a Result<T, E> by copying the contents of the\nOk part.

    \n
    Examples
    \n
    let mut val = 12;\nlet x: Result<&mut i32, i32> = Ok(&mut val);\nassert_eq!(x, Ok(&mut 12));\nlet copied = x.copied();\nassert_eq!(copied, Ok(12));
    \n
    1.59.0 · source

    pub fn cloned(self) -> Result<T, E>where\n T: Clone,

    Maps a Result<&mut T, E> to a Result<T, E> by cloning the contents of the\nOk part.

    \n
    Examples
    \n
    let mut val = 12;\nlet x: Result<&mut i32, i32> = Ok(&mut val);\nassert_eq!(x, Ok(&mut 12));\nlet cloned = x.cloned();\nassert_eq!(cloned, Ok(12));
    \n
    ",0,"hotshot_query_service::QueryResult"],["
    source§

    impl<T, E> Result<Option<T>, E>

    1.33.0 (const: unstable) · source

    pub fn transpose(self) -> Option<Result<T, E>>

    Transposes a Result of an Option into an Option of a Result.

    \n

    Ok(None) will be mapped to None.\nOk(Some(_)) and Err(_) will be mapped to Some(Ok(_)) and Some(Err(_)).

    \n
    Examples
    \n
    #[derive(Debug, Eq, PartialEq)]\nstruct SomeErr;\n\nlet x: Result<Option<i32>, SomeErr> = Ok(Some(5));\nlet y: Option<Result<i32, SomeErr>> = Some(Ok(5));\nassert_eq!(x.transpose(), y);
    \n
    ",0,"hotshot_query_service::QueryResult"],["
    source§

    impl<T, E> Result<Result<T, E>, E>

    source

    pub fn flatten(self) -> Result<T, E>

    🔬This is a nightly-only experimental API. (result_flattening)

    Converts from Result<Result<T, E>, E> to Result<T, E>

    \n
    Examples
    \n
    #![feature(result_flattening)]\nlet x: Result<Result<&'static str, u32>, u32> = Ok(Ok("hello"));\nassert_eq!(Ok("hello"), x.flatten());\n\nlet x: Result<Result<&'static str, u32>, u32> = Ok(Err(6));\nassert_eq!(Err(6), x.flatten());\n\nlet x: Result<Result<&'static str, u32>, u32> = Err(6);\nassert_eq!(Err(6), x.flatten());
    \n

    Flattening only removes one level of nesting at a time:

    \n\n
    #![feature(result_flattening)]\nlet x: Result<Result<Result<&'static str, u32>, u32>, u32> = Ok(Ok(Ok("hello")));\nassert_eq!(Ok(Ok("hello")), x.flatten());\nassert_eq!(Ok("hello"), x.flatten().flatten());
    \n
    ",0,"hotshot_query_service::QueryResult"],["
    1.61.0 · source§

    impl<T, E> Termination for Result<T, E>where\n T: Termination,\n E: Debug,

    source§

    fn report(self) -> ExitCode

    Is called to get the representation of the value as status code.\nThis status code is returned to the operating system.
    ","Termination","hotshot_query_service::QueryResult"],["
    source§

    impl<T, E, F> FromResidual<Yeet<E>> for Result<T, F>where\n F: From<E>,

    source§

    fn from_residual(_: Yeet<E>) -> Result<T, F>

    🔬This is a nightly-only experimental API. (try_trait_v2)
    Constructs the type from a compatible Residual type. Read more
    ","FromResidual>","hotshot_query_service::QueryResult"],["
    source§

    impl<T, E, F> FromResidual<Result<Infallible, E>> for Result<T, F>where\n F: From<E>,

    source§

    fn from_residual(residual: Result<Infallible, E>) -> Result<T, F>

    🔬This is a nightly-only experimental API. (try_trait_v2)
    Constructs the type from a compatible Residual type. Read more
    ","FromResidual>","hotshot_query_service::QueryResult"],["
    source§

    impl<T, E> Try for Result<T, E>

    §

    type Output = T

    🔬This is a nightly-only experimental API. (try_trait_v2)
    The type of the value produced by ? when not short-circuiting.
    §

    type Residual = Result<Infallible, E>

    🔬This is a nightly-only experimental API. (try_trait_v2)
    The type of the value passed to FromResidual::from_residual\nas part of ? when short-circuiting. Read more
    source§

    fn from_output(output: <Result<T, E> as Try>::Output) -> Result<T, E>

    🔬This is a nightly-only experimental API. (try_trait_v2)
    Constructs the type from its Output type. Read more
    source§

    fn branch(\n self\n) -> ControlFlow<<Result<T, E> as Try>::Residual, <Result<T, E> as Try>::Output>

    🔬This is a nightly-only experimental API. (try_trait_v2)
    Used in ? to decide whether the operator should produce a value\n(because this returned ControlFlow::Continue)\nor propagate a value back to the caller\n(because this returned ControlFlow::Break). Read more
    ","Try","hotshot_query_service::QueryResult"],["
    1.0.0 · source§

    impl<T, E> StructuralEq for Result<T, E>

    ","StructuralEq","hotshot_query_service::QueryResult"],["
    1.0.0 · source§

    impl<T, E> Eq for Result<T, E>where\n T: Eq,\n E: Eq,

    ","Eq","hotshot_query_service::QueryResult"],["
    1.0.0 · source§

    impl<A, E, V> FromIterator<Result<A, E>> for Result<V, E>where\n V: FromIterator<A>,

    source§

    fn from_iter<I>(iter: I) -> Result<V, E>where\n I: IntoIterator<Item = Result<A, E>>,

    Takes each element in the Iterator: if it is an Err, no further\nelements are taken, and the Err is returned. Should no Err occur, a\ncontainer with the values of each Result is returned.

    \n

    Here is an example which increments every integer in a vector,\nchecking for overflow:

    \n\n
    let v = vec![1, 2];\nlet res: Result<Vec<u32>, &'static str> = v.iter().map(|x: &u32|\n    x.checked_add(1).ok_or("Overflow!")\n).collect();\nassert_eq!(res, Ok(vec![2, 3]));
    \n

    Here is another example that tries to subtract one from another list\nof integers, this time checking for underflow:

    \n\n
    let v = vec![1, 2, 0];\nlet res: Result<Vec<u32>, &'static str> = v.iter().map(|x: &u32|\n    x.checked_sub(1).ok_or("Underflow!")\n).collect();\nassert_eq!(res, Err("Underflow!"));
    \n

    Here is a variation on the previous example, showing that no\nfurther elements are taken from iter after the first Err.

    \n\n
    let v = vec![3, 2, 1, 10];\nlet mut shared = 0;\nlet res: Result<Vec<u32>, &'static str> = v.iter().map(|x: &u32| {\n    shared += x;\n    x.checked_sub(2).ok_or("Underflow!")\n}).collect();\nassert_eq!(res, Err("Underflow!"));\nassert_eq!(shared, 6);
    \n

    Since the third element caused an underflow, no further elements were taken,\nso the final value of shared is 6 (= 3 + 2 + 1), not 16.

    \n
    ","FromIterator>","hotshot_query_service::QueryResult"],["
    1.0.0 · source§

    impl<T, E> Ord for Result<T, E>where\n T: Ord,\n E: Ord,

    source§

    fn cmp(&self, other: &Result<T, E>) -> Ordering

    This method returns an Ordering between self and other. Read more
    1.21.0 · source§

    fn max(self, other: Self) -> Selfwhere\n Self: Sized,

    Compares and returns the maximum of two values. Read more
    1.21.0 · source§

    fn min(self, other: Self) -> Selfwhere\n Self: Sized,

    Compares and returns the minimum of two values. Read more
    1.50.0 · source§

    fn clamp(self, min: Self, max: Self) -> Selfwhere\n Self: Sized + PartialOrd,

    Restrict a value to a certain interval. Read more
    ","Ord","hotshot_query_service::QueryResult"],["
    1.0.0 · source§

    impl<T, E> PartialEq for Result<T, E>where\n T: PartialEq,\n E: PartialEq,

    source§

    fn eq(&self, other: &Result<T, E>) -> bool

    This method tests for self and other values to be equal, and is used\nby ==.
    1.0.0 · source§

    fn ne(&self, other: &Rhs) -> bool

    This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
    ","PartialEq","hotshot_query_service::QueryResult"],["
    1.0.0 · source§

    impl<T, E> Clone for Result<T, E>where\n T: Clone,\n E: Clone,

    source§

    fn clone(&self) -> Result<T, E>

    Returns a copy of the value. Read more
    source§

    fn clone_from(&mut self, source: &Result<T, E>)

    Performs copy-assignment from source. Read more
    ","Clone","hotshot_query_service::QueryResult"],["
    1.0.0 · source§

    impl<T, E> Hash for Result<T, E>where\n T: Hash,\n E: Hash,

    source§

    fn hash<__H>(&self, state: &mut __H)where\n __H: Hasher,

    Feeds this value into the given Hasher. Read more
    1.3.0 · source§

    fn hash_slice<H>(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,

    Feeds a slice of this type into the given Hasher. Read more
    ","Hash","hotshot_query_service::QueryResult"],["
    1.0.0 · source§

    impl<T, E> IntoIterator for Result<T, E>

    source§

    fn into_iter(self) -> IntoIter<T>

    Returns a consuming iterator over the possibly contained value.

    \n

    The iterator yields one value if the result is Result::Ok, otherwise none.

    \n
    Examples
    \n
    let x: Result<u32, &str> = Ok(5);\nlet v: Vec<u32> = x.into_iter().collect();\nassert_eq!(v, [5]);\n\nlet x: Result<u32, &str> = Err("nothing!");\nlet v: Vec<u32> = x.into_iter().collect();\nassert_eq!(v, []);
    \n
    §

    type Item = T

    The type of the elements being iterated over.
    §

    type IntoIter = IntoIter<T>

    Which kind of iterator are we turning this into?
    ","IntoIterator","hotshot_query_service::QueryResult"],["
    source§

    impl<T, E> Residual<T> for Result<Infallible, E>

    §

    type TryType = Result<T, E>

    🔬This is a nightly-only experimental API. (try_trait_v2_residual)
    The “return” type of this meta-function.
    ","Residual","hotshot_query_service::QueryResult"],["
    1.0.0 · source§

    impl<T, E> StructuralPartialEq for Result<T, E>

    ","StructuralPartialEq","hotshot_query_service::QueryResult"],["
    1.16.0 · source§

    impl<T, U, E> Sum<Result<U, E>> for Result<T, E>where\n T: Sum<U>,

    source§

    fn sum<I>(iter: I) -> Result<T, E>where\n I: Iterator<Item = Result<U, E>>,

    Takes each element in the Iterator: if it is an Err, no further\nelements are taken, and the Err is returned. Should no Err\noccur, the sum of all elements is returned.

    \n
    Examples
    \n

    This sums up every integer in a vector, rejecting the sum if a negative\nelement is encountered:

    \n\n
    let f = |&x: &i32| if x < 0 { Err("Negative element found") } else { Ok(x) };\nlet v = vec![1, 2];\nlet res: Result<i32, _> = v.iter().map(f).sum();\nassert_eq!(res, Ok(3));\nlet v = vec![1, -2];\nlet res: Result<i32, _> = v.iter().map(f).sum();\nassert_eq!(res, Err("Negative element found"));
    \n
    ","Sum>","hotshot_query_service::QueryResult"],["
    1.0.0 · source§

    impl<T, E> Debug for Result<T, E>where\n T: Debug,\n E: Debug,

    source§

    fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

    Formats the value using the given formatter. Read more
    ","Debug","hotshot_query_service::QueryResult"],["
    1.0.0 · source§

    impl<T, E> PartialOrd for Result<T, E>where\n T: PartialOrd,\n E: PartialOrd,

    source§

    fn partial_cmp(&self, other: &Result<T, E>) -> Option<Ordering>

    This method returns an ordering between self and other values if one exists. Read more
    1.0.0 · source§

    fn lt(&self, other: &Rhs) -> bool

    This method tests less than (for self and other) and is used by the < operator. Read more
    1.0.0 · source§

    fn le(&self, other: &Rhs) -> bool

    This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more
    1.0.0 · source§

    fn gt(&self, other: &Rhs) -> bool

    This method tests greater than (for self and other) and is used by the > operator. Read more
    1.0.0 · source§

    fn ge(&self, other: &Rhs) -> bool

    This method tests greater than or equal to (for self and other) and is used by the >=\noperator. Read more
    ","PartialOrd","hotshot_query_service::QueryResult"],["
    1.0.0 · source§

    impl<T, E> Copy for Result<T, E>where\n T: Copy,\n E: Copy,

    ","Copy","hotshot_query_service::QueryResult"],["
    1.16.0 · source§

    impl<T, U, E> Product<Result<U, E>> for Result<T, E>where\n T: Product<U>,

    source§

    fn product<I>(iter: I) -> Result<T, E>where\n I: Iterator<Item = Result<U, E>>,

    Takes each element in the Iterator: if it is an Err, no further\nelements are taken, and the Err is returned. Should no Err\noccur, the product of all elements is returned.

    \n
    Examples
    \n

    This multiplies each number in a vector of strings,\nif a string could not be parsed the operation returns Err:

    \n\n
    let nums = vec!["5", "10", "1", "2"];\nlet total: Result<usize, _> = nums.iter().map(|w| w.parse::<usize>()).product();\nassert_eq!(total, Ok(100));\nlet nums = vec!["5", "10", "one", "2"];\nlet total: Result<usize, _> = nums.iter().map(|w| w.parse::<usize>()).product();\nassert!(total.is_err());
    \n
    ","Product>","hotshot_query_service::QueryResult"],["
    §

    impl<T, U, E> Product<Result<U, E>> for Result<T, E>where\n T: Product<U>,

    §

    fn product<'a, S>(stream: S) -> Pin<Box<dyn Future<Output = Result<T, E>> + 'a>>where\n S: Stream<Item = Result<U, E>> + 'a,

    Takes each element in the Stream: if it is an Err, no further\nelements are taken, and the Err is returned. Should no Err occur,\nthe product of all elements is returned.

    \n
    Examples
    \n

    This multiplies every integer in a vector, rejecting the product if a negative element is\nencountered:

    \n\n
    use async_std::prelude::*;\nuse async_std::stream;\n\nlet v = stream::from_iter(vec![1, 2, 4]);\nlet res: Result<i32, &'static str> = v.map(|x|\n    if x < 0 {\n        Err("Negative element found")\n    } else {\n        Ok(x)\n    }).product().await;\nassert_eq!(res, Ok(8));
    \n
    ","Product>","hotshot_query_service::QueryResult"],["
    §

    impl<T, U, E> Sum<Result<U, E>> for Result<T, E>where\n T: Sum<U>,

    §

    fn sum<'a, S>(stream: S) -> Pin<Box<dyn Future<Output = Result<T, E>> + 'a>>where\n S: Stream<Item = Result<U, E>> + 'a,

    Takes each element in the Stream: if it is an Err, no further\nelements are taken, and the Err is returned. Should no Err occur,\nthe sum of all elements is returned.

    \n
    Examples
    \n

    This sums up every integer in a vector, rejecting the sum if a negative\nelement is encountered:

    \n\n
    use async_std::prelude::*;\nuse async_std::stream;\n\nlet v = stream::from_iter(vec![1, 2]);\nlet res: Result<i32, &'static str> = v.map(|x|\n    if x < 0 {\n        Err("Negative element found")\n    } else {\n        Ok(x)\n    }).sum().await;\nassert_eq!(res, Ok(3));
    \n
    ","Sum>","hotshot_query_service::QueryResult"],["
    §

    impl<T, E, V> FromStream<Result<T, E>> for Result<V, E>where\n T: Send,\n E: Send,\n V: FromStream<T>,

    §

    fn from_stream<'a, S>(\n stream: S\n) -> Pin<Box<dyn Future<Output = Result<V, E>> + Send + 'a>>where\n S: IntoStream<Item = Result<T, E>> + 'a,\n <S as IntoStream>::IntoStream: Send,

    Takes each element in the stream: if it is an Err, no further\nelements are taken, and the Err is returned. Should no Err\noccur, a container with the values of each Result is returned.

    \n
    Examples
    \n
    use async_std::prelude::*;\nuse async_std::stream;\n\nlet v = stream::from_iter(vec![1, 2]);\nlet res: Result<Vec<u32>, &'static str> = v.map(|x: u32|\n    x.checked_add(1).ok_or("Overflow!")\n).collect().await;\nassert_eq!(res, Ok(vec![2, 3]));
    \n
    ","FromStream>","hotshot_query_service::QueryResult"],["
    source§

    impl<T, E> Serialize for Result<T, E>where\n T: Serialize,\n E: Serialize,

    source§

    fn serialize<S>(\n &self,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,

    Serialize this value into the given Serde serializer. Read more
    ","Serialize","hotshot_query_service::QueryResult"],["
    source§

    impl<'de, T, E> Deserialize<'de> for Result<T, E>where\n T: Deserialize<'de>,\n E: Deserialize<'de>,

    source§

    fn deserialize<D>(\n deserializer: D\n) -> Result<Result<T, E>, <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,

    Deserialize this value from the given Serde deserializer. Read more
    ","Deserialize<'de>","hotshot_query_service::QueryResult"],["
    §

    impl<T, E> ResultExt<T, E> for Result<T, E>

    §

    fn context<C, E2>(self, context: C) -> Result<T, E2>where\n C: IntoError<E2, Source = E>,\n E2: Error + ErrorCompat,

    Extend a Result’s error with additional context-sensitive information. Read more
    §

    fn with_context<F, C, E2>(self, context: F) -> Result<T, E2>where\n F: FnOnce(&mut E) -> C,\n C: IntoError<E2, Source = E>,\n E2: Error + ErrorCompat,

    Extend a Result’s error with lazily-generated context-sensitive information. Read more
    §

    fn whatever_context<S, E2>(self, context: S) -> Result<T, E2>where\n S: Into<String>,\n E2: FromString,\n E: Into<<E2 as FromString>::Source>,

    Extend a Result’s error with information from a string. Read more
    §

    fn with_whatever_context<F, S, E2>(self, context: F) -> Result<T, E2>where\n F: FnOnce(&mut E) -> S,\n S: Into<String>,\n E2: FromString,\n E: Into<<E2 as FromString>::Source>,

    Extend a Result’s error with information from a\nlazily-generated string. Read more
    ","ResultExt","hotshot_query_service::QueryResult"],["
    §

    impl<T, E> Status<T, E> for Result<T, E>where\n E: Error + Send + Sync + 'static,

    §

    fn status<S>(self, status: S) -> Result<T, Error>where\n S: TryInto<StatusCode>,\n <S as TryInto<StatusCode>>::Error: Debug,

    Wrap the error value with an additional status code.

    \n
    Panics
    \n

    Panics if Status is not a valid StatusCode.

    \n
    §

    fn with_status<S, F>(self, f: F) -> Result<T, Error>where\n S: TryInto<StatusCode>,\n <S as TryInto<StatusCode>>::Error: Debug,\n F: FnOnce() -> S,

    Wrap the error value with an additional status code that is evaluated\nlazily only once an error does occur.

    \n
    Panics
    \n

    Panics if Status is not a valid StatusCode.

    \n
    ","Status","hotshot_query_service::QueryResult"],["
    source§

    impl<T, E> Context<T, E> for Result<T, E>where\n E: StdError + Send + Sync + 'static,

    source§

    fn context<C>(self, context: C) -> Result<T, Error>where\n C: Display + Send + Sync + 'static,

    Wrap the error value with additional context.
    source§

    fn with_context<C, F>(self, context: F) -> Result<T, Error>where\n C: Display + Send + Sync + 'static,\n F: FnOnce() -> C,

    Wrap the error value with additional context that is evaluated lazily\nonly once an error does occur.
    ","Context","hotshot_query_service::QueryResult"],["
    source§

    impl<'de, T, TAs, E, EAs> DeserializeAs<'de, Result<T, E>> for Result<TAs, EAs>where\n TAs: DeserializeAs<'de, T>,\n EAs: DeserializeAs<'de, E>,

    source§

    fn deserialize_as<D>(\n deserializer: D\n) -> Result<Result<T, E>, <D as Deserializer<'de>>::Error>where\n D: Deserializer<'de>,

    Deserialize this value from the given Serde deserializer.
    ","DeserializeAs<'de, Result>","hotshot_query_service::QueryResult"],["
    source§

    impl<T, TAs, E, EAs> SerializeAs<Result<T, E>> for Result<TAs, EAs>where\n TAs: SerializeAs<T>,\n EAs: SerializeAs<E>,

    source§

    fn serialize_as<S>(\n source: &Result<T, E>,\n serializer: S\n) -> Result<<S as Serializer>::Ok, <S as Serializer>::Error>where\n S: Serializer,

    Serialize this value into the given Serde serializer.
    ","SerializeAs>","hotshot_query_service::QueryResult"],["
    §

    impl<T, E> NonBlockingResult for Result<T, E>where\n E: NonBlockingError,

    §

    type Result = Result<Option<T>, E>

    Type of the converted result: Result<Option<T>, E>
    §

    fn no_block(self) -> <Result<T, E> as NonBlockingResult>::Result

    Perform the non-block conversion.
    ","NonBlockingResult","hotshot_query_service::QueryResult"],["
    §

    impl<'a, A, B> Arbitrary<'a> for Result<A, B>where\n A: Arbitrary<'a>,\n B: Arbitrary<'a>,

    §

    fn arbitrary(u: &mut Unstructured<'a>) -> Result<Result<A, B>, Error>

    Generate an arbitrary value of Self from the given unstructured data. Read more
    §

    fn size_hint(depth: usize) -> (usize, Option<usize>)

    Get a size hint for how many bytes out of an Unstructured this type\nneeds to construct itself. Read more
    §

    fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>

    Generate an arbitrary value of Self from the entirety of the given\nunstructured data. Read more
    ","Arbitrary<'a>","hotshot_query_service::QueryResult"],["
    §

    impl<T, E> TapFallible for Result<T, E>

    §

    type Ok = T

    The interior type used to indicate a successful construction.
    §

    type Err = E

    The interior type used to indicate a failed construction.
    §

    fn tap_ok(self, func: impl FnOnce(&T)) -> Result<T, E>

    Immutably accesses an interior success value. Read more
    §

    fn tap_ok_mut(self, func: impl FnOnce(&mut T)) -> Result<T, E>

    Mutably accesses an interior success value. Read more
    §

    fn tap_err(self, func: impl FnOnce(&E)) -> Result<T, E>

    Immutably accesses an interior failure value. Read more
    §

    fn tap_err_mut(self, func: impl FnOnce(&mut E)) -> Result<T, E>

    Mutably accesses an interior failure value. Read more
    §

    fn tap_ok_dbg(self, func: impl FnOnce(&Self::Ok)) -> Self

    Calls .tap_ok() only in debug builds, and is erased in release builds.
    §

    fn tap_ok_mut_dbg(self, func: impl FnOnce(&mut Self::Ok)) -> Self

    Calls .tap_ok_mut() only in debug builds, and is erased in release\nbuilds.
    §

    fn tap_err_dbg(self, func: impl FnOnce(&Self::Err)) -> Self

    Calls .tap_err() only in debug builds, and is erased in release\nbuilds.
    §

    fn tap_err_mut_dbg(self, func: impl FnOnce(&mut Self::Err)) -> Self

    Calls .tap_err_mut() only in debug builds, and is erased in release\nbuilds.
    ","TapFallible","hotshot_query_service::QueryResult"],["
    §

    impl<C, T, E> FromParallelIterator<Result<T, E>> for Result<C, E>where\n C: FromParallelIterator<T>,\n T: Send,\n E: Send,

    Collect an arbitrary Result-wrapped collection.

    \n

    If any item is Err, then all previous Ok items collected are\ndiscarded, and it returns that error. If there are multiple errors, the\none returned is not deterministic.

    \n
    §

    fn from_par_iter<I>(par_iter: I) -> Result<C, E>where\n I: IntoParallelIterator<Item = Result<T, E>>,

    Creates an instance of the collection from the parallel iterator par_iter. Read more
    ","FromParallelIterator>","hotshot_query_service::QueryResult"],["
    §

    impl<T, E> IntoParallelIterator for Result<T, E>where\n T: Send,

    §

    type Item = T

    The type of item that the parallel iterator will produce.
    §

    type Iter = IntoIter<T>

    The parallel iterator type that will be created.
    §

    fn into_par_iter(self) -> <Result<T, E> as IntoParallelIterator>::Iter

    Converts self into a parallel iterator. Read more
    ","IntoParallelIterator","hotshot_query_service::QueryResult"],["
    source§

    impl<T, E> InstrumentResult<T> for Result<T, E>where\n E: InstrumentError,

    §

    type Instrumented = <E as InstrumentError>::Instrumented

    The type of the wrapped error after instrumentation
    source§

    fn in_current_span(\n self\n) -> Result<T, <Result<T, E> as InstrumentResult<T>>::Instrumented>

    Instrument an Error by bundling it with a SpanTrace Read more
    ","InstrumentResult","hotshot_query_service::QueryResult"],["
    source§

    impl<T, E> Section for Result<T, E>where\n E: Into<Report>,

    §

    type Return = Result<T, Report>

    The return type of each method after adding context
    source§

    fn note<D>(self, note: D) -> <Result<T, E> as Section>::Returnwhere\n D: Display + Send + Sync + 'static,

    Add a Note to an error report, to be displayed after the chain of errors. Read more
    source§

    fn with_note<D, F>(self, note: F) -> <Result<T, E> as Section>::Returnwhere\n D: Display + Send + Sync + 'static,\n F: FnOnce() -> D,

    Add a Note to an error report, to be displayed after the chain of errors. The closure to\ncreate the Note is lazily evaluated only in the case of an error. Read more
    source§

    fn warning<D>(self, warning: D) -> <Result<T, E> as Section>::Returnwhere\n D: Display + Send + Sync + 'static,

    Add a Warning to an error report, to be displayed after the chain of errors.
    source§

    fn with_warning<D, F>(self, warning: F) -> <Result<T, E> as Section>::Returnwhere\n D: Display + Send + Sync + 'static,\n F: FnOnce() -> D,

    Add a Warning to an error report, to be displayed after the chain of errors. The closure to\ncreate the Warning is lazily evaluated only in the case of an error.
    source§

    fn suggestion<D>(self, suggestion: D) -> <Result<T, E> as Section>::Returnwhere\n D: Display + Send + Sync + 'static,

    Add a Suggestion to an error report, to be displayed after the chain of errors.
    source§

    fn with_suggestion<D, F>(\n self,\n suggestion: F\n) -> <Result<T, E> as Section>::Returnwhere\n D: Display + Send + Sync + 'static,\n F: FnOnce() -> D,

    Add a Suggestion to an error report, to be displayed after the chain of errors. The closure\nto create the Suggestion is lazily evaluated only in the case of an error.
    source§

    fn with_section<D, F>(self, section: F) -> <Result<T, E> as Section>::Returnwhere\n D: Display + Send + Sync + 'static,\n F: FnOnce() -> D,

    Add a Section to an error report, to be displayed after the chain of errors. The closure to\ncreate the Section is lazily evaluated only in the case of an error. Read more
    source§

    fn section<D>(self, section: D) -> <Result<T, E> as Section>::Returnwhere\n D: Display + Send + Sync + 'static,

    Add a section to an error report, to be displayed after the chain of errors. Read more
    source§

    fn error<E2>(self, error: E2) -> <Result<T, E> as Section>::Returnwhere\n E2: Error + Send + Sync + 'static,

    Add an error section to an error report, to be displayed after the primary error message\nsection. Read more
    source§

    fn with_error<E2, F>(self, error: F) -> <Result<T, E> as Section>::Returnwhere\n F: FnOnce() -> E2,\n E2: Error + Send + Sync + 'static,

    Add an error section to an error report, to be displayed after the primary error message\nsection. The closure to create the Section is lazily evaluated only in the case of an error. Read more
    ","Section","hotshot_query_service::QueryResult"],["
    source§

    impl<T, E> WrapErr<T, E> for Result<T, E>where\n E: StdError + Send + Sync + 'static,

    source§

    fn wrap_err<D>(self, msg: D) -> Result<T, Report>where\n D: Display + Send + Sync + 'static,

    Wrap the error value with a new adhoc error
    source§

    fn wrap_err_with<D, F>(self, msg: F) -> Result<T, Report>where\n D: Display + Send + Sync + 'static,\n F: FnOnce() -> D,

    Wrap the error value with a new adhoc error that is evaluated lazily\nonly once an error does occur.
    source§

    fn context<D>(self, msg: D) -> Result<T, Report>where\n D: Display + Send + Sync + 'static,

    Compatibility re-export of wrap_err for interop with anyhow
    source§

    fn with_context<D, F>(self, msg: F) -> Result<T, Report>where\n D: Display + Send + Sync + 'static,\n F: FnOnce() -> D,

    Compatibility re-export of wrap_err_with for interop with anyhow
    ","WrapErr","hotshot_query_service::QueryResult"],["
    §

    impl<E> ResultVoidErrExt<E> for Result<Void, E>

    §

    fn void_unwrap_err(self) -> E

    Get the error out of an always-err Result.

    \n

    Never panics, since it is statically known to be Err.

    \n
    ","ResultVoidErrExt","hotshot_query_service::QueryResult"],["
    §

    impl<R, A> RestrictedMath for Result<R, A>where\n R: RestrictedMath,\n A: 'static + Copy,

    §

    type Arg = <R as RestrictedMath>::Arg

    Argument for the math operations
    §

    type Value = <R as RestrictedMath>::Value

    Return value, generally the same as Arg
    §

    fn checked_add(\n &self,\n arg: <Result<R, A> as RestrictedMath>::Arg\n) -> Result<Restrict<<Result<R, A> as RestrictedMath>::Value>, <Result<R, A> as RestrictedMath>::Arg>

    Checked addition, see usize::checked_add
    §

    fn checked_sub(\n &self,\n arg: <Result<R, A> as RestrictedMath>::Arg\n) -> Result<Restrict<<Result<R, A> as RestrictedMath>::Value>, <Result<R, A> as RestrictedMath>::Arg>

    Checked subtraction, see usize::checked_sub
    §

    fn checked_mul(\n &self,\n arg: <Result<R, A> as RestrictedMath>::Arg\n) -> Result<Restrict<<Result<R, A> as RestrictedMath>::Value>, <Result<R, A> as RestrictedMath>::Arg>

    Checked multiplication, see usize::checked_mul
    ","RestrictedMath","hotshot_query_service::QueryResult"],["
    §

    impl<T, E> ResultExt<T, E> for Result<T, E>

    §

    fn context<X>(self, x: X) -> Result<T, Context<X, E>>

    The method is use to add context information to current operation Read more
    ","ResultExt","hotshot_query_service::QueryResult"],["
    §

    impl<R, A> RestrictedMath for Result<R, A>where\n R: RestrictedMath,\n A: 'static + Copy,

    §

    type Arg = <R as RestrictedMath>::Arg

    Argument for the math operations
    §

    type Value = <R as RestrictedMath>::Value

    Return value, generally the same as Arg
    §

    fn checked_add(\n &self,\n arg: <Result<R, A> as RestrictedMath>::Arg\n) -> Result<Restrict<<Result<R, A> as RestrictedMath>::Value>, <Result<R, A> as RestrictedMath>::Arg>

    Checked addition, see usize::checked_add
    §

    fn checked_sub(\n &self,\n arg: <Result<R, A> as RestrictedMath>::Arg\n) -> Result<Restrict<<Result<R, A> as RestrictedMath>::Value>, <Result<R, A> as RestrictedMath>::Arg>

    Checked subtraction, see usize::checked_sub
    §

    fn checked_mul(\n &self,\n arg: <Result<R, A> as RestrictedMath>::Arg\n) -> Result<Restrict<<Result<R, A> as RestrictedMath>::Value>, <Result<R, A> as RestrictedMath>::Arg>

    Checked multiplication, see usize::checked_mul
    ","RestrictedMath","hotshot_query_service::QueryResult"],["
    source§

    impl<T, E> UnwrapThrowExt<T> for Result<T, E>where\n E: Debug,

    source§

    fn expect_throw(self, message: &str) -> T

    Unwrap this container’s T value, or throw an error to JS with the\ngiven message if the T value is unavailable (e.g. an Option<T> is\nNone).
    source§

    fn unwrap_throw(self) -> T

    Unwrap this Option or Result, but instead of panicking on failure,\nthrow an exception to JavaScript.
    ","UnwrapThrowExt","hotshot_query_service::QueryResult"],["
    source§

    impl<T, E> ReturnWasmAbi for Result<T, E>where\n T: IntoWasmAbi,\n E: Into<JsValue>,\n <T as IntoWasmAbi>::Abi: WasmAbi<Prim3 = (), Prim4 = ()>,

    §

    type Abi = Result<<T as IntoWasmAbi>::Abi, u32>

    Same as IntoWasmAbi::Abi
    source§

    fn return_abi(self) -> <Result<T, E> as ReturnWasmAbi>::Abi

    Same as IntoWasmAbi::into_abi, except that it may throw and never\nreturn in the case of Err.
    ","ReturnWasmAbi","hotshot_query_service::QueryResult"],["
    §

    impl<T, E> WrapMigrationError<T, E> for Result<T, E>where\n E: Error + Send + Sync + 'static,

    §

    fn migration_err(\n self,\n msg: &str,\n applied_migrations: Option<&[Migration]>\n) -> Result<T, Error>

    ","WrapMigrationError","hotshot_query_service::QueryResult"],["
    §

    impl<T, E> NonBlockingResult for Result<T, E>where\n E: NonBlockingError,

    §

    type Result = Result<Option<T>, E>

    Type of the converted result: Result<Option<T>, E>
    §

    fn no_block(self) -> <Result<T, E> as NonBlockingResult>::Result

    Perform the non-block conversion.
    ","NonBlockingResult","hotshot_query_service::QueryResult"]] };if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/type.impl/hotshot_query_service/availability/enum.ResourceId.js b/type.impl/hotshot_query_service/availability/enum.ResourceId.js index e48cb7b45..9d5117e01 100644 --- a/type.impl/hotshot_query_service/availability/enum.ResourceId.js +++ b/type.impl/hotshot_query_service/availability/enum.ResourceId.js @@ -1,3 +1,3 @@ (function() {var type_impls = { -"hotshot_query_service":[["
    source§

    impl<T: Committable> Debug for ResourceId<T>

    source§

    fn fmt(&self, __f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    ","Debug","hotshot_query_service::availability::data_source::BlockId","hotshot_query_service::availability::data_source::LeafId"],["
    source§

    impl<T: Committable> Display for ResourceId<T>

    source§

    fn fmt(&self, _derive_more_display_formatter: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    ","Display","hotshot_query_service::availability::data_source::BlockId","hotshot_query_service::availability::data_source::LeafId"],["
    source§

    impl<T: Committable> PartialOrd for ResourceId<T>

    source§

    fn partial_cmp(&self, other: &Self) -> Option<Ordering>

    This method returns an ordering between self and other values if one exists. Read more
    1.0.0 · source§

    fn lt(&self, other: &Rhs) -> bool

    This method tests less than (for self and other) and is used by the < operator. Read more
    1.0.0 · source§

    fn le(&self, other: &Rhs) -> bool

    This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more
    1.0.0 · source§

    fn gt(&self, other: &Rhs) -> bool

    This method tests greater than (for self and other) and is used by the > operator. Read more
    1.0.0 · source§

    fn ge(&self, other: &Rhs) -> bool

    This method tests greater than or equal to (for self and other) and is used by the >=\noperator. Read more
    ","PartialOrd","hotshot_query_service::availability::data_source::BlockId","hotshot_query_service::availability::data_source::LeafId"],["
    source§

    impl<T: Committable> Hash for ResourceId<T>

    source§

    fn hash<__HT>(&self, __state: &mut __HT)where\n __HT: Hasher,

    Feeds this value into the given Hasher. Read more
    1.3.0 · source§

    fn hash_slice<H>(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,

    Feeds a slice of this type into the given Hasher. Read more
    ","Hash","hotshot_query_service::availability::data_source::BlockId","hotshot_query_service::availability::data_source::LeafId"],["
    source§

    impl<T: Committable> PartialEq for ResourceId<T>

    source§

    fn eq(&self, other: &Self) -> bool

    This method tests for self and other values to be equal, and is used\nby ==.
    1.0.0 · source§

    fn ne(&self, other: &Rhs) -> bool

    This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
    ","PartialEq","hotshot_query_service::availability::data_source::BlockId","hotshot_query_service::availability::data_source::LeafId"],["
    source§

    impl<T: Committable> Eq for ResourceId<T>

    ","Eq","hotshot_query_service::availability::data_source::BlockId","hotshot_query_service::availability::data_source::LeafId"],["
    source§

    impl<T: Committable> Clone for ResourceId<T>

    source§

    fn clone(&self) -> Self

    Returns a copy of the value. Read more
    1.0.0 · source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    ","Clone","hotshot_query_service::availability::data_source::BlockId","hotshot_query_service::availability::data_source::LeafId"],["
    source§

    impl<T: Committable> From<Commitment<T>> for ResourceId<T>

    source§

    fn from(original: Commitment<T>) -> ResourceId<T>

    Converts to this type from the input type.
    ","From>","hotshot_query_service::availability::data_source::BlockId","hotshot_query_service::availability::data_source::LeafId"],["
    source§

    impl<T: Committable> From<usize> for ResourceId<T>

    source§

    fn from(original: usize) -> ResourceId<T>

    Converts to this type from the input type.
    ","From","hotshot_query_service::availability::data_source::BlockId","hotshot_query_service::availability::data_source::LeafId"],["
    source§

    impl<T: Committable> Ord for ResourceId<T>

    source§

    fn cmp(&self, other: &Self) -> Ordering

    This method returns an Ordering between self and other. Read more
    1.21.0 · source§

    fn max(self, other: Self) -> Selfwhere\n Self: Sized,

    Compares and returns the maximum of two values. Read more
    1.21.0 · source§

    fn min(self, other: Self) -> Selfwhere\n Self: Sized,

    Compares and returns the minimum of two values. Read more
    1.50.0 · source§

    fn clamp(self, min: Self, max: Self) -> Selfwhere\n Self: Sized + PartialOrd,

    Restrict a value to a certain interval. Read more
    ","Ord","hotshot_query_service::availability::data_source::BlockId","hotshot_query_service::availability::data_source::LeafId"],["
    source§

    impl<T: Committable> Copy for ResourceId<T>

    ","Copy","hotshot_query_service::availability::data_source::BlockId","hotshot_query_service::availability::data_source::LeafId"]] +"hotshot_query_service":[["
    source§

    impl<T: Committable> PartialEq for ResourceId<T>

    source§

    fn eq(&self, other: &Self) -> bool

    This method tests for self and other values to be equal, and is used\nby ==.
    1.0.0 · source§

    fn ne(&self, other: &Rhs) -> bool

    This method tests for !=. The default implementation is almost always\nsufficient, and should not be overridden without very good reason.
    ","PartialEq","hotshot_query_service::availability::data_source::BlockId","hotshot_query_service::availability::data_source::LeafId"],["
    source§

    impl<T: Committable> Eq for ResourceId<T>

    ","Eq","hotshot_query_service::availability::data_source::BlockId","hotshot_query_service::availability::data_source::LeafId"],["
    source§

    impl<T: Committable> Clone for ResourceId<T>

    source§

    fn clone(&self) -> Self

    Returns a copy of the value. Read more
    1.0.0 · source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    ","Clone","hotshot_query_service::availability::data_source::BlockId","hotshot_query_service::availability::data_source::LeafId"],["
    source§

    impl<T: Committable> PartialOrd for ResourceId<T>

    source§

    fn partial_cmp(&self, other: &Self) -> Option<Ordering>

    This method returns an ordering between self and other values if one exists. Read more
    1.0.0 · source§

    fn lt(&self, other: &Rhs) -> bool

    This method tests less than (for self and other) and is used by the < operator. Read more
    1.0.0 · source§

    fn le(&self, other: &Rhs) -> bool

    This method tests less than or equal to (for self and other) and is used by the <=\noperator. Read more
    1.0.0 · source§

    fn gt(&self, other: &Rhs) -> bool

    This method tests greater than (for self and other) and is used by the > operator. Read more
    1.0.0 · source§

    fn ge(&self, other: &Rhs) -> bool

    This method tests greater than or equal to (for self and other) and is used by the >=\noperator. Read more
    ","PartialOrd","hotshot_query_service::availability::data_source::BlockId","hotshot_query_service::availability::data_source::LeafId"],["
    source§

    impl<T: Committable> From<usize> for ResourceId<T>

    source§

    fn from(original: usize) -> ResourceId<T>

    Converts to this type from the input type.
    ","From","hotshot_query_service::availability::data_source::BlockId","hotshot_query_service::availability::data_source::LeafId"],["
    source§

    impl<T: Committable> Hash for ResourceId<T>

    source§

    fn hash<__HT>(&self, __state: &mut __HT)where\n __HT: Hasher,

    Feeds this value into the given Hasher. Read more
    1.3.0 · source§

    fn hash_slice<H>(data: &[Self], state: &mut H)where\n H: Hasher,\n Self: Sized,

    Feeds a slice of this type into the given Hasher. Read more
    ","Hash","hotshot_query_service::availability::data_source::BlockId","hotshot_query_service::availability::data_source::LeafId"],["
    source§

    impl<T: Committable> Ord for ResourceId<T>

    source§

    fn cmp(&self, other: &Self) -> Ordering

    This method returns an Ordering between self and other. Read more
    1.21.0 · source§

    fn max(self, other: Self) -> Selfwhere\n Self: Sized,

    Compares and returns the maximum of two values. Read more
    1.21.0 · source§

    fn min(self, other: Self) -> Selfwhere\n Self: Sized,

    Compares and returns the minimum of two values. Read more
    1.50.0 · source§

    fn clamp(self, min: Self, max: Self) -> Selfwhere\n Self: Sized + PartialOrd,

    Restrict a value to a certain interval. Read more
    ","Ord","hotshot_query_service::availability::data_source::BlockId","hotshot_query_service::availability::data_source::LeafId"],["
    source§

    impl<T: Committable> From<Commitment<T>> for ResourceId<T>

    source§

    fn from(original: Commitment<T>) -> ResourceId<T>

    Converts to this type from the input type.
    ","From>","hotshot_query_service::availability::data_source::BlockId","hotshot_query_service::availability::data_source::LeafId"],["
    source§

    impl<T: Committable> Copy for ResourceId<T>

    ","Copy","hotshot_query_service::availability::data_source::BlockId","hotshot_query_service::availability::data_source::LeafId"],["
    source§

    impl<T: Committable> Debug for ResourceId<T>

    source§

    fn fmt(&self, __f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    ","Debug","hotshot_query_service::availability::data_source::BlockId","hotshot_query_service::availability::data_source::LeafId"],["
    source§

    impl<T: Committable> Display for ResourceId<T>

    source§

    fn fmt(&self, _derive_more_display_formatter: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    ","Display","hotshot_query_service::availability::data_source::BlockId","hotshot_query_service::availability::data_source::LeafId"]] };if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file diff --git a/type.impl/hotshot_query_service/data_source/struct.FetchingDataSource.js b/type.impl/hotshot_query_service/data_source/struct.FetchingDataSource.js new file mode 100644 index 000000000..e98a18edb --- /dev/null +++ b/type.impl/hotshot_query_service/data_source/struct.FetchingDataSource.js @@ -0,0 +1,3 @@ +(function() {var type_impls = { +"hotshot_query_service":[["
    source§

    impl<Types, S, P> FetchingDataSource<Types, S, P>where\n Types: NodeType,\n Payload<Types>: QueryablePayload,\n S: NodeDataSource<Types> + UpdateNodeData<Types> + AvailabilityStorage<Types> + VersionedDataSource,\n P: Send + Sync,

    source

    pub async fn new(storage: S, provider: P) -> Result<Self>

    Create a data source with local storage and a remote data availability provider.

    \n
    ",0,"hotshot_query_service::data_source::fs::FileSystemDataSource","hotshot_query_service::data_source::sql::SqlDataSource"],["
    source§

    impl<Types, S, P> FetchingDataSource<Types, S, P>where\n Types: NodeType,

    source

    pub async fn storage(&self) -> StorageReadGuard<'_, Types, S>

    Obtain direct, read-only access to the underlying local storage.

    \n
    source

    pub async fn storage_mut(&self) -> StorageWriteGuard<'_, Types, S>

    Obtain direct, mutable access the underlying local storage.

    \n
    ",0,"hotshot_query_service::data_source::fs::FileSystemDataSource","hotshot_query_service::data_source::sql::SqlDataSource"],["
    source§

    impl<Types, S, P> UpdateNodeData<Types> for FetchingDataSource<Types, S, P>where\n Types: NodeType,\n S: UpdateNodeData<Types> + Send + Sync,\n P: Send + Sync,

    §

    type Error = <S as UpdateNodeData<Types>>::Error

    source§

    fn insert_leaf<'life0, 'async_trait>(\n &'life0 mut self,\n leaf: LeafQueryData<Types>\n) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where\n Self: 'async_trait,\n 'life0: 'async_trait,

    ","UpdateNodeData","hotshot_query_service::data_source::fs::FileSystemDataSource","hotshot_query_service::data_source::sql::SqlDataSource"],["
    source§

    impl<Types, S, P> AvailabilityDataSource<Types> for FetchingDataSource<Types, S, P>where\n Types: NodeType,\n Payload<Types>: QueryablePayload,\n S: AvailabilityStorage<Types> + 'static,\n P: Send + Sync + 'static,

    §

    type LeafRange<R> = Pin<Box<dyn Stream<Item = Fetch<LeafQueryData<Types>>> + Send>>\nwhere\n R: RangeBounds<usize> + Send

    §

    type BlockRange<R> = Pin<Box<dyn Stream<Item = Fetch<BlockQueryData<Types>>> + Send>>\nwhere\n R: RangeBounds<usize> + Send

    source§

    fn get_leaf<'life0, 'async_trait, ID>(\n &'life0 self,\n id: ID\n) -> Pin<Box<dyn Future<Output = Fetch<LeafQueryData<Types>>> + Send + 'async_trait>>where\n ID: Into<LeafId<Types>> + Send + Sync + 'async_trait,\n Self: 'async_trait,\n 'life0: 'async_trait,

    source§

    fn get_block<'life0, 'async_trait, ID>(\n &'life0 self,\n id: ID\n) -> Pin<Box<dyn Future<Output = Fetch<BlockQueryData<Types>>> + Send + 'async_trait>>where\n ID: Into<BlockId<Types>> + Send + Sync + 'async_trait,\n Self: 'async_trait,\n 'life0: 'async_trait,

    source§

    fn get_leaf_range<'life0, 'async_trait, R>(\n &'life0 self,\n range: R\n) -> Pin<Box<dyn Future<Output = Self::LeafRange<R>> + Send + 'async_trait>>where\n R: RangeBounds<usize> + Send + 'static + 'async_trait,\n Self: 'async_trait,\n 'life0: 'async_trait,

    source§

    fn get_block_range<'life0, 'async_trait, R>(\n &'life0 self,\n range: R\n) -> Pin<Box<dyn Future<Output = Self::BlockRange<R>> + Send + 'async_trait>>where\n R: RangeBounds<usize> + Send + 'static + 'async_trait,\n Self: 'async_trait,\n 'life0: 'async_trait,

    source§

    fn get_block_with_transaction<'life0, 'async_trait>(\n &'life0 self,\n hash: TransactionHash<Types>\n) -> Pin<Box<dyn Future<Output = Fetch<(BlockQueryData<Types>, TransactionIndex<Types>)>> + Send + 'async_trait>>where\n Self: 'async_trait,\n 'life0: 'async_trait,

    Returns the block containing a transaction with the given hash and the transaction’s\nposition in the block.
    source§

    fn subscribe_blocks<'life0, 'async_trait>(\n &'life0 self,\n from: usize\n) -> Pin<Box<dyn Future<Output = BoxStream<'static, BlockQueryData<Types>>> + Send + 'async_trait>>where\n Self: Sync + 'async_trait,\n 'life0: 'async_trait,

    source§

    fn subscribe_leaves<'life0, 'async_trait>(\n &'life0 self,\n from: usize\n) -> Pin<Box<dyn Future<Output = BoxStream<'static, LeafQueryData<Types>>> + Send + 'async_trait>>where\n Self: Sync + 'async_trait,\n 'life0: 'async_trait,

    ","AvailabilityDataSource","hotshot_query_service::data_source::fs::FileSystemDataSource","hotshot_query_service::data_source::sql::SqlDataSource"],["
    source§

    impl<Types, S, P> VersionedDataSource for FetchingDataSource<Types, S, P>where\n Types: NodeType,\n S: VersionedDataSource + Send + Sync,\n P: Send + Sync,

    §

    type Error = <S as VersionedDataSource>::Error

    source§

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

    Atomically commit to all outstanding modifications to the data. Read more
    source§

    fn revert<'life0, 'async_trait>(\n &'life0 mut self\n) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where\n Self: 'async_trait,\n 'life0: 'async_trait,

    Erase all oustanding modifications to the data. Read more
    ","VersionedDataSource","hotshot_query_service::data_source::fs::FileSystemDataSource","hotshot_query_service::data_source::sql::SqlDataSource"],["
    source§

    impl<Types, S, P> StatusDataSource for FetchingDataSource<Types, S, P>where\n Types: NodeType,\n S: NodeDataSource<Types> + Send + Sync,\n P: Send + Sync,

    source§

    fn block_height<'life0, 'async_trait>(\n &'life0 self\n) -> Pin<Box<dyn Future<Output = QueryResult<usize>> + Send + 'async_trait>>where\n Self: 'async_trait,\n 'life0: 'async_trait,

    source§

    fn metrics(&self) -> &PrometheusMetrics

    source§

    fn consensus_metrics(&self) -> QueryResult<PrometheusMetrics>

    source§

    fn mempool_info<'life0, 'async_trait>(\n &'life0 self\n) -> Pin<Box<dyn Future<Output = QueryResult<MempoolQueryData>> + Send + 'async_trait>>where\n Self: Sync + 'async_trait,\n 'life0: 'async_trait,

    source§

    fn success_rate<'life0, 'async_trait>(\n &'life0 self\n) -> Pin<Box<dyn Future<Output = QueryResult<f64>> + Send + 'async_trait>>where\n Self: Sync + 'async_trait,\n 'life0: 'async_trait,

    ","StatusDataSource","hotshot_query_service::data_source::fs::FileSystemDataSource","hotshot_query_service::data_source::sql::SqlDataSource"],["
    source§

    impl<Types, S, P> Clone for FetchingDataSource<Types, S, P>where\n Types: NodeType,

    source§

    fn clone(&self) -> Self

    Returns a copy of the value. Read more
    1.0.0 · source§

    fn clone_from(&mut self, source: &Self)

    Performs copy-assignment from source. Read more
    ","Clone","hotshot_query_service::data_source::fs::FileSystemDataSource","hotshot_query_service::data_source::sql::SqlDataSource"],["
    source§

    impl<Types, S, P> NodeDataSource<Types> for FetchingDataSource<Types, S, P>where\n Types: NodeType,\n S: NodeDataSource<Types> + Send + Sync,\n P: Send + Sync,

    source§

    fn block_height<'life0, 'async_trait>(\n &'life0 self\n) -> Pin<Box<dyn Future<Output = QueryResult<usize>> + Send + 'async_trait>>where\n Self: 'async_trait,\n 'life0: 'async_trait,

    source§

    fn get_proposals<'life0, 'life1, 'async_trait>(\n &'life0 self,\n proposer: &'life1 SignatureKey<Types>,\n limit: Option<usize>\n) -> Pin<Box<dyn Future<Output = QueryResult<Vec<LeafQueryData<Types>>>> + Send + 'async_trait>>where\n Self: 'async_trait,\n 'life0: 'async_trait,\n 'life1: 'async_trait,

    source§

    fn count_proposals<'life0, 'life1, 'async_trait>(\n &'life0 self,\n proposer: &'life1 SignatureKey<Types>\n) -> Pin<Box<dyn Future<Output = QueryResult<usize>> + Send + 'async_trait>>where\n Self: 'async_trait,\n 'life0: 'async_trait,\n 'life1: 'async_trait,

    ","NodeDataSource","hotshot_query_service::data_source::fs::FileSystemDataSource","hotshot_query_service::data_source::sql::SqlDataSource"],["
    source§

    impl<Types, S, P> UpdateAvailabilityData<Types> for FetchingDataSource<Types, S, P>where\n Types: NodeType,\n Payload<Types>: QueryablePayload,\n S: UpdateAvailabilityData<Types> + Send + Sync,\n P: Send + Sync,

    §

    type Error = <S as UpdateAvailabilityData<Types>>::Error

    source§

    fn insert_leaf<'life0, 'async_trait>(\n &'life0 mut self,\n leaf: LeafQueryData<Types>\n) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where\n Self: 'async_trait,\n 'life0: 'async_trait,

    source§

    fn insert_block<'life0, 'async_trait>(\n &'life0 mut self,\n block: BlockQueryData<Types>\n) -> Pin<Box<dyn Future<Output = Result<(), Self::Error>> + Send + 'async_trait>>where\n Self: 'async_trait,\n 'life0: 'async_trait,

    ","UpdateAvailabilityData","hotshot_query_service::data_source::fs::FileSystemDataSource","hotshot_query_service::data_source::sql::SqlDataSource"],["
    source§

    impl<Types, S, P> Debug for FetchingDataSource<Types, S, P>where\n Types: NodeType,\n S: Debug,\n P: Debug,

    source§

    fn fmt(&self, __f: &mut Formatter<'_>) -> Result

    Formats the value using the given formatter. Read more
    ","Debug","hotshot_query_service::data_source::fs::FileSystemDataSource","hotshot_query_service::data_source::sql::SqlDataSource"]] +};if (window.register_type_impls) {window.register_type_impls(type_impls);} else {window.pending_type_impls = type_impls;}})() \ No newline at end of file