pub enum WantRequest {
Blob {
handle: Inline<Handle<UnknownBlob>>,
},
}Expand description
A durable request for absent content.
A request names only what it wants, and a fulfiller satisfies it by fetching the content. Requests for work – “someone compute this merge or derivation” – were once a second shape here and are gone: a blob want costs the wanter the bytes, so a flood floods itself, while a computation want costs the wanter nothing and asks others to pay; whoever wants a computation runs it.
Variants§
Blob
Obtain and retain one content-addressed blob according to local policy.
Fields
handle: Inline<Handle<UnknownBlob>>Type-erased bearer handle used for local lookup or global discovery.
Implementations§
Source§impl WantRequest
impl WantRequest
Sourcepub fn blob<S>(handle: Inline<Handle<S>>) -> WantRequest
pub fn blob<S>(handle: Inline<Handle<S>>) -> WantRequest
Construct a blob request from any typed content handle.
Sourcepub const fn blob_handle(self) -> Option<Inline<Handle<UnknownBlob>>>
pub const fn blob_handle(self) -> Option<Inline<Handle<UnknownBlob>>>
Return the requested blob handle, if this is an exact-content request.
Sourcepub fn blob_references(self) -> impl ExactSizeIterator
pub fn blob_references(self) -> impl ExactSizeIterator
Blob handles named directly by this durable request.
WANT is an ordinary structural lifetime record: when retained it owns whichever of these handles are resident, recursively. The method does not fetch absent bytes or turn them into subordinate wants.
Sourcepub fn to_bytes(self) -> [u8; 97]
pub fn to_bytes(self) -> [u8; 97]
Encode this request into its exact tagged 97-byte representation.
Sourcepub fn from_bytes(
bytes: [u8; 97],
) -> Result<WantRequest, WantRequestDecodeError>
pub fn from_bytes( bytes: [u8; 97], ) -> Result<WantRequest, WantRequestDecodeError>
Decode one exact canonical 97-byte request.
Trait Implementations§
Source§impl Clone for WantRequest
impl Clone for WantRequest
Source§fn clone(&self) -> WantRequest
fn clone(&self) -> WantRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for WantRequest
Source§impl Debug for WantRequest
impl Debug for WantRequest
impl Eq for WantRequest
Source§impl Hash for WantRequest
impl Hash for WantRequest
Source§impl Ord for WantRequest
impl Ord for WantRequest
Source§fn cmp(&self, other: &WantRequest) -> Ordering
fn cmp(&self, other: &WantRequest) -> Ordering
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialEq for WantRequest
impl PartialEq for WantRequest
Source§impl PartialOrd for WantRequest
impl PartialOrd for WantRequest
impl StructuralPartialEq for WantRequest
Auto Trait Implementations§
impl Freeze for WantRequest
impl RefUnwindSafe for WantRequest
impl Send for WantRequest
impl Sync for WantRequest
impl Unpin for WantRequest
impl UnsafeUnpin for WantRequest
impl UnwindSafe for WantRequest
Blanket Implementations§
impl<T> ArchiveOwner for T
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,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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