#[non_exhaustive]pub struct GetBlocksOptions {
pub query: Option<BlockQueryInput>,
pub limit: Option<i32>,
pub sort_by: Option<BlockSortBy>,
}Expand description
Options for ArchiveClient::get_blocks. All fields are optional.
#[non_exhaustive], so build it from GetBlocksOptions::default and the
setters rather than with a struct literal:
use mina_archive_sdk::{BlockQueryInput, BlockSortBy, GetBlocksOptions};
let opts = GetBlocksOptions::default()
.query(BlockQueryInput {
canonical: Some(true),
..Default::default()
})
.limit(50)
.sort_by(BlockSortBy::Desc);Omitting limit lets the server apply its own default of 200, capped
at 10,000 — not “every block”.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.query: Option<BlockQueryInput>§limit: Option<i32>GraphQL Int is signed 32-bit, hence i32. Server default 200, cap
10,000.
sort_by: Option<BlockSortBy>Implementations§
Source§impl GetBlocksOptions
impl GetBlocksOptions
Sourcepub fn query(self, query: BlockQueryInput) -> Self
pub fn query(self, query: BlockQueryInput) -> Self
Filter by height/date range and chain status.
Sourcepub fn limit(self, limit: i32) -> Self
pub fn limit(self, limit: i32) -> Self
Cap the number of blocks returned. The server defaults to 200 and refuses more than 10,000.
Sourcepub fn sort_by(self, sort_by: BlockSortBy) -> Self
pub fn sort_by(self, sort_by: BlockSortBy) -> Self
Order the results by block height.
Trait Implementations§
Source§impl Clone for GetBlocksOptions
impl Clone for GetBlocksOptions
Source§impl Debug for GetBlocksOptions
impl Debug for GetBlocksOptions
Auto Trait Implementations§
impl Freeze for GetBlocksOptions
impl RefUnwindSafe for GetBlocksOptions
impl Send for GetBlocksOptions
impl Sync for GetBlocksOptions
impl Unpin for GetBlocksOptions
impl UnsafeUnpin for GetBlocksOptions
impl UnwindSafe for GetBlocksOptions
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
Mutably borrows from an owned value. Read more