pub struct ContentGetAnswer {
pub size: u64,
pub offset: u64,
/* private fields */
}Expand description
What a request for content answers: the whole content’s size, where the piece starts, and the piece itself.
Fields§
§size: u64The whole content’s length.
offset: u64Where this piece starts.
Implementations§
Source§impl ContentGetAnswer
impl ContentGetAnswer
Sourcepub fn new(piece: ContentPiece) -> Result<Self, ActionCallError>
pub fn new(piece: ContentPiece) -> Result<Self, ActionCallError>
The answer for piece.
§Errors
A piece longer than super::MAX_CONTENT_FRAME_BYTES, which no
frame carries.
Sourcepub fn next_offset(&self) -> Option<u64>
pub fn next_offset(&self) -> Option<u64>
Where a next piece starts, or None when this one ends the content.
Trait Implementations§
Source§impl Clone for ContentGetAnswer
impl Clone for ContentGetAnswer
Source§impl Debug for ContentGetAnswer
impl Debug for ContentGetAnswer
Source§impl<'de> Deserialize<'de> for ContentGetAnswer
impl<'de> Deserialize<'de> for ContentGetAnswer
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
impl Eq for ContentGetAnswer
Source§impl PartialEq for ContentGetAnswer
impl PartialEq for ContentGetAnswer
Source§impl Serialize for ContentGetAnswer
impl Serialize for ContentGetAnswer
impl StructuralPartialEq for ContentGetAnswer
Auto Trait Implementations§
impl Forget for ContentGetAnswer
impl Freeze for ContentGetAnswer
impl Move for ContentGetAnswer
impl RefUnwindSafe for ContentGetAnswer
impl Send for ContentGetAnswer
impl Sync for ContentGetAnswer
impl Unpin for ContentGetAnswer
impl UnsafeUnpin for ContentGetAnswer
impl UnwindSafe for ContentGetAnswer
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§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> ⓘ
Converts
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> ⓘ
Converts
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