diff --git a/hotshot_query_service/all.html b/hotshot_query_service/all.html index e587d3bf8..282dbd7ab 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

Constants

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

List of all items

Structs

Enums

Traits

Macros

Functions

Type Aliases

Constants

\ 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 5e035c19e..9e0bbe7b7 100644 --- a/hotshot_query_service/availability/struct.BlockQueryData.html +++ b/hotshot_query_service/availability/struct.BlockQueryData.html @@ -1,4 +1,4 @@ -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(header: Header<Types>, payload: Payload<Types>) -> Self
where +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(header: Header<Types>, payload: Payload<Types>) -> Self
where Payload<Types>: QueryablePayload<Types>,

source

pub async fn genesis( validated_state: &Types::ValidatedState, instance_state: &Types::InstanceState, @@ -15,9 +15,9 @@ ) -> 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: NodeType> From<BlockQueryData<Types>> for BlockSummaryQueryData<Types>
where Payload<Types>: QueryablePayload<Types>,

source§

fn from(value: BlockQueryData<Types>) -> Self

Converts to this type from the input type.
source§

impl<Types> From<BlockQueryData<Types>> for PayloadMetadata<Types>
where - Types: NodeType,

source§

fn from(block: BlockQueryData<Types>) -> Self

Converts to this type from the input type.
source§

impl<Types: NodeType> From<BlockQueryData<Types>> for PayloadQueryData<Types>

source§

fn from(block: BlockQueryData<Types>) -> Self

Converts to this type from the input type.
source§

impl<'r, Types> FromRow<'r, <Postgres as Database>::Row> for BlockQueryData<Types>
where + Types: NodeType,

source§

fn from(block: BlockQueryData<Types>) -> Self

Converts to this type from the input type.
source§

impl<Types: NodeType> From<BlockQueryData<Types>> for PayloadQueryData<Types>

source§

fn from(block: BlockQueryData<Types>) -> Self

Converts to this type from the input type.
source§

impl<'r, Types> FromRow<'r, <Sqlite as Database>::Row> for BlockQueryData<Types>
where Types: NodeType, - Payload<Types>: QueryablePayload<Types>,

source§

