pub struct PieceData {
pub est_seq: Option<TempSeq>,
pub session_id: TempSeq,
pub chunk: ChunkId,
pub desc: PieceDesc,
pub data: Vec<u8>,
}
Fields§
§est_seq: Option<TempSeq>
§session_id: TempSeq
§chunk: ChunkId
§desc: PieceDesc
§data: Vec<u8>
Implementations§
Source§impl PieceData
impl PieceData
pub fn max_header_len() -> usize
pub fn max_payload() -> usize
pub fn encode_header<'a>( buf: &'a mut [u8], session_id: &TempSeq, chunk: &ChunkId, desc: &PieceDesc, ) -> BuckyResult<&'a mut [u8]>
pub fn reset_estimate(buf: &mut [u8], est_seq: TempSeq)
pub fn decode_from_raw_data(buf: &[u8]) -> BuckyResult<Self>
Auto Trait Implementations§
impl Freeze for PieceData
impl RefUnwindSafe for PieceData
impl Send for PieceData
impl Sync for PieceData
impl Unpin for PieceData
impl UnwindSafe for PieceData
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> 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