Struct iroh_bytes::protocol::GetRequest
source · pub struct GetRequest {
pub hash: Hash,
pub ranges: RangeSpecSeq,
/* private fields */
}Expand description
A request
Fields§
§hash: Hashblake3 hash
ranges: RangeSpecSeqThe range of data to request
The first element is the parent, all subsequent elements are children.
Implementations§
source§impl GetRequest
impl GetRequest
sourcepub fn new(hash: Hash, ranges: RangeSpecSeq) -> Self
pub fn new(hash: Hash, ranges: RangeSpecSeq) -> Self
Request a blob or collection with specified ranges
sourcepub fn last_chunk(hash: Hash) -> Self
pub fn last_chunk(hash: Hash) -> Self
Request the last chunk of a single blob
This can be used to get the verified size of a blob.
sourcepub fn last_chunks(hash: Hash) -> Self
pub fn last_chunks(hash: Hash) -> Self
Request the last chunk for all children
This can be used to get the verified size of all children.
sourcepub fn with_token(self, token: Option<RequestToken>) -> Self
pub fn with_token(self, token: Option<RequestToken>) -> Self
Set the request token
sourcepub fn token(&self) -> Option<&RequestToken>
pub fn token(&self) -> Option<&RequestToken>
Get the request token
Trait Implementations§
source§impl Clone for GetRequest
impl Clone for GetRequest
source§fn clone(&self) -> GetRequest
fn clone(&self) -> GetRequest
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moresource§impl Debug for GetRequest
impl Debug for GetRequest
source§impl<'de> Deserialize<'de> for GetRequest
impl<'de> Deserialize<'de> for GetRequest
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 From<GetRequest> for Request
impl From<GetRequest> for Request
source§fn from(value: GetRequest) -> Self
fn from(value: GetRequest) -> Self
Converts to this type from the input type.
source§impl PartialEq for GetRequest
impl PartialEq for GetRequest
source§fn eq(&self, other: &GetRequest) -> bool
fn eq(&self, other: &GetRequest) -> bool
This method tests for
self and other values to be equal, and is used
by ==.source§impl Serialize for GetRequest
impl Serialize for GetRequest
impl Eq for GetRequest
impl StructuralEq for GetRequest
impl StructuralPartialEq for GetRequest
Auto Trait Implementations§
impl RefUnwindSafe for GetRequest
impl Send for GetRequest
impl Sync for GetRequest
impl Unpin for GetRequest
impl UnwindSafe for GetRequest
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