Enum ckb_jsonrpc_types::BlockResponse
source · 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 PartialEq for BlockResponse
impl PartialEq for BlockResponse
source§fn eq(&self, other: &BlockResponse) -> bool
fn eq(&self, other: &BlockResponse) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for BlockResponse
impl Serialize for BlockResponse
impl Eq for BlockResponse
impl StructuralEq for BlockResponse
impl StructuralPartialEq for BlockResponse
Auto Trait Implementations§
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