pub enum BlockchainReadRequest {
Show 21 variants
BlockExtendedHeader(usize),
BlockHash(usize, Chain),
FindBlock([u8; 32]),
FilterUnknownHashes(HashSet<[u8; 32]>),
BlockExtendedHeaderInRange(Range<usize>, Chain),
ChainHeight,
GeneratedCoins(usize),
Outputs(HashMap<u64, HashSet<u64>>),
NumberOutputsWithAmount(Vec<u64>),
KeyImagesSpent(HashSet<[u8; 32]>),
CompactChainHistory,
FindFirstUnknown(Vec<[u8; 32]>),
AltBlocksInChain(ChainId),
Block {
height: usize,
},
BlockByHash([u8; 32]),
TotalTxCount,
DatabaseSize,
OutputHistogram(OutputHistogramInput),
CoinbaseTxSum {
height: usize,
count: u64,
},
AltChains,
AltChainCount,
}
Expand description
A read request to the blockchain database.
This pairs with BlockchainResponse
, where each variant here
matches in name with a BlockchainResponse
variant. For example,
the proper response for a BlockchainReadRequest::BlockHash
would be a BlockchainResponse::BlockHash
.
See Response
for the expected responses per Request
.
Variants§
BlockExtendedHeader(usize)
Request a block’s extended header.
The input is the block’s height.
BlockHash(usize, Chain)
Request a block’s hash.
The input is the block’s height and the chain it is on.
FindBlock([u8; 32])
Request to check if we have a block and which Chain
it is on.
The input is the block’s hash.
FilterUnknownHashes(HashSet<[u8; 32]>)
Removes the block hashes that are not in the main chain.
This should filter (remove) hashes in alt-blocks as well.
BlockExtendedHeaderInRange(Range<usize>, Chain)
Request a range of block extended headers.
The input is a range of block heights.
ChainHeight
Request the current chain height.
Note that this is not the top-block height.
GeneratedCoins(usize)
Request the total amount of generated coins (atomic units) at this height.
Outputs(HashMap<u64, HashSet<u64>>)
Request data for multiple outputs.
The input is a HashMap
where:
- Key = output amount
- Value = set of amount indices
For pre-RCT outputs, the amount is non-zero, and the amount indices represent the wanted indices of duplicate amount outputs, i.e.:
// list of outputs with amount 10
[0, 1, 2, 3, 4, 5]
// ^ ^
// we only want these two, so we would provide
// `amount: 10, amount_index: {1, 3}`
For RCT outputs, the amounts would be 0
and
the amount indices would represent the global
RCT output indices.
NumberOutputsWithAmount(Vec<u64>)
Request the amount of outputs with a certain amount.
The input is a list of output amounts.
KeyImagesSpent(HashSet<[u8; 32]>)
Check that all key images within a set are not spent.
Input is a set of key images.
CompactChainHistory
A request for the compact chain history.
FindFirstUnknown(Vec<[u8; 32]>)
A request to find the first unknown block ID in a list of block IDs.
§Invariant
The Vec
containing the block IDs must be sorted in chronological block
order, or else the returned response is unspecified and meaningless,
as this request performs a binary search.
AltBlocksInChain(ChainId)
A request for all alt blocks in the chain with the given ChainId
.
Block
Get a Block
by its height.
BlockByHash([u8; 32])
Get a Block
by its hash.
TotalTxCount
Get the total amount of non-coinbase transactions in the chain.
DatabaseSize
Get the current size of the database.
OutputHistogram(OutputHistogramInput)
Get an output histogram.
TODO: document fields after impl.
CoinbaseTxSum
Get the coinbase amount and the fees amount for
N
last blocks starting at particular height.
TODO: document fields after impl.
AltChains
Get information on all alternative chains.
AltChainCount
Get the amount of alternative chains that exist.
Trait Implementations§
Source§impl Clone for BlockchainReadRequest
impl Clone for BlockchainReadRequest
Source§fn clone(&self) -> BlockchainReadRequest
fn clone(&self) -> BlockchainReadRequest
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for BlockchainReadRequest
impl Debug for BlockchainReadRequest
Source§impl PartialEq for BlockchainReadRequest
impl PartialEq for BlockchainReadRequest
impl Eq for BlockchainReadRequest
impl StructuralPartialEq for BlockchainReadRequest
Auto Trait Implementations§
impl Freeze for BlockchainReadRequest
impl RefUnwindSafe for BlockchainReadRequest
impl Send for BlockchainReadRequest
impl Sync for BlockchainReadRequest
impl Unpin for BlockchainReadRequest
impl UnwindSafe for BlockchainReadRequest
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FmtForward for T
impl<T> FmtForward for T
Source§fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
fn fmt_binary(self) -> FmtBinary<Self>where
Self: Binary,
self
to use its Binary
implementation when Debug
-formatted.Source§fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
fn fmt_display(self) -> FmtDisplay<Self>where
Self: Display,
self
to use its Display
implementation when
Debug
-formatted.Source§fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
fn fmt_lower_exp(self) -> FmtLowerExp<Self>where
Self: LowerExp,
self
to use its LowerExp
implementation when
Debug
-formatted.Source§fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
fn fmt_lower_hex(self) -> FmtLowerHex<Self>where
Self: LowerHex,
self
to use its LowerHex
implementation when
Debug
-formatted.Source§fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
fn fmt_octal(self) -> FmtOctal<Self>where
Self: Octal,
self
to use its Octal
implementation when Debug
-formatted.Source§fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
fn fmt_pointer(self) -> FmtPointer<Self>where
Self: Pointer,
self
to use its Pointer
implementation when
Debug
-formatted.Source§fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
fn fmt_upper_exp(self) -> FmtUpperExp<Self>where
Self: UpperExp,
self
to use its UpperExp
implementation when
Debug
-formatted.Source§fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
fn fmt_upper_hex(self) -> FmtUpperHex<Self>where
Self: UpperHex,
self
to use its UpperHex
implementation when
Debug
-formatted.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self
and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self
, then passes self.as_ref()
into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self
, then passes self.as_mut()
into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self
, then passes self.deref()
into the pipe function.Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B>
of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B>
of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R>
view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R>
view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target
of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target
of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap()
only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut()
only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow()
only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut()
only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref()
only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut()
only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref()
only in debug builds, and is erased in release
builds.Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 56 bytes
Size for each variant:
BlockExtendedHeader
: 16 bytesBlockHash
: 24 bytesFindBlock
: 40 bytesFilterUnknownHashes
: 56 bytesBlockExtendedHeaderInRange
: 32 bytesChainHeight
: 0 bytesGeneratedCoins
: 16 bytesOutputs
: 56 bytesNumberOutputsWithAmount
: 32 bytesKeyImagesSpent
: 56 bytesCompactChainHistory
: 0 bytesFindFirstUnknown
: 32 bytesAltBlocksInChain
: 16 bytesBlock
: 16 bytesBlockByHash
: 40 bytesTotalTxCount
: 0 bytesDatabaseSize
: 0 bytesOutputHistogram
: 56 bytesCoinbaseTxSum
: 24 bytesAltChains
: 0 bytesAltChainCount
: 0 bytes