iroh_blobs::protocol

Type Alias ChunkRanges

pub type ChunkRanges = RangeSet<[ChunkNum; 2]>;
Expand description

A set of chunk ranges

Aliased Type§

struct ChunkRanges(/* private fields */);

Trait Implementations§

Source§

impl ChunkRangesExt for ChunkRanges

Source§

fn chunk(offset: u64) -> Self

Create a chunk range that contains a single chunk.

Source§

fn bytes(ranges: impl RangeBounds<u64>) -> Self

Create a range of chunks that contains the given byte ranges. The byte ranges are rounded up to the nearest chunk size.

Source§

fn chunks(ranges: impl RangeBounds<u64>) -> Self

Create a range of chunks from u64 chunk bounds.

This is equivalent but more convenient than using the ChunkNum newtype.

Source§

fn offset(offset: u64) -> Self

Create a chunk range that contains a single byte offset.

Source§

fn last_chunk() -> Self