Struct iroh_bytes::protocol::RangeSpec
source · #[repr(transparent)]pub struct RangeSpec(_);Expand description
A chunk range specification.
this is a sequence of spans, where the first span is considered false, and each subsequent span is alternating.
Examples:
The range 10..33 would be encoded as [10, 23]
The empty range would be encoded as the empty array []
A full interval .. would be encoded as [0]
A half open interval 15.. would be encoded as [15]
All values except for the first one must be non-zero. The first value may be zero. Values are bao chunk numbers, not byte offsets.
This is a SmallVec so we can avoid allocations for the very common case of a single chunk range.
Implementations§
Trait Implementations§
source§impl<'de> Deserialize<'de> for RangeSpec
impl<'de> Deserialize<'de> for RangeSpec
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 PartialEq<RangeSpec> for RangeSpec
impl PartialEq<RangeSpec> for RangeSpec
impl Eq for RangeSpec
impl StructuralEq for RangeSpec
impl StructuralPartialEq for RangeSpec
Auto Trait Implementations§
impl RefUnwindSafe for RangeSpec
impl Send for RangeSpec
impl Sync for RangeSpec
impl Unpin for RangeSpec
impl UnwindSafe for RangeSpec
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