@@ -59,17 +59,17 @@ impl MessageType {
59
59
/// A buffer for DHCP options.
60
60
#[ derive( Debug ) ]
61
61
#[ cfg_attr( feature = "defmt" , derive( defmt:: Format ) ) ]
62
- pub struct DhcpOptionsBuffer < ' a > {
62
+ pub struct DhcpOptionWriter < ' a > {
63
63
/// The underlying buffer, directly from the DHCP packet representation.
64
64
buffer : & ' a mut [ u8 ] ,
65
65
}
66
66
67
- impl < ' a > DhcpOptionsBuffer < ' a > {
67
+ impl < ' a > DhcpOptionWriter < ' a > {
68
68
pub fn new ( buffer : & ' a mut [ u8 ] ) -> Self {
69
69
Self { buffer }
70
70
}
71
71
72
- /// Emit a [`DhcpOption`] into a [`DhcpOptionsBuffer `].
72
+ /// Emit a [`DhcpOption`] into a [`DhcpOptionWriter `].
73
73
pub fn emit ( & mut self , option : DhcpOption < ' _ > ) -> Result < ( ) > {
74
74
if option. data . len ( ) > u8:: MAX as _ {
75
75
return Err ( Error ) ;
@@ -533,8 +533,8 @@ impl<T: AsRef<[u8]> + AsMut<[u8]>> Packet<T> {
533
533
impl < ' a , T : AsRef < [ u8 ] > + AsMut < [ u8 ] > + ?Sized > Packet < & ' a mut T > {
534
534
/// Return a pointer to the options.
535
535
#[ inline]
536
- pub fn options_mut ( & mut self ) -> DhcpOptionsBuffer < ' _ > {
537
- DhcpOptionsBuffer :: new ( & mut self . buffer . as_mut ( ) [ field:: OPTIONS ] )
536
+ pub fn options_mut ( & mut self ) -> DhcpOptionWriter < ' _ > {
537
+ DhcpOptionWriter :: new ( & mut self . buffer . as_mut ( ) [ field:: OPTIONS ] )
538
538
}
539
539
}
540
540
@@ -1243,7 +1243,7 @@ mod test {
1243
1243
} ;
1244
1244
1245
1245
let mut bytes = vec ! [ 0xa5 ; 5 ] ;
1246
- let mut writer = DhcpOptionsBuffer :: new ( & mut bytes) ;
1246
+ let mut writer = DhcpOptionWriter :: new ( & mut bytes) ;
1247
1247
writer. emit ( dhcp_option) . unwrap ( ) ;
1248
1248
1249
1249
assert_eq ! (
0 commit comments