pub enum BlockResponse {
Regular(ResponseFormat<BlockView>),
WithCycles(BlockWithCyclesResponse),
}
Expand description
The wrapper represent response of get_block
| get_block_by_number
, return a Block with cycles.
Variants§
Regular(ResponseFormat<BlockView>)
The block response regular format
BlockView
| `SerializedBlock` - The block structure
WithCycles(BlockWithCyclesResponse)
The block with cycles response format
A JSON object with the following fields:
block
:BlockView
| `SerializedBlock` - The block structurecycles
:Array<
Cycle
>
|
null
- The block transactions consumed cycles.
Implementations§
Source§impl BlockResponse
impl BlockResponse
Sourcepub fn regular(block: ResponseFormat<BlockView>) -> Self
pub fn regular(block: ResponseFormat<BlockView>) -> Self
Wrap regular block response
Sourcepub fn with_cycles(
block: ResponseFormat<BlockView>,
cycles: Option<Vec<Cycle>>,
) -> Self
pub fn with_cycles( block: ResponseFormat<BlockView>, cycles: Option<Vec<Cycle>>, ) -> Self
Wrap with cycles block response
Trait Implementations§
Source§impl Clone for BlockResponse
impl Clone for BlockResponse
Source§fn clone(&self) -> BlockResponse
fn clone(&self) -> BlockResponse
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for BlockResponse
impl Debug for BlockResponse
Source§impl<'de> Deserialize<'de> for BlockResponse
impl<'de> Deserialize<'de> for BlockResponse
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
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 Hash for BlockResponse
impl Hash for BlockResponse
Source§impl JsonSchema for BlockResponse
impl JsonSchema for BlockResponse
Source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read moreSource§impl PartialEq for BlockResponse
impl PartialEq for BlockResponse
Source§impl Serialize for BlockResponse
impl Serialize for BlockResponse
impl Eq for BlockResponse
impl StructuralPartialEq for BlockResponse
Auto Trait Implementations§
impl !Freeze for BlockResponse
impl RefUnwindSafe for BlockResponse
impl Send for BlockResponse
impl Sync for BlockResponse
impl Unpin for BlockResponse
impl UnwindSafe for BlockResponse
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)