pub struct CompactBlock {
pub header: BlockHeader,
pub nonce: u64,
pub short_ids: Vec<ShortTxId>,
pub prefilled_txs: Vec<(usize, Transaction)>,
}Expand description
Compact block representation (header + short IDs + prefilled txs).
Fields§
§header: BlockHeaderBlock header
nonce: u64Nonce for short ID calculation (64-bit)
short_ids: Vec<ShortTxId>Short transaction IDs (6 bytes each)
prefilled_txs: Vec<(usize, Transaction)>Prefilled transactions (full txs for selected indices)
Trait Implementations§
Source§impl Clone for CompactBlock
impl Clone for CompactBlock
Source§fn clone(&self) -> CompactBlock
fn clone(&self) -> CompactBlock
Returns a duplicate 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 CompactBlock
impl Debug for CompactBlock
Source§impl<'de> Deserialize<'de> for CompactBlock
impl<'de> Deserialize<'de> for CompactBlock
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 From<&CmpctBlockMessage> for CompactBlock
impl From<&CmpctBlockMessage> for CompactBlock
Source§fn from(msg: &CmpctBlockMessage) -> Self
fn from(msg: &CmpctBlockMessage) -> Self
Converts to this type from the input type.
Source§impl From<CmpctBlockMessage> for CompactBlock
impl From<CmpctBlockMessage> for CompactBlock
Source§fn from(msg: CmpctBlockMessage) -> Self
fn from(msg: CmpctBlockMessage) -> Self
Converts to this type from the input type.
Source§impl PartialEq for CompactBlock
impl PartialEq for CompactBlock
Source§impl Serialize for CompactBlock
impl Serialize for CompactBlock
Source§impl TryFrom<CompactBlock> for CmpctBlockMessage
impl TryFrom<CompactBlock> for CmpctBlockMessage
Source§fn try_from(value: CompactBlock) -> Result<Self, Self::Error>
fn try_from(value: CompactBlock) -> Result<Self, Self::Error>
Builds a cmpctblock-shaped message from the integration crate::bip152::CompactBlock.
Prefilled entries are sorted by transaction index (required for BIP152 diff-encoding on the wire).
Witness stacks are not represented on crate::bip152::CompactBlock; prefilled txs use witness: None.
Source§type Error = CompactBlockWireConvertError
type Error = CompactBlockWireConvertError
The type returned in the event of a conversion error.
impl Eq for CompactBlock
impl StructuralPartialEq for CompactBlock
Auto Trait Implementations§
impl Freeze for CompactBlock
impl RefUnwindSafe for CompactBlock
impl Send for CompactBlock
impl Sync for CompactBlock
impl Unpin for CompactBlock
impl UnsafeUnpin for CompactBlock
impl UnwindSafe for CompactBlock
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§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
Converts
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>
Converts
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 more