s2n_quic_core/buffer/reassembler/duplex.rs
1// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
2// SPDX-License-Identifier: Apache-2.0
3
4use super::Reassembler;
5use crate::{
6 buffer::{duplex::Skip, Error},
7 varint::VarInt,
8};
9
10impl Skip for Reassembler {
11 #[inline]
12 fn skip(&mut self, len: VarInt, final_offset: Option<VarInt>) -> Result<(), Error> {
13 // write the final offset first, if possible
14 if let Some(offset) = final_offset {
15 self.write_at_fin(offset, &[])?;
16 }
17
18 // then skip the bytes
19 (*self).skip(len)?;
20
21 Ok(())
22 }
23}