struct PartialMessage {
deadline: Instant,
expires_at: Instant,
total_len: usize,
topic: Option<String>,
next_index: u32,
payload: Vec<u8>,
}Fields§
§deadline: InstantREASSEMBLY_TIMEOUT after the first fragment.
expires_at: InstantTime at which the message is discarded if still incomplete: the earlier of deadline and
REASSEMBLY_IDLE_TIMEOUT after the last fragment.
total_len: usize§topic: Option<String>§next_index: u32§payload: Vec<u8>Grows with the received data, so a peer that declares a large size without sending it does not hold that memory.
Implementations§
Source§impl PartialMessage
impl PartialMessage
Sourcefn check(
&self,
header: &FragmentHeader,
topic: &Option<String>,
data_len: usize,
) -> Result<(), ReassemblyError>
fn check( &self, header: &FragmentHeader, topic: &Option<String>, data_len: usize, ) -> Result<(), ReassemblyError>
Returns an error if a fragment cannot be the next one of this message.
fn append(&mut self, data: &[u8])
fn is_complete(&self) -> bool
Auto Trait Implementations§
impl Freeze for PartialMessage
impl RefUnwindSafe for PartialMessage
impl Send for PartialMessage
impl Sync for PartialMessage
impl Unpin for PartialMessage
impl UnsafeUnpin for PartialMessage
impl UnwindSafe for PartialMessage
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
§impl<T> CompatExt for T
impl<T> CompatExt for T
§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
Create a new handle for an Arc value Read more
§unsafe fn clone_handle(handle: Handle) -> Handle
unsafe fn clone_handle(handle: Handle) -> Handle
Clone a handle Read more
§unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ
unsafe fn consume_handle(handle: Handle) -> Arc<T> ⓘ
Consume a handle, getting back the initial
Arc<> Read more