pub struct CommittedSet { /* private fields */ }Expand description
A session’s committed set: sorted, disjoint, coalesced, half-open byte ranges inside
[0, size).
Implementations§
Source§impl CommittedSet
impl CommittedSet
Sourcepub fn prefix(end: u64) -> Self
pub fn prefix(end: u64) -> Self
The prefix [0, end): what an older server’s bare X-Capsule-Offset says it holds.
Sourcepub fn parse(header: &str, size: u64) -> Option<Self>
pub fn parse(header: &str, size: u64) -> Option<Self>
Parse X-Capsule-Committed for a session of size bytes.
Every range must be well formed (start-end, inclusive, start <= end), ascending and
disjoint, inside the declared size, start on the grid, and end on it or at the size. A
value that breaks any rule is None, so a malformed header is ignored rather than
trusted: planning from it could put a range off the grid or over committed bytes. The
empty value is the empty set.
Sourcepub fn prefix_end(&self) -> u64
pub fn prefix_end(&self) -> u64
The committed prefix: the end of the range starting at zero, or zero.
Sourcepub fn contains(&self, start: u64, end: u64) -> bool
pub fn contains(&self, start: u64, end: u64) -> bool
Whether every byte of [start, end) is committed.
Sourcepub fn overlaps(&self, start: u64, end: u64) -> bool
pub fn overlaps(&self, start: u64, end: u64) -> bool
Whether any byte of [start, end) is in the set.
Trait Implementations§
Source§impl Clone for CommittedSet
impl Clone for CommittedSet
Source§fn clone(&self) -> CommittedSet
fn clone(&self) -> CommittedSet
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CommittedSet
impl Debug for CommittedSet
Source§impl Default for CommittedSet
impl Default for CommittedSet
Source§fn default() -> CommittedSet
fn default() -> CommittedSet
impl Eq for CommittedSet
Source§impl PartialEq for CommittedSet
impl PartialEq for CommittedSet
Source§fn eq(&self, other: &CommittedSet) -> bool
fn eq(&self, other: &CommittedSet) -> bool
self and other values to be equal, and is used by ==.impl StructuralPartialEq for CommittedSet
Auto Trait Implementations§
impl Freeze for CommittedSet
impl RefUnwindSafe for CommittedSet
impl Send for CommittedSet
impl Sync for CommittedSet
impl Unpin for CommittedSet
impl UnsafeUnpin for CommittedSet
impl UnwindSafe for CommittedSet
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> CompatExt for T
impl<T> CompatExt for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T, UT> HandleAlloc<UT> for T
impl<T, UT> HandleAlloc<UT> for T
§fn new_handle(value: Arc<T>) -> Handle
fn new_handle(value: Arc<T>) -> Handle
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
§unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ
unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ
Arc<> Read more§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more