@@ -76,15 +76,15 @@ impl<K> PacketAssembler<K> {
7676 }
7777 }
7878
79- pub ( crate ) fn reset ( & mut self ) {
79+ pub fn reset ( & mut self ) {
8080 self . key = None ;
8181 self . assembler . clear ( ) ;
8282 self . total_size = None ;
8383 self . expires_at = Instant :: ZERO ;
8484 }
8585
8686 /// Set the total size of the packet assembler.
87- pub ( crate ) fn set_total_size ( & mut self , size : usize ) -> Result < ( ) , AssemblerError > {
87+ pub fn set_total_size ( & mut self , size : usize ) -> Result < ( ) , AssemblerError > {
8888 if let Some ( old_size) = self . total_size {
8989 if old_size != size {
9090 return Err ( AssemblerError ) ;
@@ -106,11 +106,11 @@ impl<K> PacketAssembler<K> {
106106 }
107107
108108 /// Return the instant when the assembler expires.
109- pub ( crate ) fn expires_at ( & self ) -> Instant {
109+ pub fn expires_at ( & self ) -> Instant {
110110 self . expires_at
111111 }
112112
113- pub ( crate ) fn add_with (
113+ pub fn add_with (
114114 & mut self ,
115115 offset : usize ,
116116 f : impl Fn ( & mut [ u8 ] ) -> Result < usize , AssemblerError > ,
@@ -138,7 +138,7 @@ impl<K> PacketAssembler<K> {
138138 ///
139139 /// - Returns [`Error::PacketAssemblerBufferTooSmall`] when trying to add data into the buffer at a non-existing
140140 /// place.
141- pub ( crate ) fn add ( & mut self , data : & [ u8 ] , offset : usize ) -> Result < ( ) , AssemblerError > {
141+ pub fn add ( & mut self , data : & [ u8 ] , offset : usize ) -> Result < ( ) , AssemblerError > {
142142 #[ cfg( not( feature = "alloc" ) ) ]
143143 if self . buffer . len ( ) < offset + data. len ( ) {
144144 return Err ( AssemblerError ) ;
@@ -164,7 +164,7 @@ impl<K> PacketAssembler<K> {
164164
165165 /// Get an immutable slice of the underlying packet data, if reassembly complete.
166166 /// This will mark the assembler as empty, so that it can be reused.
167- pub ( crate ) fn assemble ( & mut self ) -> Option < & ' _ [ u8 ] > {
167+ pub fn assemble ( & mut self ) -> Option < & ' _ [ u8 ] > {
168168 if !self . is_complete ( ) {
169169 return None ;
170170 }
@@ -176,7 +176,7 @@ impl<K> PacketAssembler<K> {
176176 }
177177
178178 /// Returns `true` when all fragments have been received, otherwise `false`.
179- pub ( crate ) fn is_complete ( & self ) -> bool {
179+ pub fn is_complete ( & self ) -> bool {
180180 self . total_size == Some ( self . assembler . peek_front ( ) )
181181 }
182182
@@ -207,7 +207,7 @@ impl<K: Eq + Copy> PacketAssemblerSet<K> {
207207 /// If it doesn't exist, it is created, with the `expires_at` timestamp.
208208 ///
209209 /// If the assembler set is full, in which case an error is returned.
210- pub ( crate ) fn get (
210+ pub fn get (
211211 & mut self ,
212212 key : & K ,
213213 expires_at : Instant ,
@@ -240,19 +240,19 @@ impl<K: Eq + Copy> PacketAssemblerSet<K> {
240240
241241// Max len of non-fragmented packets after decompression (including ipv6 header and payload)
242242// TODO: lower. Should be (6lowpan mtu) - (min 6lowpan header size) + (max ipv6 header size)
243- pub ( crate ) const MAX_DECOMPRESSED_LEN : usize = 1500 ;
243+ pub const MAX_DECOMPRESSED_LEN : usize = 1500 ;
244244
245245#[ cfg( feature = "_proto-fragmentation" ) ]
246246#[ derive( Debug , Eq , PartialEq , Ord , PartialOrd , Clone , Copy ) ]
247247#[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
248- pub ( crate ) enum FragKey {
248+ pub enum FragKey {
249249 #[ cfg( feature = "proto-ipv4-fragmentation" ) ]
250250 Ipv4 ( Ipv4FragKey ) ,
251251 #[ cfg( feature = "proto-sixlowpan-fragmentation" ) ]
252252 Sixlowpan ( SixlowpanFragKey ) ,
253253}
254254
255- pub ( crate ) struct FragmentsBuffer {
255+ pub struct FragmentsBuffer {
256256 #[ cfg( feature = "proto-sixlowpan" ) ]
257257 pub decompress_buf : [ u8 ; MAX_DECOMPRESSED_LEN ] ,
258258
@@ -264,17 +264,17 @@ pub(crate) struct FragmentsBuffer {
264264}
265265
266266#[ cfg( not( feature = "_proto-fragmentation" ) ) ]
267- pub ( crate ) struct Fragmenter { }
267+ pub struct Fragmenter { }
268268
269269#[ cfg( not( feature = "_proto-fragmentation" ) ) ]
270270impl Fragmenter {
271- pub ( crate ) fn new ( ) -> Self {
271+ pub fn new ( ) -> Self {
272272 Self { }
273273 }
274274}
275275
276276#[ cfg( feature = "_proto-fragmentation" ) ]
277- pub ( crate ) struct Fragmenter {
277+ pub struct Fragmenter {
278278 /// The buffer that holds the unfragmented 6LoWPAN packet.
279279 pub buffer : [ u8 ; FRAGMENTATION_BUFFER_SIZE ] ,
280280 /// The size of the packet without the IEEE802.15.4 header and the fragmentation headers.
@@ -289,7 +289,7 @@ pub(crate) struct Fragmenter {
289289}
290290
291291#[ cfg( feature = "proto-ipv4-fragmentation" ) ]
292- pub ( crate ) struct Ipv4Fragmenter {
292+ pub struct Ipv4Fragmenter {
293293 /// The IPv4 representation.
294294 pub repr : Ipv4Repr ,
295295 /// The destination hardware address.
@@ -302,7 +302,7 @@ pub(crate) struct Ipv4Fragmenter {
302302}
303303
304304#[ cfg( feature = "proto-sixlowpan-fragmentation" ) ]
305- pub ( crate ) struct SixlowpanFragmenter {
305+ pub struct SixlowpanFragmenter {
306306 /// The datagram size that is used for the fragmentation headers.
307307 pub datagram_size : u16 ,
308308 /// The datagram tag that is used for the fragmentation headers.
@@ -320,7 +320,7 @@ pub(crate) struct SixlowpanFragmenter {
320320
321321#[ cfg( feature = "_proto-fragmentation" ) ]
322322impl Fragmenter {
323- pub ( crate ) fn new ( ) -> Self {
323+ pub fn new ( ) -> Self {
324324 Self {
325325 buffer : [ 0u8 ; FRAGMENTATION_BUFFER_SIZE ] ,
326326 packet_len : 0 ,
@@ -355,18 +355,18 @@ impl Fragmenter {
355355
356356 /// Return `true` when everything is transmitted.
357357 #[ inline]
358- pub ( crate ) fn finished ( & self ) -> bool {
358+ pub fn finished ( & self ) -> bool {
359359 self . packet_len == self . sent_bytes
360360 }
361361
362362 /// Returns `true` when there is nothing to transmit.
363363 #[ inline]
364- pub ( crate ) fn is_empty ( & self ) -> bool {
364+ pub fn is_empty ( & self ) -> bool {
365365 self . packet_len == 0
366366 }
367367
368368 // Reset the buffer.
369- pub ( crate ) fn reset ( & mut self ) {
369+ pub fn reset ( & mut self ) {
370370 self . packet_len = 0 ;
371371 self . sent_bytes = 0 ;
372372
0 commit comments