pub fn wrap_node_data<T>(block: T) -> Result<NodeData<T>, quick_protobuf::Error>
where
    T: AsRef<[u8]>,
{
    let full = block.as_ref();
    let range = node_data(full)?
        .map(|data| subslice_to_range(full, data).expect("this has to be in range"));
    Ok(NodeData {
        inner: block,
        range,
    })
}
/// Creates a wrapper around the given block representation which does not consume the block
/// representation but allows accessing the dag-pb node Data.
Creates a wrapper around the given block representation which does not consume the block
representation but allows accessing the dag-pb node Data.
Creates a wrapper around the given block representation which does not consume the block representation but allows accessing the dag - pb node Data .
pub fn wrap_node_data<T>(block: T) -> Result<NodeData<T>, quick_protobuf::Error>
where
    T: AsRef<[u8]>,
{
    let full = block.as_ref();
    let range = node_data(full)?
        .map(|data| subslice_to_range(full, data).expect("this has to be in range"));
    Ok(NodeData {
        inner: block,
        range,
    })
}
pub fn wrap_node_data < T > ( block : T ) -> Result < NodeData < T > , quick_protobuf :: Error > where T : AsRef < [ u8 ] > , { let full = block . as_ref ( ) ; let range = node_data ( full ) ? . map ( | data | subslice_to_range ( full , data ) . expect ( " " ) ) ; Ok ( NodeData { inner : block , range , } ) }
Creates a wrapper around the given block representation which does not consume the block
representation but allows accessing the dag-pb node Data.
Creates a wrapper around the given block representation which does not consume the block representation but allows accessing the dag - pb node Data .
block
T