fn from_row(row: &'r <Db as Database>::Row) -> Result<Self>

source§

impl<Types: NodeType> HeightIndexed for BlockQueryData<Types>

source§

fn height(&self) -> u64

source§

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

source§

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

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

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

Tests for !=. The default implementation is almost always sufficient, + Payload<Types>: QueryablePayload<Types>,

source§

fn from_row(row: &'r <Db as Database>::Row) -> Result<Self>

source§

impl<Types: NodeType> HeightIndexed for BlockQueryData<Types>

source§

fn height(&self) -> u64

source§

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

source§

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

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

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

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

impl<Types: NodeType> Serialize for BlockQueryData<Types>

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: NodeType> TryFrom<BlockQueryData<Types>> for BlockDetail<Types>
where BlockQueryData<Types>: HeightIndexed, diff --git a/hotshot_query_service/availability/struct.LeafQueryData.html b/hotshot_query_service/availability/struct.LeafQueryData.html index 80b2e0a73..102fa2655 100644 --- a/hotshot_query_service/availability/struct.LeafQueryData.html +++ b/hotshot_query_service/availability/struct.LeafQueryData.html @@ -1,4 +1,4 @@ -LeafQueryData in hotshot_query_service::availability - Rust
pub struct LeafQueryData<Types: NodeType> { /* private fields */ }

Implementations§

source§

impl<Types: NodeType> LeafQueryData<Types>

source

pub fn new( +LeafQueryData in hotshot_query_service::availability - Rust
pub struct LeafQueryData<Types: NodeType> { /* private fields */ }

Implementations§

source§

impl<Types: NodeType> LeafQueryData<Types>

source

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

Collect information about a Leaf.

@@ -9,8 +9,8 @@
§Errors
validated_state: &Types::ValidatedState, instance_state: &Types::InstanceState, ) -> Self

source

pub fn leaf(&self) -> &Leaf<Types>

source

pub fn qc(&self) -> &QuorumCertificate<Types>

source

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

source

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

source

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

source

pub fn payload_hash(&self) -> VidCommitment

Trait Implementations§

source§

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

source§

fn clone(&self) -> LeafQueryData<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 LeafQueryData<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 LeafQueryData<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: NodeType> From<LeafQueryData<Types>> for BlockInfo<Types>

source§

fn from(leaf: LeafQueryData<Types>) -> Self

Converts to this type from the input type.
source§

impl<'r, Types> FromRow<'r, <Postgres as Database>::Row> for LeafQueryData<Types>
where - Types: NodeType,

source§

fn from_row(row: &'r <Db as Database>::Row) -> Result<Self>

source§

impl<Types: NodeType> HeightIndexed for LeafQueryData<Types>

source§

fn height(&self) -> u64

source§

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

source§

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

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

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

Tests for !=. The default implementation is almost always sufficient, + __D: Deserializer<'de>,

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

impl<Types: NodeType> From<LeafQueryData<Types>> for BlockInfo<Types>

source§

fn from(leaf: LeafQueryData<Types>) -> Self

Converts to this type from the input type.
source§

impl<'r, Types> FromRow<'r, <Sqlite as Database>::Row> for LeafQueryData<Types>
where + Types: NodeType,

source§

fn from_row(row: &'r <Db as Database>::Row) -> Result<Self>

source§

impl<Types: NodeType> HeightIndexed for LeafQueryData<Types>

source§

fn height(&self) -> u64

source§

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

source§

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

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

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

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

impl<Types: NodeType> Serialize for LeafQueryData<Types>

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 LeafQueryData<Types>

source§

impl<Types: NodeType> StructuralPartialEq for LeafQueryData<Types>

Auto Trait Implementations§

§

impl<Types> Freeze for LeafQueryData<Types>
where <Types as NodeType>::View: Freeze, diff --git a/hotshot_query_service/availability/struct.PayloadMetadata.html b/hotshot_query_service/availability/struct.PayloadMetadata.html index 29b094cc5..054dfd66b 100644 --- a/hotshot_query_service/availability/struct.PayloadMetadata.html +++ b/hotshot_query_service/availability/struct.PayloadMetadata.html @@ -1,4 +1,4 @@ -PayloadMetadata in hotshot_query_service::availability - Rust
pub struct PayloadMetadata<Types>
where +PayloadMetadata in hotshot_query_service::availability - Rust
pub struct PayloadMetadata<Types>
where Types: NodeType,
{ pub height: u64, pub block_hash: BlockHash<Types>, @@ -11,8 +11,8 @@

Fields§

§height: u64§block_hash: BlockHash<Types>§hash: VidCommitment§size: u64§num_transactions: u64

Trait Implementations§

source§

impl<Types> Clone for PayloadMetadata<Types>
where Types: NodeType + Clone,

source§

fn clone(&self) -> PayloadMetadata<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 for PayloadMetadata<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> From<BlockQueryData<Types>> for PayloadMetadata<Types>
where - Types: NodeType,

source§

fn from(block: BlockQueryData<Types>) -> Self

Converts to this type from the input type.
source§

impl<'r, Types> FromRow<'r, <Postgres as Database>::Row> for PayloadMetadata<Types>
where - Types: NodeType,

source§

fn from_row(row: &'r <Db as Database>::Row) -> Result<Self>

source§

impl<Types> HeightIndexed for PayloadMetadata<Types>
where + Types: NodeType,

source§

fn from(block: BlockQueryData<Types>) -> Self

Converts to this type from the input type.
source§

impl<'r, Types> FromRow<'r, <Sqlite as Database>::Row> for PayloadMetadata<Types>
where + Types: NodeType,

source§

fn from_row(row: &'r <Db as Database>::Row) -> Result<Self>

source§

impl<Types> HeightIndexed for PayloadMetadata<Types>
where Types: NodeType,

source§

fn height(&self) -> u64

source§

impl<Types> PartialEq for PayloadMetadata<Types>
where Types: NodeType + PartialEq,

source§

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

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

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

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

impl<Types> Copy for PayloadMetadata<Types>
where diff --git a/hotshot_query_service/availability/struct.PayloadQueryData.html b/hotshot_query_service/availability/struct.PayloadQueryData.html index ec3f4bc55..d28014cf6 100644 --- a/hotshot_query_service/availability/struct.PayloadQueryData.html +++ b/hotshot_query_service/availability/struct.PayloadQueryData.html @@ -1,11 +1,11 @@ -PayloadQueryData in hotshot_query_service::availability - Rust
pub struct PayloadQueryData<Types: NodeType> { /* private fields */ }

Implementations§

source§

impl<Types: NodeType> PayloadQueryData<Types>

source

pub async fn genesis( +PayloadQueryData in hotshot_query_service::availability - Rust
pub struct PayloadQueryData<Types: NodeType> { /* private fields */ }

Implementations§

source§

impl<Types: NodeType> PayloadQueryData<Types>

source

pub async fn genesis( validated_state: &Types::ValidatedState, instance_state: &Types::InstanceState, ) -> Self
where Payload<Types>: QueryablePayload<Types>,

source

pub fn hash(&self) -> VidCommitment

source

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

source

pub fn size(&self) -> u64

source

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

Trait Implementations§

source§

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

source§

fn clone(&self) -> PayloadQueryData<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 PayloadQueryData<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 PayloadQueryData<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: NodeType> From<BlockQueryData<Types>> for PayloadQueryData<Types>

source§

fn from(block: BlockQueryData<Types>) -> Self

Converts to this type from the input type.
source§

impl<'r, Types> FromRow<'r, <Postgres as Database>::Row> for PayloadQueryData<Types>
where + __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more

source§

impl<Types: NodeType> From<BlockQueryData<Types>> for PayloadQueryData<Types>

source§

fn from(block: BlockQueryData<Types>) -> Self

Converts to this type from the input type.
source§

impl<'r, Types> FromRow<'r, <Sqlite as Database>::Row> for PayloadQueryData<Types>
where Types: NodeType, - Payload<Types>: QueryablePayload<Types>,

source§

fn from_row(row: &'r <Db as Database>::Row) -> Result<Self>

source§

impl<Types: NodeType> HeightIndexed for PayloadQueryData<Types>

source§

fn height(&self) -> u64

source§

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

source§

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

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

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

Tests for !=. The default implementation is almost always sufficient, + Payload<Types>: QueryablePayload<Types>,

source§

fn from_row(row: &'r <Db as Database>::Row) -> Result<Self>

source§

impl<Types: NodeType> HeightIndexed for PayloadQueryData<Types>

source§

fn height(&self) -> u64

source§

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

source§

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

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

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

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

impl<Types: NodeType> Serialize for PayloadQueryData<Types>

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 PayloadQueryData<Types>

source§

impl<Types: NodeType> StructuralPartialEq for PayloadQueryData<Types>

Auto Trait Implementations§

§

impl<Types> Freeze for PayloadQueryData<Types>
where <Types as NodeType>::BlockPayload: Freeze,

§

impl<Types> RefUnwindSafe for PayloadQueryData<Types>
where diff --git a/hotshot_query_service/availability/struct.VidCommonMetadata.html b/hotshot_query_service/availability/struct.VidCommonMetadata.html index de769cab4..b20f04b33 100644 --- a/hotshot_query_service/availability/struct.VidCommonMetadata.html +++ b/hotshot_query_service/availability/struct.VidCommonMetadata.html @@ -1,4 +1,4 @@ -VidCommonMetadata in hotshot_query_service::availability - Rust
pub struct VidCommonMetadata<Types>
where +VidCommonMetadata in hotshot_query_service::availability - Rust
pub struct VidCommonMetadata<Types>
where Types: NodeType,
{ pub height: u64, pub block_hash: BlockHash<Types>, @@ -9,9 +9,9 @@

Fields§

§height: u64§block_hash: BlockHash<Types>§payload_hash: VidCommitment

Trait Implementations§

source§

impl<Types> Clone for VidCommonMetadata<Types>
where Types: NodeType + Clone,

source§

fn clone(&self) -> VidCommonMetadata<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 for VidCommonMetadata<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> From<VidCommonQueryData<Types>> for VidCommonMetadata<Types>
where - Types: NodeType,

source§

fn from(common: VidCommonQueryData<Types>) -> Self

Converts to this type from the input type.
source§

impl<'r, Types> FromRow<'r, <Postgres as Database>::Row> for VidCommonMetadata<Types>
where + Types: NodeType,

source§

fn from(common: VidCommonQueryData<Types>) -> Self

Converts to this type from the input type.
source§

impl<'r, Types> FromRow<'r, <Sqlite as Database>::Row> for VidCommonMetadata<Types>
where Types: NodeType, - Payload<Types>: QueryablePayload<Types>,

source§

fn from_row(row: &'r <Db as Database>::Row) -> Result<Self>

source§

impl<Types> HeightIndexed for VidCommonMetadata<Types>
where + Payload<Types>: QueryablePayload<Types>,

source§

fn from_row(row: &'r <Db as Database>::Row) -> Result<Self>

source§

impl<Types> HeightIndexed for VidCommonMetadata<Types>
where Types: NodeType,

source§

fn height(&self) -> u64

source§

impl<Types> PartialEq for VidCommonMetadata<Types>
where Types: NodeType + PartialEq,

source§

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

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

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

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

impl<Types> Copy for VidCommonMetadata<Types>
where diff --git a/hotshot_query_service/availability/struct.VidCommonQueryData.html b/hotshot_query_service/availability/struct.VidCommonQueryData.html index 9714dd1c8..da397c3af 100644 --- a/hotshot_query_service/availability/struct.VidCommonQueryData.html +++ b/hotshot_query_service/availability/struct.VidCommonQueryData.html @@ -1,11 +1,11 @@ -VidCommonQueryData in hotshot_query_service::availability - Rust
pub struct VidCommonQueryData<Types: NodeType> { /* private fields */ }

Implementations§

source§

impl<Types: NodeType> VidCommonQueryData<Types>

source

pub fn new(header: Header<Types>, common: VidCommon) -> Self

source

pub async fn genesis( +VidCommonQueryData in hotshot_query_service::availability - Rust
pub struct VidCommonQueryData<Types: NodeType> { /* private fields */ }

Implementations§

source§

impl<Types: NodeType> VidCommonQueryData<Types>

source

pub fn new(header: Header<Types>, common: VidCommon) -> Self

source

pub async fn genesis( validated_state: &Types::ValidatedState, instance_state: &Types::InstanceState, ) -> Self

source

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

source

pub fn payload_hash(&self) -> VidCommitment

source

pub fn common(&self) -> &VidCommon

Trait Implementations§

source§

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

source§

fn clone(&self) -> VidCommonQueryData<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 VidCommonQueryData<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 VidCommonQueryData<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> From<VidCommonQueryData<Types>> for VidCommonMetadata<Types>
where - Types: NodeType,

source§

fn from(common: VidCommonQueryData<Types>) -> Self

Converts to this type from the input type.
source§

impl<'r, Types> FromRow<'r, <Postgres as Database>::Row> for VidCommonQueryData<Types>
where + Types: NodeType,

source§

fn from(common: VidCommonQueryData<Types>) -> Self

Converts to this type from the input type.
source§

impl<'r, Types> FromRow<'r, <Sqlite as Database>::Row> for VidCommonQueryData<Types>
where Types: NodeType, - Payload<Types>: QueryablePayload<Types>,

source§

fn from_row(row: &'r <Db as Database>::Row) -> Result<Self>

source§

impl<Types: NodeType> HeightIndexed for VidCommonQueryData<Types>

source§

fn height(&self) -> u64

source§

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

source§

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

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

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

Tests for !=. The default implementation is almost always sufficient, + Payload<Types>: QueryablePayload<Types>,

source§

fn from_row(row: &'r <Db as Database>::Row) -> Result<Self>

source§

impl<Types: NodeType> HeightIndexed for VidCommonQueryData<Types>

source§

fn height(&self) -> u64

source§

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

source§

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

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

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

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

impl<Types: NodeType> Serialize for VidCommonQueryData<Types>

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 VidCommonQueryData<Types>

source§

impl<Types: NodeType> StructuralPartialEq for VidCommonQueryData<Types>

Auto Trait Implementations§

§

impl<Types> Freeze for VidCommonQueryData<Types>

§

impl<Types> RefUnwindSafe for VidCommonQueryData<Types>

§

impl<Types> Send for VidCommonQueryData<Types>

§

impl<Types> Sync for VidCommonQueryData<Types>

§

impl<Types> Unpin for VidCommonQueryData<Types>

§

impl<Types> UnwindSafe for VidCommonQueryData<Types>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> ArchivePointee for T

§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
§

fn pointer_metadata( diff --git a/hotshot_query_service/data_source/fetching/struct.FetchingDataSource.html b/hotshot_query_service/data_source/fetching/struct.FetchingDataSource.html index 65a269bdc..c6f5f8740 100644 --- a/hotshot_query_service/data_source/fetching/struct.FetchingDataSource.html +++ b/hotshot_query_service/data_source/fetching/struct.FetchingDataSource.html @@ -56,11 +56,11 @@ 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, P: AvailabilityProvider<Types>> FetchingDataSource<Types, SqlStorage, P>
where +

source§

impl<Types, P: AvailabilityProvider<Types>> FetchingDataSource<Types, SqlStorage, P>
where Types: NodeType, Header<Types>: QueryableHeader<Types>, - Payload<Types>: QueryablePayload<Types>,

source

pub async fn connect( - config: Config, + Payload<Types>: QueryablePayload<Types>,

source

pub async fn connect( + config: Config, provider: P, ) -> Result<Builder<Types, P>, Error>

Connect to a remote database.

This function returns a fetching::Builder which can be used to set options on the diff --git a/hotshot_query_service/data_source/sql/index.html b/hotshot_query_service/data_source/sql/index.html index d4f92606b..cab893742 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

Module hotshot_query_service::data_source::sql

source ·

Re-exports§

Modules§

Macros§

Structs§

  • The Error type, a wrapper around a dynamic error type.
  • Represents a schema migration to be run on the database, +hotshot_query_service::data_source::sql - Rust

    Module hotshot_query_service::data_source::sql

    source ·

    Re-exports§

    Modules§

    Macros§

    • Embed migrations from the given directory into the current binary for PostgreSQL or SQLite.

    Structs§

    • 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

    Type Aliases§

    • A data source for the APIs provided in this crate, backed by a remote PostgreSQL database.
    \ No newline at end of file +and shouldn’t be needed by the user

Type Aliases§

\ 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 928b73bb6..444595ab5 100644 --- a/hotshot_query_service/data_source/sql/macro.include_migrations.html +++ b/hotshot_query_service/data_source/sql/macro.include_migrations.html @@ -1,6 +1,6 @@ -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.

+}
Expand description

Embed migrations from the given directory into the current binary for PostgreSQL or SQLite.

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 @@ -10,14 +10,24 @@ 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.

+hotshot-query-service crate. The migrations are located in a directory called migrations at

+
    +
  • PostgreSQL migrations are in /migrations/postgres.
  • +
  • SQLite migrations are in /migrations/sqlite.
  • +
-
let mut migrations: Vec<Migration> =
-    include_migrations!("$CARGO_MANIFEST_DIR/migrations").collect();
-migrations.sort();
-assert_eq!(migrations[0].version(), 10);
-assert_eq!(migrations[0].name(), "init_schema");
+
// For PostgreSQL
+#[cfg(not(feature = "embedded-db"))]
+ let mut migrations: Vec<Migration> =
+    include_migrations!("$CARGO_MANIFEST_DIR/migrations/postgres").collect();
+// For SQLite
+#[cfg(feature = "embedded-db")]
+let mut migrations: Vec<Migration> =
+    include_migrations!("$CARGO_MANIFEST_DIR/migrations/sqlite").collect();
+    
+    migrations.sort();
+    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 diff --git a/hotshot_query_service/data_source/sql/sidebar-items.js b/hotshot_query_service/data_source/sql/sidebar-items.js index 28a09231f..6665b3d60 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 = {"macro":["include_migrations"],"mod":["testing"],"struct":["Error","Migration"],"type":["Builder","SqlDataSource"]}; \ No newline at end of file +window.SIDEBAR_ITEMS = {"macro":["include_migrations"],"mod":["testing"],"struct":["Error","Migration"],"type":["Builder","Config","SqlDataSource"]}; \ No newline at end of file diff --git a/hotshot_query_service/data_source/sql/testing/index.html b/hotshot_query_service/data_source/sql/testing/index.html index bddd5c23d..93f935aa0 100644 --- a/hotshot_query_service/data_source/sql/testing/index.html +++ b/hotshot_query_service/data_source/sql/testing/index.html @@ -1 +1 @@ -hotshot_query_service::data_source::sql::testing - Rust

Module hotshot_query_service::data_source::sql::testing

source ·

Re-exports§

  • pub use sql::testing::TmpDb;
\ No newline at end of file +hotshot_query_service::data_source::sql::testing - Rust

Module hotshot_query_service::data_source::sql::testing

source ·

Re-exports§

  • pub use sql::testing::TmpDb;
\ No newline at end of file diff --git a/hotshot_query_service/data_source/sql/type.Config.html b/hotshot_query_service/data_source/sql/type.Config.html new file mode 100644 index 000000000..e1b4f24fa --- /dev/null +++ b/hotshot_query_service/data_source/sql/type.Config.html @@ -0,0 +1,16 @@ +Config in hotshot_query_service::data_source::sql - Rust

Type Alias hotshot_query_service::data_source::sql::Config

source ·
pub type Config = Config;

Aliased Type§

struct Config { /* private fields */ }

Implementations§

source§

impl Config

source

pub async fn connect<Types, P: AvailabilityProvider<Types>>( + self, + provider: P, +) -> Result<SqlDataSource<Types, P>, Error>
where + Types: NodeType, + Header<Types>: QueryableHeader<Types>, + Payload<Types>: QueryablePayload<Types>,

Connect to the database with this config.

+
source

pub async fn builder<Types, P: AvailabilityProvider<Types>>( + self, + provider: P, +) -> Result<Builder<Types, P>, Error>
where + Types: NodeType, + Header<Types>: QueryableHeader<Types>, + Payload<Types>: QueryablePayload<Types>,

Connect to the database, setting options on the underlying FetchingDataSource using the +fetching::Builder interface.

+
\ No newline at end of file diff --git a/hotshot_query_service/data_source/sql/type.SqlDataSource.html b/hotshot_query_service/data_source/sql/type.SqlDataSource.html index b237cca9e..43821817b 100644 --- a/hotshot_query_service/data_source/sql/type.SqlDataSource.html +++ b/hotshot_query_service/data_source/sql/type.SqlDataSource.html @@ -1,4 +1,4 @@ -SqlDataSource in hotshot_query_service::data_source::sql - Rust

Type Alias hotshot_query_service::data_source::sql::SqlDataSource

source ·
pub type SqlDataSource<Types, P> = FetchingDataSource<Types, SqlStorage, P>;
Expand description

A data source for the APIs provided in this crate, backed by a remote PostgreSQL database.

+SqlDataSource in hotshot_query_service::data_source::sql - Rust

Type Alias hotshot_query_service::data_source::sql::SqlDataSource

source ·
pub type SqlDataSource<Types, P> = FetchingDataSource<Types, SqlStorage, P>;
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 @@ -9,11 +9,13 @@

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

+[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 +

When creating a PostgreSQL SqlDataSource, the caller can use Config to specify the host, user, and +database for the connection. If the embedded-db feature is enabled, the caller can instead specify the +file path for an SQLite database. +As such, SqlDataSource is not very opinionated about how the +database 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 @@ -25,13 +27,20 @@

§Initi 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:

+

For SQLite, simply provide the file path, and the file will be created if it does not already exist.

+

One could then connect to this database with the following Config for postgres:

-
Config::default()
+
#[cfg(not(feature= "embedded-db"))]
+Config::default()
     .host("postgres.database.hostname")
     .database("hotshot_query_service")
     .user("hotshot_user")
     .password("password")
+

Or, if the embedded-db feature is enabled, configure it as follows for SQLite:

+ +
#[cfg(feature= "embedded-db")]
+Config::default()
+    .db_path("temp.db".into())

§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 @@ -157,29 +166,29 @@

§Composition Ok(app) }

-

Aliased Type§

struct SqlDataSource<Types, P> { /* private fields */ }

Implementations§

source§

impl<Types, P: AvailabilityProvider<Types>> SqlDataSource<Types, P>
where +

Aliased Type§

struct SqlDataSource<Types, P> { /* private fields */ }

Implementations§

source§

impl<Types, P: AvailabilityProvider<Types>> SqlDataSource<Types, P>
where Types: NodeType, Header<Types>: QueryableHeader<Types>, - Payload<Types>: QueryablePayload<Types>,

source

pub async fn connect( - config: Config, + Payload<Types>: QueryablePayload<Types>,

source

pub async fn connect( + config: Config, provider: P, ) -> Result<Builder<Types, P>, Error>

Connect to a remote database.

This function returns a fetching::Builder which can be used to set options on the underlying FetchingDataSource, before constructing the SqlDataSource with build. For a convenient constructor that uses the default fetching options, see Config::connect.

-

Trait Implementations§

source§

impl<P: AvailabilityProvider<MockTypes> + Default> DataSourceLifeCycle for SqlDataSource<MockTypes, P>

source§

type Storage = TmpDb

Backing storage for the data source. Read more
source§

fn create<'async_trait>( +

Trait Implementations§

source§

impl<P: AvailabilityProvider<MockTypes> + Default> DataSourceLifeCycle for SqlDataSource<MockTypes, P>

source§

type Storage = TmpDb

Backing storage for the data source. Read more
source§

fn create<'async_trait>( _node_id: usize, ) -> Pin<Box<dyn Future<Output = Self::Storage> + Send + 'async_trait>>
where - Self: 'async_trait,

source§

fn connect<'life0, 'async_trait>( + Self: 'async_trait,

source§

fn connect<'life0, 'async_trait>( tmp_db: &'life0 Self::Storage, ) -> Pin<Box<dyn Future<Output = Self> + Send + 'async_trait>>
where Self: 'async_trait, - 'life0: 'async_trait,

source§

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

source§

fn reset<'life0, 'async_trait>( tmp_db: &'life0 Self::Storage, ) -> Pin<Box<dyn Future<Output = Self> + Send + 'async_trait>>
where Self: 'async_trait, - 'life0: 'async_trait,

source§

fn handle_event<'life0, 'life1, 'async_trait>( + 'life0: 'async_trait,

source§

fn handle_event<'life0, 'life1, 'async_trait>( &'life0 self, event: &'life1 Event<MockTypes>, ) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>
where diff --git a/hotshot_query_service/data_source/storage/pruning/trait.PruneStorage.html b/hotshot_query_service/data_source/storage/pruning/trait.PruneStorage.html index d18a3a2b9..38e3940a6 100644 --- a/hotshot_query_service/data_source/storage/pruning/trait.PruneStorage.html +++ b/hotshot_query_service/data_source/storage/pruning/trait.PruneStorage.html @@ -24,6 +24,6 @@ ) -> Pin<Box<dyn Future<Output = Result<Option<u64>>> + Send + 'async_trait>>
where Self: Sync + 'async_trait, 'life0: 'async_trait, - 'life1: 'async_trait,

Implementors§

source§

impl PruneStorage for NoStorage

source§

impl PruneStorage for SqlStorage

source§

impl<S> PruneStorage for FailStorage<S>
where + 'life1: 'async_trait,

Implementors§

source§

impl PruneStorage for NoStorage

source§

impl PruneStorage for SqlStorage

source§

impl<S> PruneStorage for FailStorage<S>
where S: PruneStorage + Sync,

source§

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

\ No newline at end of file diff --git a/hotshot_query_service/data_source/storage/pruning/trait.PrunedHeightStorage.html b/hotshot_query_service/data_source/storage/pruning/trait.PrunedHeightStorage.html index 9dba0fd0d..128f80a2c 100644 --- a/hotshot_query_service/data_source/storage/pruning/trait.PrunedHeightStorage.html +++ b/hotshot_query_service/data_source/storage/pruning/trait.PrunedHeightStorage.html @@ -9,5 +9,5 @@ &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<Option<u64>>> + Send + 'async_trait>>
where Self: Send + 'async_trait, - 'life0: 'async_trait,

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<'a> PrunedHeightStorage for hotshot_query_service::data_source::storage::no_storage::Transaction<'a>

source§

impl<Mode: TransactionMode> PrunedHeightStorage for hotshot_query_service::data_source::storage::sql::Transaction<Mode>

source§

impl<T> PrunedHeightStorage for hotshot_query_service::data_source::storage::fail_storage::Transaction<T>
where + 'life0: 'async_trait,

Object Safety§

This trait is not object safe.

Implementors§

source§

impl<'a> PrunedHeightStorage for hotshot_query_service::data_source::storage::no_storage::Transaction<'a>

source§

impl<Mode: TransactionMode> PrunedHeightStorage for hotshot_query_service::data_source::storage::sql::Transaction<Mode>

source§

impl<T> PrunedHeightStorage for hotshot_query_service::data_source::storage::fail_storage::Transaction<T>

source§

impl<T: Revert> PrunedHeightStorage for hotshot_query_service::data_source::storage::fs::Transaction<T>

\ No newline at end of file diff --git a/hotshot_query_service/data_source/storage/pruning/trait.PrunerConfig.html b/hotshot_query_service/data_source/storage/pruning/trait.PrunerConfig.html index d2bb8d5a6..4894e1a9d 100644 --- a/hotshot_query_service/data_source/storage/pruning/trait.PrunerConfig.html +++ b/hotshot_query_service/data_source/storage/pruning/trait.PrunerConfig.html @@ -2,6 +2,6 @@ // Provided methods fn set_pruning_config(&mut self, _cfg: PrunerCfg) { ... } fn get_pruning_config(&self) -> Option<PrunerCfg> { ... } -}

Provided Methods§

source

fn set_pruning_config(&mut self, _cfg: PrunerCfg)

source

fn get_pruning_config(&self) -> Option<PrunerCfg>

Implementors§

source§

impl PrunerConfig for NoStorage

source§

impl PrunerConfig for SqlStorage

source§

impl<S> PrunerConfig for FailStorage<S>
where +}

Provided Methods§

Implementors§

\ No newline at end of file diff --git a/hotshot_query_service/data_source/storage/sql/db/syntax_helpers/constant.BINARY_TYPE.html b/hotshot_query_service/data_source/storage/sql/db/syntax_helpers/constant.BINARY_TYPE.html new file mode 100644 index 000000000..0e309a288 --- /dev/null +++ b/hotshot_query_service/data_source/storage/sql/db/syntax_helpers/constant.BINARY_TYPE.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../../../hotshot_query_service/data_source/storage/sql/syntax_helpers/constant.BINARY_TYPE.html...

+ + + \ No newline at end of file diff --git a/hotshot_query_service/data_source/storage/sql/db/syntax_helpers/constant.MAX_FN.html b/hotshot_query_service/data_source/storage/sql/db/syntax_helpers/constant.MAX_FN.html new file mode 100644 index 000000000..c6d2bbdcb --- /dev/null +++ b/hotshot_query_service/data_source/storage/sql/db/syntax_helpers/constant.MAX_FN.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../../../hotshot_query_service/data_source/storage/sql/syntax_helpers/constant.MAX_FN.html...

+ + + \ No newline at end of file diff --git a/hotshot_query_service/data_source/storage/sql/db/syntax_helpers/index.html b/hotshot_query_service/data_source/storage/sql/db/syntax_helpers/index.html new file mode 100644 index 000000000..7b1185baa --- /dev/null +++ b/hotshot_query_service/data_source/storage/sql/db/syntax_helpers/index.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../../../hotshot_query_service/data_source/storage/sql/syntax_helpers/index.html...

+ + + \ No newline at end of file diff --git a/hotshot_query_service/data_source/storage/sql/fn.build_where_in.html b/hotshot_query_service/data_source/storage/sql/fn.build_where_in.html new file mode 100644 index 000000000..b073cb16f --- /dev/null +++ b/hotshot_query_service/data_source/storage/sql/fn.build_where_in.html @@ -0,0 +1,7 @@ +build_where_in in hotshot_query_service::data_source::storage::sql - Rust
pub fn build_where_in<'a, I>(
+    query: &'a str,
+    column: &'a str,
+    values: I,
+) -> QueryResult<(QueryBuilder<'a>, String)>
where + I: IntoIterator, + I::Item: 'a + Encode<'a, Db> + Type<Db>,
\ 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 index cf86fbe50..330c35b7f 100644 --- a/hotshot_query_service/data_source/storage/sql/fn.default_migrations.html +++ b/hotshot_query_service/data_source/storage/sql/fn.default_migrations.html @@ -1,2 +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.

+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 index 31ec25999..10362bd8e 100644 --- a/hotshot_query_service/data_source/storage/sql/index.html +++ b/hotshot_query_service/data_source/storage/sql/index.html @@ -1,4 +1,4 @@ -hotshot_query_service::data_source::storage::sql - Rust

Module hotshot_query_service::data_source::storage::sql

source ·

Re-exports§

  • pub extern crate sqlx;

Modules§

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, +hotshot_query_service::data_source::storage::sql - Rust

    Module hotshot_query_service::data_source::storage::sql

    source ·

    Re-exports§

    • pub extern crate sqlx;

    Modules§

    Macros§

    • Embed the contents of a directory in your crate.
    • Embed migrations from the given directory into the current binary for PostgreSQL or SQLite.

    Structs§

    • 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
    • Helper type for programatically constructing queries.
    • Marker type indicating a transaction with read-only access to the database.
    • Storage for the APIs provided in this crate, backed by a remote PostgreSQL database.
    • Sqlite database driver.
    • An atomic SQL transaction.
    • Marker type indicating a transaction with read-write access to the database.

    Traits§

    • A database driver.
    • A type that contains or can provide a database -connection to use for executing queries against the database.
    • A collection of parameters with a statically known length.
    • A collection of parameters which can be bound to a SQL query.
    • Trait for marker types indicating what type of access a transaction has to the database.

    Functions§

    Type Aliases§

    \ No newline at end of file +connection to use for executing queries against the database.
  • A collection of parameters with a statically known length.
  • A collection of parameters which can be bound to a SQL query.
  • Trait for marker types indicating what type of access a transaction has to the database.

Functions§

Type Aliases§

\ 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 index 84b412dd8..06361557a 100644 --- a/hotshot_query_service/data_source/storage/sql/macro.include_migrations.html +++ b/hotshot_query_service/data_source/storage/sql/macro.include_migrations.html @@ -1,6 +1,6 @@ -include_migrations in hotshot_query_service::data_source::storage::sql - Rust
macro_rules! include_migrations {
+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.

+}
Expand description

Embed migrations from the given directory into the current binary for PostgreSQL or SQLite.

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 @@ -10,14 +10,24 @@ 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.

+hotshot-query-service crate. The migrations are located in a directory called migrations at

+
    +
  • PostgreSQL migrations are in /migrations/postgres.
  • +
  • SQLite migrations are in /migrations/sqlite.
  • +
-
let mut migrations: Vec<Migration> =
-    include_migrations!("$CARGO_MANIFEST_DIR/migrations").collect();
-migrations.sort();
-assert_eq!(migrations[0].version(), 10);
-assert_eq!(migrations[0].name(), "init_schema");
+
// For PostgreSQL
+#[cfg(not(feature = "embedded-db"))]
+ let mut migrations: Vec<Migration> =
+    include_migrations!("$CARGO_MANIFEST_DIR/migrations/postgres").collect();
+// For SQLite
+#[cfg(feature = "embedded-db")]
+let mut migrations: Vec<Migration> =
+    include_migrations!("$CARGO_MANIFEST_DIR/migrations/sqlite").collect();
+    
+    migrations.sort();
+    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 diff --git a/hotshot_query_service/data_source/storage/sql/sidebar-items.js b/hotshot_query_service/data_source/storage/sql/sidebar-items.js index 879ce5937..012e75c51 100644 --- a/hotshot_query_service/data_source/storage/sql/sidebar-items.js +++ b/hotshot_query_service/data_source/storage/sql/sidebar-items.js @@ -1 +1 @@ -window.SIDEBAR_ITEMS = {"externcrate":["sqlx"],"fn":["default_migrations","query","query_as"],"macro":["include_dir","include_migrations"],"mod":["testing"],"struct":["Config","Error","Migration","Pruner","QueryBuilder","Read","SqlStorage","Sqlite","Transaction","Write"],"trait":["Database","Executor","FixedLengthParams","Params","TransactionMode"],"type":["Db","Query","QueryAs"]}; \ No newline at end of file +window.SIDEBAR_ITEMS = {"externcrate":["sqlx"],"fn":["build_where_in","default_migrations","query","query_as"],"macro":["include_dir","include_migrations"],"mod":["syntax_helpers","testing"],"struct":["Config","Error","Migration","Pruner","QueryBuilder","Read","SqlStorage","Sqlite","Transaction","Write"],"trait":["Database","Executor","FixedLengthParams","Params","TransactionMode"],"type":["Db","Query","QueryAs"]}; \ No newline at end of file diff --git a/hotshot_query_service/data_source/storage/sql/struct.Config.html b/hotshot_query_service/data_source/storage/sql/struct.Config.html index 95a8c6222..159b4861f 100644 --- a/hotshot_query_service/data_source/storage/sql/struct.Config.html +++ b/hotshot_query_service/data_source/storage/sql/struct.Config.html @@ -1,12 +1,11 @@ -Config in hotshot_query_service::data_source::storage::sql - Rust

Struct hotshot_query_service::data_source::storage::sql::Config

source ·
pub struct Config { /* private fields */ }
Expand description

Postgres client config.

-

Implementations§

source§

impl Config

source

pub async fn connect<Types, P: AvailabilityProvider<Types>>( +Config in hotshot_query_service::data_source::storage::sql - Rust

Struct hotshot_query_service::data_source::storage::sql::Config

source ·
pub struct Config { /* private fields */ }

Implementations§

source§

impl Config

source

pub async fn connect<Types, P: AvailabilityProvider<Types>>( self, provider: P, ) -> Result<SqlDataSource<Types, P>, Error>
where Types: NodeType, Header<Types>: QueryableHeader<Types>, Payload<Types>: QueryablePayload<Types>,

Connect to the database with this config.

-
source

pub async fn builder<Types, P: AvailabilityProvider<Types>>( +

source

pub async fn builder<Types, P: AvailabilityProvider<Types>>( self, provider: P, ) -> Result<Builder<Types, P>, Error>
where @@ -14,55 +13,44 @@ Header<Types>: QueryableHeader<Types>, Payload<Types>: QueryablePayload<Types>,

Connect to the database, setting options on the underlying FetchingDataSource using the fetching::Builder interface.

-

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.

-

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 tls(self) -> Self

Use TLS for an encrypted connection to the database.

-

Note that an encrypted connection may be established even if this option is not set, as long -as both the client and server support it. This option merely causes connection to fail if an -encrypted stream cannot be established.

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

+
source§

impl Config

source

pub fn busy_timeout(self, timeout: Duration) -> Self

source

pub fn db_path(self, path: PathBuf) -> Self

source§

impl Config

source

pub fn pool(self, pool: Pool<Db>) -> Self

Sets the database connection pool +This allows reusing an existing connection pool when building a new SqlStorage instance.

+
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 +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 pruner_cfg(self, cfg: PrunerCfg) -> Result<Self, Error>

Enable pruning with a given configuration.

+
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 pruner_cfg(self, cfg: PrunerCfg) -> Result<Self, Error>

Enable pruning with a given configuration.

If archive was previously specified, this will override it.

-
source

pub fn archive(self) -> Self

Disable pruning and reconstruct previously pruned data.

+
source

pub fn archive(self) -> Self

Disable pruning and reconstruct previously pruned data.

While running without pruning is the default behavior, the default will not try to reconstruct data that was pruned in a previous run where pruning was enabled. This option instructs the service to run without pruning and reconstruct all previously pruned data by fetching from peers.

If pruner_cfg was previously specified, this will override it.

-
source

pub fn idle_connection_timeout(self, timeout: Duration) -> Self

Set the maximum idle time of a connection.

+
source

pub fn idle_connection_timeout(self, timeout: Duration) -> Self

Set the maximum idle time of a connection.

Any connection which has been open and unused longer than this duration will be automatically closed to reduce load on the server.

-
source

pub fn connection_timeout(self, timeout: Duration) -> Self

Set the maximum lifetime of a connection.

+
source

pub fn connection_timeout(self, timeout: Duration) -> Self

Set the maximum lifetime of a connection.

Any connection which has been open longer than this duration will be automatically closed (and, if needed, replaced), even if it is otherwise healthy. It is good practice to refresh even healthy connections once in a while (e.g. daily) in case of resource leaks in the server implementation.

-
source

pub fn min_connections(self, min: u32) -> Self

Set the minimum number of connections to maintain at any time.

+
source

pub fn min_connections(self, min: u32) -> Self

Set the minimum number of connections to maintain at any time.

The data source will, to the best of its ability, maintain at least min open connections at all times. This can be used to reduce the latency hit of opening new connections when at least this many simultaneous connections are frequently needed.

-
source

pub fn max_connections(self, max: u32) -> Self

Set the maximum number of connections to maintain at any time.

+
source

pub fn max_connections(self, max: u32) -> Self

Set the maximum number of connections to maintain at any time.

Once max connections are in use simultaneously, further attempts to acquire a connection (or begin a transaction) will block until one of the existing connections is released.

-
source

pub fn slow_statement_threshold(self, threshold: Duration) -> Self

Log at WARN level any time a SQL statement takes longer than threshold.

+
source

pub fn slow_statement_threshold(self, threshold: Duration) -> Self

Log at WARN level any time a SQL statement takes longer than threshold.

The default threshold is 1s.

-

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<PgConnectOptions> for Config

source§

fn from(db_opt: PgConnectOptions) -> Self

Converts to this type from the input type.
source§

impl FromStr for Config

source§

type Err = <PgConnectOptions 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§

§

impl Freeze for Config

§

impl !RefUnwindSafe for Config

§

impl Send for Config

§

impl Sync for Config

§

impl Unpin for Config

§

impl !UnwindSafe for Config

Blanket Implementations§

source§

impl<T> Any for T
where +

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 Default for Config

source§

fn default() -> Self

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

impl From<SqliteConnectOptions> for Config

source§

fn from(db_opt: SqliteConnectOptions) -> Self

Converts to this type from the input type.
source§

impl FromStr for Config

source§

type Err = <SqliteConnectOptions 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§

§

impl Freeze for Config

§

impl !RefUnwindSafe for Config

§

impl Send for Config

§

impl Sync for Config

§

impl Unpin for Config

§

impl !UnwindSafe for Config

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> ArchivePointee for T

§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where diff --git a/hotshot_query_service/data_source/storage/sql/struct.Pruner.html b/hotshot_query_service/data_source/storage/sql/struct.Pruner.html index 58e73f66a..bcfd57c51 100644 --- a/hotshot_query_service/data_source/storage/sql/struct.Pruner.html +++ b/hotshot_query_service/data_source/storage/sql/struct.Pruner.html @@ -1,4 +1,4 @@ -Pruner in hotshot_query_service::data_source::storage::sql - Rust

Struct hotshot_query_service::data_source::storage::sql::Pruner

source ·
pub struct Pruner { /* private fields */ }

Trait Implementations§

source§

impl Debug for Pruner

source§

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

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

impl Default for Pruner

source§

fn default() -> Pruner

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

Auto Trait Implementations§

§

impl Freeze for Pruner

§

impl RefUnwindSafe for Pruner

§

impl Send for Pruner

§

impl Sync for Pruner

§

impl Unpin for Pruner

§

impl UnwindSafe for Pruner

Blanket Implementations§

source§

impl<T> Any for T
where +Pruner in hotshot_query_service::data_source::storage::sql - Rust

Struct hotshot_query_service::data_source::storage::sql::Pruner

source ·
pub struct Pruner { /* private fields */ }

Trait Implementations§

source§

impl Debug for Pruner

source§

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

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

impl Default for Pruner

source§

fn default() -> Pruner

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

Auto Trait Implementations§

§

impl Freeze for Pruner

§

impl RefUnwindSafe for Pruner

§

impl Send for Pruner

§

impl Sync for Pruner

§

impl Unpin for Pruner

§

impl UnwindSafe for Pruner

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> ArchivePointee for T

§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where diff --git a/hotshot_query_service/data_source/storage/sql/struct.QueryBuilder.html b/hotshot_query_service/data_source/storage/sql/struct.QueryBuilder.html index 06754e0f7..51329ab43 100644 --- a/hotshot_query_service/data_source/storage/sql/struct.QueryBuilder.html +++ b/hotshot_query_service/data_source/storage/sql/struct.QueryBuilder.html @@ -1,4 +1,4 @@ -QueryBuilder in hotshot_query_service::data_source::storage::sql - Rust
pub struct QueryBuilder<'q> { /* private fields */ }
Expand description

Helper type for programatically constructing queries.

+QueryBuilder in hotshot_query_service::data_source::storage::sql - Rust
pub struct QueryBuilder<'q> { /* private fields */ }
Expand description

Helper type for programatically constructing queries.

This type can be used to bind arguments of various types, similar to Query or QueryAs. With QueryBuilder, though, the arguments are bound first and the SQL statement is given last. Each time an argument is bound, a SQL fragment is returned as a string which can be used @@ -24,22 +24,22 @@

§Example

.await?; Ok(results) }
-

Implementations§

source§

impl<'q> QueryBuilder<'q>

source

pub fn bind<T>(&mut self, arg: T) -> QueryResult<String>
where +

Implementations§

source§

impl<'q> QueryBuilder<'q>

source

pub fn bind<T>(&mut self, arg: T) -> QueryResult<String>
where T: 'q + Encode<'q, Db> + Type<Db>,

Add an argument and return its name as a formal parameter in a SQL prepared statement.

-
source

pub fn query(self, sql: &'q str) -> Query<'q>

Finalize the query with a constructed SQL statement.

-
source

pub fn query_as<T>(self, sql: &'q str) -> QueryAs<'q, T>
where +

source

pub fn query(self, sql: &'q str) -> Query<'q>

Finalize the query with a constructed SQL statement.

+
source

pub fn query_as<T>(self, sql: &'q str) -> QueryAs<'q, T>
where T: for<'r> FromRow<'r, <Db as Database>::Row>,

Finalize the query with a constructed SQL statement and a specified output type.

-
source§

impl<'q> QueryBuilder<'q>

source

pub fn header_where_clause<Types: NodeType>( +

source§

impl<'q> QueryBuilder<'q>

source

pub fn header_where_clause<Types: NodeType>( &mut self, id: BlockId<Types>, ) -> QueryResult<String>

Construct a SQL WHERE clause which filters for a header exactly matching id.

-
source

pub fn bounds_to_where_clause<R>( +

source

pub fn bounds_to_where_clause<R>( &mut self, range: R, column: &str, ) -> QueryResult<String>
where R: RangeBounds<usize>,

Convert range bounds to a SQL WHERE clause constraining a given column.

-

Trait Implementations§

source§

impl<'q> Debug for QueryBuilder<'q>

source§

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

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

impl<'q> Default for QueryBuilder<'q>

source§

fn default() -> QueryBuilder<'q>

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

Auto Trait Implementations§

§

impl<'q> Freeze for QueryBuilder<'q>

§

impl<'q> !RefUnwindSafe for QueryBuilder<'q>

§

impl<'q> Send for QueryBuilder<'q>

§

impl<'q> Sync for QueryBuilder<'q>

§

impl<'q> Unpin for QueryBuilder<'q>

§

impl<'q> !UnwindSafe for QueryBuilder<'q>

Blanket Implementations§

source§

impl<T> Any for T
where +

Trait Implementations§

source§

impl<'q> Debug for QueryBuilder<'q>

source§

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

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

impl<'q> Default for QueryBuilder<'q>

source§

fn default() -> QueryBuilder<'q>

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

Auto Trait Implementations§

§

impl<'q> Freeze for QueryBuilder<'q>

§

impl<'q> RefUnwindSafe for QueryBuilder<'q>

§

impl<'q> Send for QueryBuilder<'q>

§

impl<'q> Sync for QueryBuilder<'q>

§

impl<'q> Unpin for QueryBuilder<'q>

§

impl<'q> UnwindSafe for QueryBuilder<'q>

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> ArchivePointee for T

§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where diff --git a/hotshot_query_service/data_source/storage/sql/struct.Read.html b/hotshot_query_service/data_source/storage/sql/struct.Read.html index 92e1e80bd..a6b1bc274 100644 --- a/hotshot_query_service/data_source/storage/sql/struct.Read.html +++ b/hotshot_query_service/data_source/storage/sql/struct.Read.html @@ -1,5 +1,5 @@ Read in hotshot_query_service::data_source::storage::sql - Rust

Struct hotshot_query_service::data_source::storage::sql::Read

source ·
pub struct Read;
Expand description

Marker type indicating a transaction with read-only access to the database.

-

Trait Implementations§

source§

impl Clone for Read

source§

fn clone(&self) -> Read

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 Read

source§

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

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

impl Default for Read

source§

fn default() -> Read

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

impl TransactionMode for Read

source§

async fn begin(conn: &mut <Db as Database>::Connection) -> Result<()>

source§

fn display() -> &'static str

source§

impl Copy for Read

Auto Trait Implementations§

§

impl Freeze for Read

§

impl RefUnwindSafe for Read

§

impl Send for Read

§

impl Sync for Read

§

impl Unpin for Read

§

impl UnwindSafe for Read

Blanket Implementations§

source§

impl<T> Any for T
where +

Trait Implementations§

source§

impl Clone for Read

source§

fn clone(&self) -> Read

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 Read

source§

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

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

impl Default for Read

source§

fn default() -> Read

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

impl TransactionMode for Read

source§

async fn begin(conn: &mut <Db as Database>::Connection) -> Result<()>

source§

fn display() -> &'static str

source§

impl Copy for Read

Auto Trait Implementations§

§

impl Freeze for Read

§

impl RefUnwindSafe for Read

§

impl Send for Read

§

impl Sync for Read

§

impl Unpin for Read

§

impl UnwindSafe for Read

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> ArchivePointee for T

§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where diff --git a/hotshot_query_service/data_source/storage/sql/struct.SqlStorage.html b/hotshot_query_service/data_source/storage/sql/struct.SqlStorage.html index de45ec01e..ae6db1243 100644 --- a/hotshot_query_service/data_source/storage/sql/struct.SqlStorage.html +++ b/hotshot_query_service/data_source/storage/sql/struct.SqlStorage.html @@ -1,6 +1,6 @@ -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.

-

Trait Implementations§

source§

impl Debug for SqlStorage

source§

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

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

impl HasMetrics for SqlStorage

source§

impl PruneStorage for SqlStorage

source§

fn prune<'life0, 'life1, 'async_trait>( +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 fn pool(&self) -> Pool<Db>

source

pub async fn connect(config: Config) -> Result<Self, Error>

Connect to a remote database.

+

Trait Implementations§

source§

impl Clone for SqlStorage

source§

fn clone(&self) -> SqlStorage

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 SqlStorage

source§

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

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

impl HasMetrics for SqlStorage

source§

impl PruneStorage for SqlStorage

source§

fn prune<'life0, 'life1, 'async_trait>( &'life0 self, pruner: &'life1 mut Pruner, ) -> Pin<Box<dyn Future<Output = Result<Option<u64>>> + Send + 'async_trait>>
where @@ -10,15 +10,15 @@ This is because a vacuum operation may be necessary to reclaim more space. PostgreSQL already performs auto vacuuming, so we are not including it here as running a vacuum operation can be resource-intensive.

-

source§

type Pruner = Pruner

source§

fn get_disk_usage<'life0, 'async_trait>( +

source§

type Pruner = Pruner

source§

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

source§

impl PrunerConfig for SqlStorage

source§

impl VersionedDataSource for SqlStorage

source§

type Transaction<'a> = Transaction<Write> + 'life0: 'async_trait,

source§

impl PrunerConfig for SqlStorage

source§

impl VersionedDataSource for SqlStorage

source§

type Transaction<'a> = Transaction<Write> where - Self: 'a

A transaction which can read and modify the data source.
source§

type ReadOnly<'a> = Transaction<Read> + Self: 'a

A transaction which can read and modify the data source.
source§

type ReadOnly<'a> = Transaction<Read> where - Self: 'a

source§

async fn write(&self) -> Result<Transaction<Write>>

Start an atomic transaction on the data source.
source§

async fn read(&self) -> Result<Transaction<Read>>

Start a read-only transaction on the data source. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where + Self: 'a

source§

async fn write(&self) -> Result<Transaction<Write>>

Start an atomic transaction on the data source.
source§

async fn read(&self) -> Result<Transaction<Read>>

Start a read-only transaction on the data source. Read more

Auto Trait Implementations§

§

impl Freeze for SqlStorage

§

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 T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> ArchivePointee for T

§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where @@ -30,14 +30,16 @@ tag: u32, ) -> TaggedParser<'a, Implicit, Self, E>

source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where - T: ?Sized,

source§

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

Mutably borrows from an owned value. Read more
§

impl<T> Conv for T

§

fn conv<T>(self) -> T
where + T: ?Sized,

source§

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

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where + T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
§

impl<T> Conv for T

§

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

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

impl<F, W, T, D> Deserialize<With<T, W>, D> for F
where W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,

§

fn deserialize( &self, deserializer: &mut D, -) -> Result<With<T, W>, <D as Fallible>::Error>

Deserializes using the given deserializer
§

impl<T> FmtForward for T

§

fn fmt_binary(self) -> FmtBinary<Self>
where +) -> Result<With<T, W>, <D as Fallible>::Error>

Deserializes using the given deserializer
source§

impl<T> DynClone for T
where + 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 @@ -128,7 +130,8 @@ builds.

§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self
where 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 T
where + T: Clone,

source§

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 T
where U: Into<T>,

source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

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

source§

type Error = <U as TryFrom<T>>::Error

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

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where diff --git a/hotshot_query_service/data_source/storage/sql/struct.Sqlite.html b/hotshot_query_service/data_source/storage/sql/struct.Sqlite.html index 630aaa6db..e1a054a0a 100644 --- a/hotshot_query_service/data_source/storage/sql/struct.Sqlite.html +++ b/hotshot_query_service/data_source/storage/sql/struct.Sqlite.html @@ -1,4 +1,4 @@ -Sqlite in hotshot_query_service::data_source::storage::sql - Rust

Struct hotshot_query_service::data_source::storage::sql::Sqlite

pub struct Sqlite;
Expand description

Sqlite database driver.

+Sqlite in hotshot_query_service::data_source::storage::sql - Rust

Struct hotshot_query_service::data_source::storage::sql::Sqlite

pub struct Sqlite;
Expand description

Sqlite database driver.

Trait Implementations§

§

impl Database for Sqlite

§

type Connection = SqliteConnection

The concrete Connection implementation for this database.
§

type TransactionManager = SqliteTransactionManager

The concrete TransactionManager implementation for this database.
§

type Row = SqliteRow

The concrete Row implementation for this database.
§

type QueryResult = SqliteQueryResult

The concrete QueryResult implementation for this database.
§

type Column = SqliteColumn

The concrete Column implementation for this database.
§

type TypeInfo = SqliteTypeInfo

The concrete TypeInfo implementation for this database.
§

type Value = SqliteValue

The concrete type used to hold an owned copy of the not-yet-decoded value that was received from the database.
§

type ValueRef<'r> = SqliteValueRef<'r>

The concrete type used to hold a reference to the not-yet-decoded value that has just been received from the database.
§

type Arguments<'q> = SqliteArguments<'q>

The concrete Arguments implementation for this database.
§

type ArgumentBuffer<'q> = Vec<SqliteArgumentValue<'q>>

The concrete type used as a buffer for arguments while encoding.
§

type Statement<'q> = SqliteStatement<'q>

The concrete Statement implementation for this database.
§

const NAME: &'static str = "SQLite"

The display name for this database driver.
§

const URL_SCHEMES: &'static [&'static str] = _

The schemes for database URLs that should match this driver.
§

impl Debug for Sqlite

§

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

Formats the value using the given formatter. Read more
§

impl Decode<'_, Sqlite> for Box<[u8]>

§

fn decode( @@ -78,7 +78,24 @@ self, buf: &mut <DB as Database>::ArgumentBuffer<'q>, ) -> Result<IsNull, Box<dyn Error + Sync + Send>>
where - Self: Sized,

Writes the value of self into buf in the expected format for the database.
§

fn produces(&self) -> Option<<DB as Database>::TypeInfo>

§

fn size_hint(&self) -> usize

§

impl MigrateDatabase for Sqlite

Writes the value of self into buf in the expected format for the database.
§

fn produces(&self) -> Option<<DB as Database>::TypeInfo>

§

fn size_hint(&self) -> usize

source§

impl<'r, Types> FromRow<'r, <Sqlite as Database>::Row> for BlockDetail<Types>
where + Types: NodeType, + Header<Types>: QueryableHeader<Types> + ExplorerHeader<Types>, + Payload<Types>: QueryablePayload<Types>, + BalanceAmount<Types>: Into<MonetaryValue>,

source§

fn from_row(row: &'r <Db as Database>::Row) -> Result<Self>

source§

impl<'r, Types> FromRow<'r, <Sqlite as Database>::Row> for BlockQueryData<Types>
where + Types: NodeType, + Payload<Types>: QueryablePayload<Types>,

source§

fn from_row(row: &'r <Db as Database>::Row) -> Result<Self>

source§

impl<'r, Types> FromRow<'r, <Sqlite as Database>::Row> for BlockSummary<Types>
where + Types: NodeType, + Header<Types>: QueryableHeader<Types> + ExplorerHeader<Types>, + Payload<Types>: QueryablePayload<Types>,

source§

fn from_row(row: &'r <Db as Database>::Row) -> Result<Self>

source§

impl<'r, Types> FromRow<'r, <Sqlite as Database>::Row> for LeafQueryData<Types>
where + Types: NodeType,

source§

fn from_row(row: &'r <Db as Database>::Row) -> Result<Self>

source§

impl<'r, Types> FromRow<'r, <Sqlite as Database>::Row> for PayloadMetadata<Types>
where + Types: NodeType,

source§

fn from_row(row: &'r <Db as Database>::Row) -> Result<Self>

source§

impl<'r, Types> FromRow<'r, <Sqlite as Database>::Row> for PayloadQueryData<Types>
where + Types: NodeType, + Payload<Types>: QueryablePayload<Types>,

source§

fn from_row(row: &'r <Db as Database>::Row) -> Result<Self>

source§

impl<'r, Types> FromRow<'r, <Sqlite as Database>::Row> for VidCommonMetadata<Types>
where + Types: NodeType, + Payload<Types>: QueryablePayload<Types>,

source§

fn from_row(row: &'r <Db as Database>::Row) -> Result<Self>

source§

impl<'r, Types> FromRow<'r, <Sqlite as Database>::Row> for VidCommonQueryData<Types>
where + Types: NodeType, + Payload<Types>: QueryablePayload<Types>,

source§

fn from_row(row: &'r <Db as Database>::Row) -> Result<Self>

§

impl MigrateDatabase for Sqlite

§

fn create_database( url: &str, ) -> Pin<Box<dyn Future<Output = Result<(), Error>> + Send + '_>>

§

fn database_exists( url: &str, diff --git a/hotshot_query_service/data_source/storage/sql/struct.Transaction.html b/hotshot_query_service/data_source/storage/sql/struct.Transaction.html index b93d3aebb..23051607d 100644 --- a/hotshot_query_service/data_source/storage/sql/struct.Transaction.html +++ b/hotshot_query_service/data_source/storage/sql/struct.Transaction.html @@ -1,5 +1,5 @@ -Transaction in hotshot_query_service::data_source::storage::sql - Rust
pub struct Transaction<Mode> { /* private fields */ }
Expand description

An atomic SQL transaction.

-

Implementations§

source§

impl<Mode> Transaction<Mode>

source

pub async fn load_header<Types: NodeType>( +Transaction in hotshot_query_service::data_source::storage::sql - Rust
pub struct Transaction<Mode> { /* private fields */ }
Expand description

An atomic SQL transaction.

+

Implementations§

source§

impl<Mode> Transaction<Mode>

source

pub async fn load_header<Types: NodeType>( &mut self, id: impl Into<BlockId<Types>> + Send, ) -> QueryResult<Header<Types>>

Load a header from storage.

@@ -12,27 +12,8 @@

This more ergonomic interface is useful as loading headers is important for many SQL storage functions, not just the AvailabilityStorage interface.

-
source§

impl Transaction<Write>

Low-level, general database queries and mutation.

-
source

pub async fn execute_one<'q, E>(&mut self, statement: E) -> Result<()>
where - E: 'q + Execute<'q, Db>,

Execute a statement that is expected to modify exactly one row.

-

Returns an error if the database is not modified.

-
source

pub async fn execute_one_with_retries<'q>( - &mut self, - statement: &'q str, - params: impl Params<'q> + Clone, -) -> Result<()>

Execute a statement that is expected to modify exactly one row.

-

Returns an error if the database is not modified. Retries several times before failing.

-
source

pub async fn execute_many<'q, E>(&mut self, statement: E) -> Result<u64>
where - E: 'q + Execute<'q, Db>,

Execute a statement that is expected to modify at least one row.

-

Returns an error if the database is not modified.

-
source

pub async fn execute_many_with_retries<'q, 'p>( - &mut self, - statement: &'q str, - params: impl Params<'p> + Clone, -) -> Result<u64>
where - 'p: 'q,

Execute a statement that is expected to modify at least one row.

-

Returns an error if the database is not modified. Retries several times before failing.

-
source

pub async fn upsert<'p, const N: usize, R>( +

source§

impl Transaction<Write>

Low-level, general database queries and mutation.

+
source

pub async fn upsert<'p, const N: usize, R>( &mut self, table: &str, columns: [&str; N], @@ -120,7 +101,7 @@ hash: TransactionHash<Types>, ) -> Pin<Box<dyn Future<Output = QueryResult<TransactionQueryData<Types>>> + Send + 'async_trait>>
where Self: 'async_trait, - 'life0: 'async_trait,

source§

impl<Mode: Debug> Debug for Transaction<Mode>

source§

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

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

impl<Mode> Deref for Transaction<Mode>

source§

type Target = Transaction<'static, Postgres>

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl<Mode> DerefMut for Transaction<Mode>

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl<Mode, Types> ExplorerStorage<Types> for Transaction<Mode>
where + 'life0: 'async_trait,

source§

impl<Mode: Debug> Debug for Transaction<Mode>

source§

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

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

impl<Mode> Deref for Transaction<Mode>

source§

type Target = Transaction<'static, Sqlite>

The resulting type after dereferencing.
source§

fn deref(&self) -> &Self::Target

Dereferences the value.
source§

impl<Mode> DerefMut for Transaction<Mode>

source§

fn deref_mut(&mut self) -> &mut Self::Target

Mutably dereferences the value.
source§

impl<Mode, Types> ExplorerStorage<Types> for Transaction<Mode>
where Mode: TransactionMode, Types: NodeType, Payload<Types>: QueryablePayload<Types>, @@ -140,41 +121,41 @@ Self: 'async_trait, 'life0: 'async_trait,

get_block_detail is a method that retrieves the details of a specific block from the blockchain. The block is identified by the given -BlockIdentifier.
source§

fn get_transaction_summaries<'life0, 'async_trait>( +BlockIdentifier.

source§

fn get_transaction_summaries<'life0, 'async_trait>( &'life0 mut self, request: GetTransactionSummariesRequest<Types>, ) -> Pin<Box<dyn Future<Output = Result<Vec<TransactionSummary<Types>>, GetTransactionSummariesError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

get_transaction_summaries is a method that retrieves a list of transaction summaries from the blockchain. The list is generated from -the given GetTransactionSummariesRequest.
source§

fn get_transaction_detail<'life0, 'async_trait>( +the given GetTransactionSummariesRequest.

source§

fn get_transaction_detail<'life0, 'async_trait>( &'life0 mut self, request: TransactionIdentifier<Types>, ) -> Pin<Box<dyn Future<Output = Result<TransactionDetailResponse<Types>, GetTransactionDetailError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

get_transaction_detail is a method that retrieves the details of a specific transaction from the blockchain. The transaction is identified -by the given TransactionIdentifier.
source§

fn get_explorer_summary<'life0, 'async_trait>( +by the given TransactionIdentifier.

source§

fn get_explorer_summary<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<ExplorerSummary<Types>, GetExplorerSummaryError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

get_explorer_summary is a method that retrieves a summary overview of the blockchain. This is useful for displaying information that -indicates the overall status of the block chain.
source§

fn get_search_results<'life0, 'async_trait>( +indicates the overall status of the block chain.

source§

fn get_search_results<'life0, 'async_trait>( &'life0 mut self, search_query: TaggedBase64, ) -> Pin<Box<dyn Future<Output = Result<SearchResult<Types>, GetSearchResultsError>> + Send + 'async_trait>>
where Self: 'async_trait, 'life0: 'async_trait,

get_search_results is a method that retrieves the results of a search query against the blockchain. The results are generated from the given -query string.
source§

impl<Mode: TransactionMode> MerklizedStateHeightStorage for Transaction<Mode>

source§

fn get_last_state_height<'life0, 'async_trait>( +query string.

source§

impl<Mode: TransactionMode> MerklizedStateHeightStorage for Transaction<Mode>

source§

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

source§

impl<Mode, Types, State, const ARITY: usize> MerklizedStateStorage<Types, State, ARITY> for Transaction<Mode>
where + 'life0: 'async_trait,

source§

impl<Mode, Types, State, const ARITY: usize> MerklizedStateStorage<Types, State, ARITY> for Transaction<Mode>
where Mode: TransactionMode, Types: NodeType, - State: MerklizedState<Types, ARITY> + 'static,

source§

fn get_path<'life0, 'async_trait>( + State: MerklizedState<Types, ARITY> + 'static,

source§

fn get_path<'life0, 'async_trait>( &'life0 mut self, snapshot: Snapshot<Types, State, ARITY>, key: State::Key, @@ -214,26 +195,26 @@ limit: usize, ) -> Pin<Box<dyn Future<Output = QueryResult<TimeWindowQueryData<Header<Types>>>> + Send + 'async_trait>>
where Self: 'async_trait, - 'life0: 'async_trait,

source§

impl<Mode: TransactionMode> PrunedHeightStorage for Transaction<Mode>

source§

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

source§

impl<Mode: TransactionMode> PrunedHeightStorage for Transaction<Mode>

source§

fn load_pruned_height<'life0, 'async_trait>( &'life0 mut self, ) -> Pin<Box<dyn Future<Output = Result<Option<u64>>> + Send + 'async_trait>>
where Self: 'async_trait, - 'life0: 'async_trait,

source§

impl<Mode: TransactionMode> Transaction for Transaction<Mode>

source§

async fn commit(self) -> Result<()>

source§

fn revert(self) -> impl Future + Send

source§

impl<Types: NodeType> UpdateAggregatesStorage<Types> for Transaction<Write>

source§

async fn update_aggregates( + 'life0: 'async_trait,

source§

impl<Mode: TransactionMode> Transaction for Transaction<Mode>

source§

async fn commit(self) -> Result<()>

source§

fn revert(self) -> impl Future + Send

source§

impl<Types: NodeType> UpdateAggregatesStorage<Types> for Transaction<Write>

source§

async fn update_aggregates( &mut self, blocks: &[PayloadMetadata<Types>], -) -> Result<()>

Update aggregate statistics based on a new block.
source§

impl<Types> UpdateAvailabilityStorage<Types> for Transaction<Write>
where +) -> Result<()>

Update aggregate statistics based on a new block.
source§

impl<Types> UpdateAvailabilityStorage<Types> for Transaction<Write>
where Types: NodeType, Payload<Types>: QueryablePayload<Types>, - Header<Types>: QueryableHeader<Types>,

source§

async fn insert_leaf(&mut self, leaf: LeafQueryData<Types>) -> Result<()>

source§

async fn insert_block(&mut self, block: BlockQueryData<Types>) -> Result<()>

source§

async fn insert_vid( + Header<Types>: QueryableHeader<Types>,

source§

async fn insert_leaf(&mut self, leaf: LeafQueryData<Types>) -> Result<()>

source§

async fn insert_block(&mut self, block: BlockQueryData<Types>) -> Result<()>

source§

async fn insert_vid( &mut self, common: VidCommonQueryData<Types>, share: Option<VidShare>, -) -> Result<()>

source§

impl<Types: NodeType, State: MerklizedState<Types, ARITY>, const ARITY: usize> UpdateStateData<Types, State, ARITY> for Transaction<Write>

source§

fn set_last_state_height<'life0, 'async_trait>( +) -> Result<()>

source§

impl<Types: NodeType, State: MerklizedState<Types, ARITY>, const ARITY: usize> UpdateStateData<Types, State, ARITY> for Transaction<Write>

source§

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

source§

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

source§

fn insert_merkle_nodes<'life0, 'async_trait>( &'life0 mut self, proof: MerkleProof<State::Entry, State::Key, State::T, ARITY>, traversal_path: Vec<usize>, diff --git a/hotshot_query_service/data_source/storage/sql/struct.Write.html b/hotshot_query_service/data_source/storage/sql/struct.Write.html index 904232610..75e3ff262 100644 --- a/hotshot_query_service/data_source/storage/sql/struct.Write.html +++ b/hotshot_query_service/data_source/storage/sql/struct.Write.html @@ -1,5 +1,5 @@ Write in hotshot_query_service::data_source::storage::sql - Rust

Struct hotshot_query_service::data_source::storage::sql::Write

source ·
pub struct Write;
Expand description

Marker type indicating a transaction with read-write access to the database.

-

Trait Implementations§

source§

impl Clone for Write

source§

fn clone(&self) -> Write

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 Write

source§

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

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

impl Default for Write

source§

fn default() -> Write

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

impl TransactionMode for Write

source§

async fn begin(conn: &mut <Db as Database>::Connection) -> Result<()>

source§

fn display() -> &'static str

source§

impl Copy for Write

Auto Trait Implementations§

§

impl Freeze for Write

§

impl RefUnwindSafe for Write

§

impl Send for Write

§

impl Sync for Write

§

impl Unpin for Write

§

impl UnwindSafe for Write

Blanket Implementations§

source§

impl<T> Any for T
where +

Trait Implementations§

source§

impl Clone for Write

source§

fn clone(&self) -> Write

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 Write

source§

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

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

impl Default for Write

source§

fn default() -> Write

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

impl TransactionMode for Write

source§

async fn begin(conn: &mut <Db as Database>::Connection) -> Result<()>

source§

fn display() -> &'static str

source§

impl Copy for Write

Auto Trait Implementations§

§

impl Freeze for Write

§

impl RefUnwindSafe for Write

§

impl Send for Write

§

impl Sync for Write

§

impl Unpin for Write

§

impl UnwindSafe for Write

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> ArchivePointee for T

§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where diff --git a/hotshot_query_service/data_source/storage/sql/syntax_helpers/constant.BINARY_TYPE.html b/hotshot_query_service/data_source/storage/sql/syntax_helpers/constant.BINARY_TYPE.html new file mode 100644 index 000000000..10d6239a3 --- /dev/null +++ b/hotshot_query_service/data_source/storage/sql/syntax_helpers/constant.BINARY_TYPE.html @@ -0,0 +1 @@ +BINARY_TYPE in hotshot_query_service::data_source::storage::sql::syntax_helpers - Rust
pub const BINARY_TYPE: &str = "BLOB";
\ No newline at end of file diff --git a/hotshot_query_service/data_source/storage/sql/syntax_helpers/constant.MAX_FN.html b/hotshot_query_service/data_source/storage/sql/syntax_helpers/constant.MAX_FN.html new file mode 100644 index 000000000..18a258ebd --- /dev/null +++ b/hotshot_query_service/data_source/storage/sql/syntax_helpers/constant.MAX_FN.html @@ -0,0 +1 @@ +MAX_FN in hotshot_query_service::data_source::storage::sql::syntax_helpers - Rust
pub const MAX_FN: &str = "MAX";
\ No newline at end of file diff --git a/hotshot_query_service/data_source/storage/sql/syntax_helpers/index.html b/hotshot_query_service/data_source/storage/sql/syntax_helpers/index.html new file mode 100644 index 000000000..ea7148291 --- /dev/null +++ b/hotshot_query_service/data_source/storage/sql/syntax_helpers/index.html @@ -0,0 +1 @@ +hotshot_query_service::data_source::storage::sql::syntax_helpers - Rust
\ No newline at end of file diff --git a/hotshot_query_service/data_source/storage/sql/syntax_helpers/sidebar-items.js b/hotshot_query_service/data_source/storage/sql/syntax_helpers/sidebar-items.js new file mode 100644 index 000000000..c8504a7c5 --- /dev/null +++ b/hotshot_query_service/data_source/storage/sql/syntax_helpers/sidebar-items.js @@ -0,0 +1 @@ +window.SIDEBAR_ITEMS = {"constant":["BINARY_TYPE","MAX_FN"]}; \ No newline at end of file diff --git a/hotshot_query_service/data_source/storage/sql/testing/index.html b/hotshot_query_service/data_source/storage/sql/testing/index.html index df1a2b062..3a7b256c7 100644 --- a/hotshot_query_service/data_source/storage/sql/testing/index.html +++ b/hotshot_query_service/data_source/storage/sql/testing/index.html @@ -1 +1 @@ -hotshot_query_service::data_source::storage::sql::testing - Rust
\ No newline at end of file +hotshot_query_service::data_source::storage::sql::testing - Rust
\ No newline at end of file diff --git a/hotshot_query_service/data_source/storage/sql/testing/struct.TestMerkleTreeMigration.html b/hotshot_query_service/data_source/storage/sql/testing/struct.TestMerkleTreeMigration.html index 24977f7ca..456b30d0a 100644 --- a/hotshot_query_service/data_source/storage/sql/testing/struct.TestMerkleTreeMigration.html +++ b/hotshot_query_service/data_source/storage/sql/testing/struct.TestMerkleTreeMigration.html @@ -1,4 +1,4 @@ -TestMerkleTreeMigration in hotshot_query_service::data_source::storage::sql::testing - Rust
pub struct TestMerkleTreeMigration;

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where +TestMerkleTreeMigration in hotshot_query_service::data_source::storage::sql::testing - Rust
pub struct TestMerkleTreeMigration;

Auto Trait Implementations§

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> ArchivePointee for T

§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where diff --git a/hotshot_query_service/data_source/storage/sql/testing/struct.TmpDb.html b/hotshot_query_service/data_source/storage/sql/testing/struct.TmpDb.html index 5800d3835..ffa182473 100644 --- a/hotshot_query_service/data_source/storage/sql/testing/struct.TmpDb.html +++ b/hotshot_query_service/data_source/storage/sql/testing/struct.TmpDb.html @@ -1,4 +1,4 @@ -TmpDb in hotshot_query_service::data_source::storage::sql::testing - Rust

Struct hotshot_query_service::data_source::storage::sql::testing::TmpDb

source ·
pub struct TmpDb { /* private fields */ }

Implementations§

source§

impl TmpDb

source

pub async fn init() -> Self

source

pub async fn persistent() -> Self

source

pub fn host(&self) -> String

source

pub fn port(&self) -> u16

source

pub fn config(&self) -> Config

source

pub fn stop(&mut self)

source

pub async fn start(&mut self)

Trait Implementations§

source§

impl Debug for TmpDb

source§

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

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

impl Drop for TmpDb

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl Freeze for TmpDb

§

impl RefUnwindSafe for TmpDb

§

impl Send for TmpDb

§

impl Sync for TmpDb

§

impl Unpin for TmpDb

§

impl UnwindSafe for TmpDb

Blanket Implementations§

source§

impl<T> Any for T
where +TmpDb in hotshot_query_service::data_source::storage::sql::testing - Rust

Struct hotshot_query_service::data_source::storage::sql::testing::TmpDb

source ·
pub struct TmpDb { /* private fields */ }

Implementations§

source§

impl TmpDb

source

pub async fn init() -> Self

source

pub async fn persistent() -> Self

source

pub fn path(&self) -> PathBuf

source

pub fn config(&self) -> Config

Trait Implementations§

source§

impl Debug for TmpDb

source§

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

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

impl Drop for TmpDb

source§

fn drop(&mut self)

Executes the destructor for this type. Read more

Auto Trait Implementations§

§

impl Freeze for TmpDb

§

impl RefUnwindSafe for TmpDb

§

impl Send for TmpDb

§

impl Sync for TmpDb

§

impl Unpin for TmpDb

§

impl UnwindSafe for TmpDb

Blanket Implementations§

source§

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

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
§

impl<T> ArchivePointee for T

§

type ArchivedMetadata = ()

The archived version of the pointer metadata for this type.
§

fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata

Converts some archived metadata to the pointer metadata for itself.
§

impl<'a, T, E> AsTaggedExplicit<'a, E> for T
where diff --git a/hotshot_query_service/data_source/storage/sql/trait.FixedLengthParams.html b/hotshot_query_service/data_source/storage/sql/trait.FixedLengthParams.html index 0c4a9c359..4a58d5a95 100644 --- a/hotshot_query_service/data_source/storage/sql/trait.FixedLengthParams.html +++ b/hotshot_query_service/data_source/storage/sql/trait.FixedLengthParams.html @@ -1,35 +1,35 @@ -FixedLengthParams in hotshot_query_service::data_source::storage::sql - Rust
pub trait FixedLengthParams<'p, const N: usize>: Params<'p> { }
Expand description

A collection of parameters with a statically known length.

+FixedLengthParams in hotshot_query_service::data_source::storage::sql - Rust
pub trait FixedLengthParams<'p, const N: usize>: Params<'p> { }
Expand description

A collection of parameters with a statically known length.

This is a simple trick for enforcing at compile time that a list of parameters has a certain length, such as matching the length of a list of column names. This can prevent easy mistakes like leaving out a parameter. It is implemented for tuples up to length 8.

-

Implementations on Foreign Types§

source§

impl<'p, T1, T2> FixedLengthParams<'p, 2> for (T1, T2)
where +

Implementations on Foreign Types§

source§

impl<'p, T1, T2> FixedLengthParams<'p, 2> for (T1, T2)
where T1: 'p + for<'q> Encode<'q, Db> + Type<Db>, - T2: 'p + for<'q> Encode<'q, Db> + Type<Db>,

source§

impl<'p, T1, T2, T3> FixedLengthParams<'p, 3> for (T1, T2, T3)
where + T2: 'p + for<'q> Encode<'q, Db> + Type<Db>,

source§

impl<'p, T1, T2, T3> FixedLengthParams<'p, 3> for (T1, T2, T3)
where T1: 'p + for<'q> Encode<'q, Db> + Type<Db>, T2: 'p + for<'q> Encode<'q, Db> + Type<Db>, - T3: 'p + for<'q> Encode<'q, Db> + Type<Db>,

source§

impl<'p, T1, T2, T3, T4> FixedLengthParams<'p, 4> for (T1, T2, T3, T4)
where + T3: 'p + for<'q> Encode<'q, Db> + Type<Db>,

source§

impl<'p, T1, T2, T3, T4> FixedLengthParams<'p, 4> for (T1, T2, T3, T4)
where T1: 'p + for<'q> Encode<'q, Db> + Type<Db>, T2: 'p + for<'q> Encode<'q, Db> + Type<Db>, T3: 'p + for<'q> Encode<'q, Db> + Type<Db>, - T4: 'p + for<'q> Encode<'q, Db> + Type<Db>,

source§

impl<'p, T1, T2, T3, T4, T5> FixedLengthParams<'p, 5> for (T1, T2, T3, T4, T5)
where + T4: 'p + for<'q> Encode<'q, Db> + Type<Db>,

source§

impl<'p, T1, T2, T3, T4, T5> FixedLengthParams<'p, 5> for (T1, T2, T3, T4, T5)
where T1: 'p + for<'q> Encode<'q, Db> + Type<Db>, T2: 'p + for<'q> Encode<'q, Db> + Type<Db>, T3: 'p + for<'q> Encode<'q, Db> + Type<Db>, T4: 'p + for<'q> Encode<'q, Db> + Type<Db>, - T5: 'p + for<'q> Encode<'q, Db> + Type<Db>,

source§

impl<'p, T1, T2, T3, T4, T5, T6> FixedLengthParams<'p, 6> for (T1, T2, T3, T4, T5, T6)
where + T5: 'p + for<'q> Encode<'q, Db> + Type<Db>,

source§

impl<'p, T1, T2, T3, T4, T5, T6> FixedLengthParams<'p, 6> for (T1, T2, T3, T4, T5, T6)
where T1: 'p + for<'q> Encode<'q, Db> + Type<Db>, T2: 'p + for<'q> Encode<'q, Db> + Type<Db>, T3: 'p + for<'q> Encode<'q, Db> + Type<Db>, T4: 'p + for<'q> Encode<'q, Db> + Type<Db>, T5: 'p + for<'q> Encode<'q, Db> + Type<Db>, - T6: 'p + for<'q> Encode<'q, Db> + Type<Db>,

source§

impl<'p, T1, T2, T3, T4, T5, T6, T7> FixedLengthParams<'p, 7> for (T1, T2, T3, T4, T5, T6, T7)
where + T6: 'p + for<'q> Encode<'q, Db> + Type<Db>,

source§

impl<'p, T1, T2, T3, T4, T5, T6, T7> FixedLengthParams<'p, 7> for (T1, T2, T3, T4, T5, T6, T7)
where T1: 'p + for<'q> Encode<'q, Db> + Type<Db>, T2: 'p + for<'q> Encode<'q, Db> + Type<Db>, T3: 'p + for<'q> Encode<'q, Db> + Type<Db>, T4: 'p + for<'q> Encode<'q, Db> + Type<Db>, T5: 'p + for<'q> Encode<'q, Db> + Type<Db>, T6: 'p + for<'q> Encode<'q, Db> + Type<Db>, - T7: 'p + for<'q> Encode<'q, Db> + Type<Db>,

source§

impl<'p, T1, T2, T3, T4, T5, T6, T7, T8> FixedLengthParams<'p, 8> for (T1, T2, T3, T4, T5, T6, T7, T8)
where + T7: 'p + for<'q> Encode<'q, Db> + Type<Db>,

source§

impl<'p, T1, T2, T3, T4, T5, T6, T7, T8> FixedLengthParams<'p, 8> for (T1, T2, T3, T4, T5, T6, T7, T8)
where T1: 'p + for<'q> Encode<'q, Db> + Type<Db>, T2: 'p + for<'q> Encode<'q, Db> + Type<Db>, T3: 'p + for<'q> Encode<'q, Db> + Type<Db>, @@ -37,5 +37,5 @@ T5: 'p + for<'q> Encode<'q, Db> + Type<Db>, T6: 'p + for<'q> Encode<'q, Db> + Type<Db>, T7: 'p + for<'q> Encode<'q, Db> + Type<Db>, - T8: 'p + for<'q> Encode<'q, Db> + Type<Db>,

source§

impl<'p, T> FixedLengthParams<'p, 1> for (T,)
where + T8: 'p + for<'q> Encode<'q, Db> + Type<Db>,

source§

impl<'p, T> FixedLengthParams<'p, 1> for (T,)
where T: 'p + for<'q> Encode<'q, Db> + Type<Db>,

Implementors§

\ No newline at end of file diff --git a/hotshot_query_service/data_source/storage/sql/trait.Params.html b/hotshot_query_service/data_source/storage/sql/trait.Params.html index 65f21a17a..13a487385 100644 --- a/hotshot_query_service/data_source/storage/sql/trait.Params.html +++ b/hotshot_query_service/data_source/storage/sql/trait.Params.html @@ -1,7 +1,10 @@ -Params in hotshot_query_service::data_source::storage::sql - Rust

Trait hotshot_query_service::data_source::storage::sql::Params

source ·
pub trait Params<'p> {
+Params in hotshot_query_service::data_source::storage::sql - Rust

Trait hotshot_query_service::data_source::storage::sql::Params

source ·
pub trait Params<'p> {
     // Required method
-    fn bind<'q>(self, q: Query<'q>) -> Query<'q>
-       where 'p: 'q;
+    fn bind<'q, 'r>(
+        self,
+        q: &'q mut Separated<'r, 'p, Db, &'static str>,
+    ) -> &'q mut Separated<'r, 'p, Db, &'static str>
+       where 'p: 'r;
 }
Expand description

A collection of parameters which can be bound to a SQL query.

This trait allows us to carry around hetergenous lists of parameters (e.g. tuples) and bind them to a query at the last moment before executing. This means we can manipulate the parameters @@ -26,51 +29,76 @@

§Lifetimes

of the query we’re binding to ('q) may be different than the lifetime of the parameters ('p) as long as the parameters outlive the duration of the query (the 'p: 'q) bound on the bind function.

-

Required Methods§

source

fn bind<'q>(self, q: Query<'q>) -> Query<'q>
where - 'p: 'q,

Implementations on Foreign Types§

source§

impl<'p, T1, T2> Params<'p> for (T1, T2)
where - T1: 'p + for<'q> Encode<'q, Db> + Type<Db>, - T2: 'p + for<'q> Encode<'q, Db> + Type<Db>,

source§

fn bind<'q>(self, q: Query<'q>) -> Query<'q>
where - 'p: 'q,

source§

impl<'p, T1, T2, T3> Params<'p> for (T1, T2, T3)
where - T1: 'p + for<'q> Encode<'q, Db> + Type<Db>, - T2: 'p + for<'q> Encode<'q, Db> + Type<Db>, - T3: 'p + for<'q> Encode<'q, Db> + Type<Db>,

source§

fn bind<'q>(self, q: Query<'q>) -> Query<'q>
where - 'p: 'q,

source§

impl<'p, T1, T2, T3, T4> Params<'p> for (T1, T2, T3, T4)
where - T1: 'p + for<'q> Encode<'q, Db> + Type<Db>, - T2: 'p + for<'q> Encode<'q, Db> + Type<Db>, - T3: 'p + for<'q> Encode<'q, Db> + Type<Db>, - T4: 'p + for<'q> Encode<'q, Db> + Type<Db>,

source§

fn bind<'q>(self, q: Query<'q>) -> Query<'q>
where - 'p: 'q,

source§

impl<'p, T1, T2, T3, T4, T5> Params<'p> for (T1, T2, T3, T4, T5)
where - T1: 'p + for<'q> Encode<'q, Db> + Type<Db>, - T2: 'p + for<'q> Encode<'q, Db> + Type<Db>, - T3: 'p + for<'q> Encode<'q, Db> + Type<Db>, - T4: 'p + for<'q> Encode<'q, Db> + Type<Db>, - T5: 'p + for<'q> Encode<'q, Db> + Type<Db>,

source§

fn bind<'q>(self, q: Query<'q>) -> Query<'q>
where - 'p: 'q,

source§

impl<'p, T1, T2, T3, T4, T5, T6> Params<'p> for (T1, T2, T3, T4, T5, T6)
where - T1: 'p + for<'q> Encode<'q, Db> + Type<Db>, - T2: 'p + for<'q> Encode<'q, Db> + Type<Db>, - T3: 'p + for<'q> Encode<'q, Db> + Type<Db>, - T4: 'p + for<'q> Encode<'q, Db> + Type<Db>, - T5: 'p + for<'q> Encode<'q, Db> + Type<Db>, - T6: 'p + for<'q> Encode<'q, Db> + Type<Db>,

source§

fn bind<'q>(self, q: Query<'q>) -> Query<'q>
where - 'p: 'q,

source§

impl<'p, T1, T2, T3, T4, T5, T6, T7> Params<'p> for (T1, T2, T3, T4, T5, T6, T7)
where - T1: 'p + for<'q> Encode<'q, Db> + Type<Db>, - T2: 'p + for<'q> Encode<'q, Db> + Type<Db>, - T3: 'p + for<'q> Encode<'q, Db> + Type<Db>, - T4: 'p + for<'q> Encode<'q, Db> + Type<Db>, - T5: 'p + for<'q> Encode<'q, Db> + Type<Db>, - T6: 'p + for<'q> Encode<'q, Db> + Type<Db>, - T7: 'p + for<'q> Encode<'q, Db> + Type<Db>,

source§

fn bind<'q>(self, q: Query<'q>) -> Query<'q>
where - 'p: 'q,

source§

impl<'p, T1, T2, T3, T4, T5, T6, T7, T8> Params<'p> for (T1, T2, T3, T4, T5, T6, T7, T8)
where - T1: 'p + for<'q> Encode<'q, Db> + Type<Db>, - T2: 'p + for<'q> Encode<'q, Db> + Type<Db>, - T3: 'p + for<'q> Encode<'q, Db> + Type<Db>, - T4: 'p + for<'q> Encode<'q, Db> + Type<Db>, - T5: 'p + for<'q> Encode<'q, Db> + Type<Db>, - T6: 'p + for<'q> Encode<'q, Db> + Type<Db>, - T7: 'p + for<'q> Encode<'q, Db> + Type<Db>, - T8: 'p + for<'q> Encode<'q, Db> + Type<Db>,

source§

fn bind<'q>(self, q: Query<'q>) -> Query<'q>
where - 'p: 'q,

source§

impl<'p, T> Params<'p> for (T,)
where - T: 'p + for<'q> Encode<'q, Db> + Type<Db>,

source§

fn bind<'q>(self, q: Query<'q>) -> Query<'q>
where - 'p: 'q,

source§

impl<'p, T> Params<'p> for Vec<T>
where - T: Params<'p>,

source§

fn bind<'q>(self, q: Query<'q>) -> Query<'q>
where - 'p: 'q,

Implementors§

\ No newline at end of file +

Required Methods§

source

fn bind<'q, 'r>( + self, + q: &'q mut Separated<'r, 'p, Db, &'static str>, +) -> &'q mut Separated<'r, 'p, Db, &'static str>
where + 'p: 'r,

Implementations on Foreign Types§

source§

impl<'p, T1, T2> Params<'p> for (T1, T2)
where + T1: 'p + Encode<'p, Db> + Type<Db>, + T2: 'p + Encode<'p, Db> + Type<Db>,

source§

fn bind<'q, 'r>( + self, + q: &'q mut Separated<'r, 'p, Db, &'static str>, +) -> &'q mut Separated<'r, 'p, Db, &'static str>
where + 'p: 'r,

source§

impl<'p, T1, T2, T3> Params<'p> for (T1, T2, T3)
where + T1: 'p + Encode<'p, Db> + Type<Db>, + T2: 'p + Encode<'p, Db> + Type<Db>, + T3: 'p + Encode<'p, Db> + Type<Db>,

source§

fn bind<'q, 'r>( + self, + q: &'q mut Separated<'r, 'p, Db, &'static str>, +) -> &'q mut Separated<'r, 'p, Db, &'static str>
where + 'p: 'r,

source§

impl<'p, T1, T2, T3, T4> Params<'p> for (T1, T2, T3, T4)
where + T1: 'p + Encode<'p, Db> + Type<Db>, + T2: 'p + Encode<'p, Db> + Type<Db>, + T3: 'p + Encode<'p, Db> + Type<Db>, + T4: 'p + Encode<'p, Db> + Type<Db>,

source§

fn bind<'q, 'r>( + self, + q: &'q mut Separated<'r, 'p, Db, &'static str>, +) -> &'q mut Separated<'r, 'p, Db, &'static str>
where + 'p: 'r,

source§

impl<'p, T1, T2, T3, T4, T5> Params<'p> for (T1, T2, T3, T4, T5)
where + T1: 'p + Encode<'p, Db> + Type<Db>, + T2: 'p + Encode<'p, Db> + Type<Db>, + T3: 'p + Encode<'p, Db> + Type<Db>, + T4: 'p + Encode<'p, Db> + Type<Db>, + T5: 'p + Encode<'p, Db> + Type<Db>,

source§

fn bind<'q, 'r>( + self, + q: &'q mut Separated<'r, 'p, Db, &'static str>, +) -> &'q mut Separated<'r, 'p, Db, &'static str>
where + 'p: 'r,

source§

impl<'p, T1, T2, T3, T4, T5, T6> Params<'p> for (T1, T2, T3, T4, T5, T6)
where + T1: 'p + Encode<'p, Db> + Type<Db>, + T2: 'p + Encode<'p, Db> + Type<Db>, + T3: 'p + Encode<'p, Db> + Type<Db>, + T4: 'p + Encode<'p, Db> + Type<Db>, + T5: 'p + Encode<'p, Db> + Type<Db>, + T6: 'p + Encode<'p, Db> + Type<Db>,

source§

fn bind<'q, 'r>( + self, + q: &'q mut Separated<'r, 'p, Db, &'static str>, +) -> &'q mut Separated<'r, 'p, Db, &'static str>
where + 'p: 'r,

source§

impl<'p, T1, T2, T3, T4, T5, T6, T7> Params<'p> for (T1, T2, T3, T4, T5, T6, T7)
where + T1: 'p + Encode<'p, Db> + Type<Db>, + T2: 'p + Encode<'p, Db> + Type<Db>, + T3: 'p + Encode<'p, Db> + Type<Db>, + T4: 'p + Encode<'p, Db> + Type<Db>, + T5: 'p + Encode<'p, Db> + Type<Db>, + T6: 'p + Encode<'p, Db> + Type<Db>, + T7: 'p + Encode<'p, Db> + Type<Db>,

source§

fn bind<'q, 'r>( + self, + q: &'q mut Separated<'r, 'p, Db, &'static str>, +) -> &'q mut Separated<'r, 'p, Db, &'static str>
where + 'p: 'r,

source§

impl<'p, T1, T2, T3, T4, T5, T6, T7, T8> Params<'p> for (T1, T2, T3, T4, T5, T6, T7, T8)
where + T1: 'p + Encode<'p, Db> + Type<Db>, + T2: 'p + Encode<'p, Db> + Type<Db>, + T3: 'p + Encode<'p, Db> + Type<Db>, + T4: 'p + Encode<'p, Db> + Type<Db>, + T5: 'p + Encode<'p, Db> + Type<Db>, + T6: 'p + Encode<'p, Db> + Type<Db>, + T7: 'p + Encode<'p, Db> + Type<Db>, + T8: 'p + Encode<'p, Db> + Type<Db>,

source§

fn bind<'q, 'r>( + self, + q: &'q mut Separated<'r, 'p, Db, &'static str>, +) -> &'q mut Separated<'r, 'p, Db, &'static str>
where + 'p: 'r,

source§

impl<'p, T> Params<'p> for (T,)
where + T: 'p + Encode<'p, Db> + Type<Db>,

source§

fn bind<'q, 'r>( + self, + q: &'q mut Separated<'r, 'p, Db, &'static str>, +) -> &'q mut Separated<'r, 'p, Db, &'static str>
where + 'p: 'r,

Implementors§

\ No newline at end of file diff --git a/hotshot_query_service/data_source/storage/sql/trait.TransactionMode.html b/hotshot_query_service/data_source/storage/sql/trait.TransactionMode.html index 1e32065d8..95a23f393 100644 --- a/hotshot_query_service/data_source/storage/sql/trait.TransactionMode.html +++ b/hotshot_query_service/data_source/storage/sql/trait.TransactionMode.html @@ -7,4 +7,4 @@ }
Expand description

Trait for marker types indicating what type of access a transaction has to the database.

Required Methods§

source

fn begin( conn: &mut <Db as Database>::Connection, -) -> impl Future<Output = Result<()>> + Send

source

fn display() -> &'static str

Object Safety§

This trait is not object safe.

Implementors§

\ No newline at end of file +) -> impl Future<Output = Result<()>> + Send

source

fn display() -> &'static str

Object Safety§

This trait is not object safe.

Implementors§

\ No newline at end of file diff --git a/hotshot_query_service/data_source/storage/sql/transaction/fn.build_where_in.html b/hotshot_query_service/data_source/storage/sql/transaction/fn.build_where_in.html new file mode 100644 index 000000000..b6c626876 --- /dev/null +++ b/hotshot_query_service/data_source/storage/sql/transaction/fn.build_where_in.html @@ -0,0 +1,11 @@ + + + + + Redirection + + +

Redirecting to ../../../../../hotshot_query_service/data_source/storage/sql/fn.build_where_in.html...

+ + + \ No newline at end of file diff --git a/hotshot_query_service/data_source/storage/sql/type.Db.html b/hotshot_query_service/data_source/storage/sql/type.Db.html index 8320f4465..6612eb443 100644 --- a/hotshot_query_service/data_source/storage/sql/type.Db.html +++ b/hotshot_query_service/data_source/storage/sql/type.Db.html @@ -1,14 +1,17 @@ -Db in hotshot_query_service::data_source::storage::sql - Rust

Type Alias hotshot_query_service::data_source::storage::sql::Db

source ·
pub type Db = Postgres;
Expand description

The concrete database backing a SQL data source.

-

Currently only Postgres is supported. In the future we can support SQLite as well by making this -an enum with variants for each (we’ll then need to create enums and trait implementations for -all the associated types as well; it will be messy).

-

The reason for taking this approach over sqlx’s Any database is that we can support SQL types +Db in hotshot_query_service::data_source::storage::sql - Rust

Type Alias hotshot_query_service::data_source::storage::sql::Db

source ·
pub type Db = Sqlite;
Expand description

The underlying database type for a SQL data source.

+

Currently, only PostgreSQL and SQLite are supported, with selection based on the “embedded-db” feature flag.

+
    +
  • When the “embedded-db” feature is enabled, SQLite is used.
  • +
  • When it’s disabled, PostgreSQL is used.
  • +
+

§Design Choice

+

The reason for taking this approach over sqlx’s Any database is that we can support SQL types which are implemented for the two backends we care about (Postgres and SQLite) but not for any SQL database, such as MySQL. Crucially, JSON types fall in this category.

The reason for taking this approach rather than writing all of our code to be generic over the -Database implementation is that sqlx does not have the necessary trait bounds on all of the -associated types (e.g. Database::Connection does not implement Executor for all possible -databases, the Executor impl lives on each concrete connection type) and Rust does not provide +Database implementation is that sqlx does not have the necessary trait bounds on all of the +associated types (e.g. Database::Connection does not implement Executor for all possible +databases, the Executor impl lives on each concrete connection type) and Rust does not provide a good way of encapsulating a collection of trait bounds on associated types. Thus, our function signatures become untenably messy with bounds like

@@ -18,5 +21,4 @@ for<'q> DB::Arguments<'q>: IntoArguments<'q, DB>, for<'a> i64: Type<DB> + Encode<'a, DB>, {}
-

etc.

-

Aliased Type§

struct Db;
\ No newline at end of file +

Aliased Type§

struct Db;
\ No newline at end of file diff --git a/hotshot_query_service/data_source/storage/trait.ExplorerStorage.html b/hotshot_query_service/data_source/storage/trait.ExplorerStorage.html index 24e85c686..24d86a57f 100644 --- a/hotshot_query_service/data_source/storage/trait.ExplorerStorage.html +++ b/hotshot_query_service/data_source/storage/trait.ExplorerStorage.html @@ -94,7 +94,7 @@ 'life0: 'async_trait,

get_search_results is a method that retrieves the results of a search query against the blockchain. The results are generated from the given query string.

-

Implementors§

source§

impl<Mode, Types> ExplorerStorage<Types> for Transaction<Mode>
where +

Implementors§

source§

impl<Mode, Types> ExplorerStorage<Types> for Transaction<Mode>
where Mode: TransactionMode, Types: NodeType, Payload<Types>: QueryablePayload<Types>, diff --git a/hotshot_query_service/data_source/storage/trait.MerklizedStateHeightStorage.html b/hotshot_query_service/data_source/storage/trait.MerklizedStateHeightStorage.html index 466000ab5..e67a6a887 100644 --- a/hotshot_query_service/data_source/storage/trait.MerklizedStateHeightStorage.html +++ b/hotshot_query_service/data_source/storage/trait.MerklizedStateHeightStorage.html @@ -9,4 +9,4 @@ &'life0 mut self, ) -> Pin<Box<dyn Future<Output = QueryResult<usize>> + Send + 'async_trait>>
where Self: 'async_trait, - 'life0: 'async_trait,

Implementors§

source§

impl<Mode: TransactionMode> MerklizedStateHeightStorage for Transaction<Mode>

\ No newline at end of file + 'life0: 'async_trait,

Implementors§

source§

impl<Mode: TransactionMode> MerklizedStateHeightStorage for Transaction<Mode>

\ No newline at end of file diff --git a/hotshot_query_service/data_source/storage/trait.MerklizedStateStorage.html b/hotshot_query_service/data_source/storage/trait.MerklizedStateStorage.html index 8443c07fc..1d6a85ac9 100644 --- a/hotshot_query_service/data_source/storage/trait.MerklizedStateStorage.html +++ b/hotshot_query_service/data_source/storage/trait.MerklizedStateStorage.html @@ -17,7 +17,7 @@ key: State::Key, ) -> Pin<Box<dyn Future<Output = QueryResult<MerkleProof<State::Entry, State::Key, State::T, ARITY>>> + Send + 'async_trait>>
where Self: 'async_trait, - 'life0: 'async_trait,

Implementors§

source§

impl<Mode, Types, State, const ARITY: usize> MerklizedStateStorage<Types, State, ARITY> for Transaction<Mode>
where + 'life0: 'async_trait,

Implementors§

source§

impl<Mode, Types, State, const ARITY: usize> MerklizedStateStorage<Types, State, ARITY> for Transaction<Mode>
where Mode: TransactionMode, Types: NodeType, State: MerklizedState<Types, ARITY> + 'static,

\ No newline at end of file diff --git a/hotshot_query_service/data_source/storage/trait.UpdateAvailabilityStorage.html b/hotshot_query_service/data_source/storage/trait.UpdateAvailabilityStorage.html index 597d29133..d3cb33e7c 100644 --- a/hotshot_query_service/data_source/storage/trait.UpdateAvailabilityStorage.html +++ b/hotshot_query_service/data_source/storage/trait.UpdateAvailabilityStorage.html @@ -28,7 +28,7 @@ T: UpdateAvailabilityStorage<MockTypes> + Send + Sync,
source§

impl<'a, Types: NodeType> UpdateAvailabilityStorage<Types> for hotshot_query_service::data_source::storage::fs::Transaction<RwLockWriteGuard<'a, FileSystemStorageInner<Types>>>
where Payload<Types>: QueryablePayload<Types>, Header<Types>: QueryableHeader<Types>,

source§

impl<'a, Types: NodeType> UpdateAvailabilityStorage<Types> for hotshot_query_service::data_source::storage::no_storage::Transaction<'a>
where - Payload<Types>: QueryablePayload<Types>,

source§

impl<Types> UpdateAvailabilityStorage<Types> for hotshot_query_service::data_source::storage::sql::Transaction<Write>
where + Payload<Types>: QueryablePayload<Types>,

source§

impl<Types> UpdateAvailabilityStorage<Types> for hotshot_query_service::data_source::storage::sql::Transaction<Write>
where Types: NodeType, Payload<Types>: QueryablePayload<Types>, Header<Types>: QueryableHeader<Types>,

source§

impl<Types, T> UpdateAvailabilityStorage<Types> for hotshot_query_service::data_source::storage::fail_storage::Transaction<T>
where diff --git a/hotshot_query_service/data_source/trait.Transaction.html b/hotshot_query_service/data_source/trait.Transaction.html index e028d38e4..08c8e8244 100644 --- a/hotshot_query_service/data_source/trait.Transaction.html +++ b/hotshot_query_service/data_source/trait.Transaction.html @@ -13,5 +13,5 @@ Types: NodeType, Payload<Types>: QueryablePayload<Types>,

source§

impl<'a, Types> Transaction for hotshot_query_service::data_source::storage::fs::Transaction<RwLockWriteGuard<'a, FileSystemStorageInner<Types>>>
where Types: NodeType, - Payload<Types>: QueryablePayload<Types>,

source§

impl<Mode: TransactionMode> Transaction for hotshot_query_service::data_source::storage::sql::Transaction<Mode>

source§

impl<T> Transaction for hotshot_query_service::data_source::storage::fail_storage::Transaction<T>
where + Payload<Types>: QueryablePayload<Types>,

source§

impl<Mode: TransactionMode> Transaction for hotshot_query_service::data_source::storage::sql::Transaction<Mode>

source§

impl<T> Transaction for hotshot_query_service::data_source::storage::fail_storage::Transaction<T>
where T: Transaction,

\ 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 ad1357f01..ece0c1e07 100644 --- a/hotshot_query_service/data_source/trait.VersionedDataSource.html +++ b/hotshot_query_service/data_source/trait.VersionedDataSource.html @@ -41,9 +41,9 @@ where Self: 'a
source§

type ReadOnly<'a> = Transaction<'a> where - Self: 'a

source§

impl VersionedDataSource for SqlStorage

source§

type Transaction<'a> = Transaction<Write> + Self: 'a

source§

impl VersionedDataSource for SqlStorage

source§

type Transaction<'a> = Transaction<Write> where - Self: 'a

source§

type ReadOnly<'a> = Transaction<Read> + Self: 'a

source§

type ReadOnly<'a> = Transaction<Read> where Self: 'a

source§

impl<D, U> VersionedDataSource for ExtensibleDataSource<D, U>
where D: VersionedDataSource + Send, diff --git a/hotshot_query_service/enum.QueryError.html b/hotshot_query_service/enum.QueryError.html index 7a6ede82d..fcb5a6f6f 100644 --- a/hotshot_query_service/enum.QueryError.html +++ b/hotshot_query_service/enum.QueryError.html @@ -13,7 +13,7 @@ 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)>

Returns 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 From<Error> for QueryError

source§

fn from(err: Error) -> Self

Converts to this type from the input type.
source§

impl From<QueryError> for Error

source§

fn from(original: QueryError) -> Error

Converts to this type from the input type.
source§

impl From<QueryError> for Error

source§

fn from(original: QueryError) -> Error

Converts to this type from the input type.
source§

impl From<QueryError> for GetBlockDetailError

source§

fn from(value: QueryError) -> Self

Converts to this type from the input type.
source§

impl From<QueryError> for GetBlockSummariesError

source§

fn from(value: QueryError) -> Self

Converts to this type from the input type.
source§

impl From<QueryError> for GetExplorerSummaryError

source§

fn from(value: QueryError) -> Self

Converts to this type from the input type.
source§

impl From<QueryError> for GetSearchResultsError

source§

fn from(value: QueryError) -> Self

Converts to this type from the input type.
source§

impl From<QueryError> for GetTransactionDetailError

source§

fn from(value: QueryError) -> Self

Converts to this type from the input type.
source§

impl From<QueryError> for GetTransactionSummariesError

source§

fn from(value: QueryError) -> Self

Converts to this type from the input type.
source§

impl From<TimestampConversionError> for QueryError

source§

fn from(value: TimestampConversionError) -> Self

Converts to this type from the input type.
source§

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

source§

impl From<Error> for QueryError

source§

fn from(err: Error) -> Self

Converts to this type from the input type.
source§

impl From<QueryError> for Error

source§

fn from(original: QueryError) -> Error

Converts to this type from the input type.
source§

impl From<QueryError> for Error

source§

fn from(original: QueryError) -> Error

Converts to this type from the input type.
source§

impl From<QueryError> for GetBlockDetailError

source§

fn from(value: QueryError) -> Self

Converts to this type from the input type.
source§

impl From<QueryError> for GetBlockSummariesError

source§

fn from(value: QueryError) -> Self

Converts to this type from the input type.
source§

impl From<QueryError> for GetExplorerSummaryError

source§

fn from(value: QueryError) -> Self

Converts to this type from the input type.
source§

impl From<QueryError> for GetSearchResultsError

source§

fn from(value: QueryError) -> Self

Converts to this type from the input type.
source§

impl From<QueryError> for GetTransactionDetailError

source§

fn from(value: QueryError) -> Self

Converts to this type from the input type.
source§

impl From<QueryError> for GetTransactionSummariesError

source§

fn from(value: QueryError) -> Self

Converts to this type from the input type.
source§

impl From<TimestampConversionError> for QueryError

source§

fn from(value: TimestampConversionError) -> Self

Converts to this type from the input type.
source§

impl<__T0> IntoError<QueryError> for ErrorSnafu<__T0>
where QueryError: Error + ErrorCompat, __T0: Into<String>,

source§

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 MissingSnafu
where QueryError: Error + ErrorCompat,

source§

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 NotFoundSnafu
where diff --git a/hotshot_query_service/explorer/struct.BlockDetail.html b/hotshot_query_service/explorer/struct.BlockDetail.html index 3bba5f1ae..3b1e3b020 100644 --- a/hotshot_query_service/explorer/struct.BlockDetail.html +++ b/hotshot_query_service/explorer/struct.BlockDetail.html @@ -1,4 +1,4 @@ -BlockDetail in hotshot_query_service::explorer - Rust

Struct hotshot_query_service::explorer::BlockDetail

source ·
pub struct BlockDetail<Types: NodeType>
where +BlockDetail in hotshot_query_service::explorer - Rust

Struct hotshot_query_service::explorer::BlockDetail

source ·
pub struct BlockDetail<Types: NodeType>
where Header<Types>: ExplorerHeader<Types>,
{ pub hash: BlockHash<Types>, pub height: u64, @@ -14,7 +14,7 @@ Header<Types>: ExplorerHeader<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 BlockDetail<Types>
where Header<Types>: ExplorerHeader<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: NodeType> From<BlockDetail<Types>> for BlockDetailResponse<Types>
where - Header<Types>: ExplorerHeader<Types>,

source§

fn from(block_detail: BlockDetail<Types>) -> Self

Converts to this type from the input type.
source§

impl<'r, Types> FromRow<'r, <Postgres as Database>::Row> for BlockDetail<Types>
where + Header<Types>: ExplorerHeader<Types>,

source§

fn from(block_detail: BlockDetail<Types>) -> Self

Converts to this type from the input type.
source§

impl<'r, Types> FromRow<'r, <Sqlite as Database>::Row> for BlockDetail<Types>
where Types: NodeType, Header<Types>: QueryableHeader<Types> + ExplorerHeader<Types>, Payload<Types>: QueryablePayload<Types>, diff --git a/hotshot_query_service/explorer/struct.BlockSummary.html b/hotshot_query_service/explorer/struct.BlockSummary.html index 0925b2669..8163d6179 100644 --- a/hotshot_query_service/explorer/struct.BlockSummary.html +++ b/hotshot_query_service/explorer/struct.BlockSummary.html @@ -1,4 +1,4 @@ -BlockSummary in hotshot_query_service::explorer - Rust

Struct hotshot_query_service::explorer::BlockSummary

source ·
pub struct BlockSummary<Types: NodeType>
where +BlockSummary in hotshot_query_service::explorer - Rust

Struct hotshot_query_service::explorer::BlockSummary

source ·
pub struct BlockSummary<Types: NodeType>
where Header<Types>: ExplorerHeader<Types>,
{ pub hash: BlockHash<Types>, pub height: u64, @@ -12,7 +12,7 @@

Fields§

§hash: BlockHash<Types>§height: u64§proposer_id: ProposerId<Types>§num_transactions: u64§size: u64§time: Timestamp

Trait Implementations§

source§

impl<Types: Debug + NodeType> Debug for BlockSummary<Types>
where Header<Types>: ExplorerHeader<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 BlockSummary<Types>
where Header<Types>: ExplorerHeader<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<'r, Types> FromRow<'r, <Postgres as Database>::Row> for BlockSummary<Types>
where + __D: Deserializer<'de>,

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

impl<'r, Types> FromRow<'r, <Sqlite as Database>::Row> for BlockSummary<Types>
where Types: NodeType, Header<Types>: QueryableHeader<Types> + ExplorerHeader<Types>, Payload<Types>: QueryablePayload<Types>,

source§

fn from_row(row: &'r <Db as Database>::Row) -> Result<Self>

source§

impl<Types: PartialEq + NodeType> PartialEq for BlockSummary<Types>
where diff --git a/hotshot_query_service/index.html b/hotshot_query_service/index.html index a8ba72bb0..34f8d37fe 100644 --- a/hotshot_query_service/index.html +++ b/hotshot_query_service/index.html @@ -291,6 +291,6 @@

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