let mime = mime_guess::from_path(path).first_or_octet_stream(); Ok( Response::builder() .header(header::CONTENT_TYPE, mime.as_ref()) .body(body) .unwrap(), ) } async fn block_count(Extension(index): Extension>) -> ServerResult { Ok(index.block_count()?.to_string()) } async fn block_height(Extension(index): Extension>) -> ServerResult { Ok( index .block_height()? .ok_or_not_found(|| "blockheight")? .to_string(), ) } async fn block_hash(Extension(index): Extension>) -> ServerResult { Ok( index .block_hash(None)? .ok_or_not_found(|| "blockhash")? .to_string(), ) } async fn block_hash_json(Extension(index): Extension>) -> ServerResult> { Ok(Json( index .block_hash(None)? .ok_or_not_found(|| "blockhash")? .to_string(), )) } async fn block_hash_from_height(