pub struct HashRequest {
pub file_root: Id32,
pub base: u32,
pub index: u32,
pub count: u32,
pub proof_layers: u32,
}Expand description
A request for Merkle tree hashes (BEP 52).
Represents a range of hashes at a specific layer of a file’s Merkle tree.
base = 0 is the leaf (block) layer, higher values are coarser layers.
The piece layer is at log2(piece_length / 16384).
Fields§
§file_root: Id32SHA-256 root hash of the file’s Merkle tree.
base: u32Tree layer: 0 = block layer, piece_layer = log2(blocks_per_piece).
index: u32Index of the first hash at the specified layer.
count: u32Number of hashes requested.
proof_layers: u32Number of uncle proof layers needed for verification.
Trait Implementations§
Source§impl Clone for HashRequest
impl Clone for HashRequest
Source§fn clone(&self) -> HashRequest
fn clone(&self) -> HashRequest
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 HashRequest
impl Debug for HashRequest
Source§impl PartialEq for HashRequest
impl PartialEq for HashRequest
Source§fn eq(&self, other: &HashRequest) -> bool
fn eq(&self, other: &HashRequest) -> bool
Tests for
self and other values to be equal, and is used by ==.impl Eq for HashRequest
impl StructuralPartialEq for HashRequest
Auto Trait Implementations§
impl Freeze for HashRequest
impl RefUnwindSafe for HashRequest
impl Send for HashRequest
impl Sync for HashRequest
impl Unpin for HashRequest
impl UnsafeUnpin for HashRequest
impl UnwindSafe for HashRequest
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