Skip to content

Commit 2566754

Browse files
committed
dhcp/wire: Rename DhcpOptionsBuffer -> DhcpOptionWriter
1 parent 47ce69b commit 2566754

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/wire/dhcpv4.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -59,17 +59,17 @@ impl MessageType {
5959
/// A buffer for DHCP options.
6060
#[derive(Debug)]
6161
#[cfg_attr(feature = "defmt", derive(defmt::Format))]
62-
pub struct DhcpOptionsBuffer<'a> {
62+
pub struct DhcpOptionWriter<'a> {
6363
/// The underlying buffer, directly from the DHCP packet representation.
6464
buffer: &'a mut [u8],
6565
}
6666

67-
impl<'a> DhcpOptionsBuffer<'a> {
67+
impl<'a> DhcpOptionWriter<'a> {
6868
pub fn new(buffer: &'a mut [u8]) -> Self {
6969
Self { buffer }
7070
}
7171

72-
/// Emit a [`DhcpOption`] into a [`DhcpOptionsBuffer`].
72+
/// Emit a [`DhcpOption`] into a [`DhcpOptionWriter`].
7373
pub fn emit(&mut self, option: DhcpOption<'_>) -> Result<()> {
7474
if option.data.len() > u8::MAX as _ {
7575
return Err(Error);
@@ -533,8 +533,8 @@ impl<T: AsRef<[u8]> + AsMut<[u8]>> Packet<T> {
533533
impl<'a, T: AsRef<[u8]> + AsMut<[u8]> + ?Sized> Packet<&'a mut T> {
534534
/// Return a pointer to the options.
535535
#[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])
538538
}
539539
}
540540

@@ -1243,7 +1243,7 @@ mod test {
12431243
};
12441244

12451245
let mut bytes = vec![0xa5; 5];
1246-
let mut writer = DhcpOptionsBuffer::new(&mut bytes);
1246+
let mut writer = DhcpOptionWriter::new(&mut bytes);
12471247
writer.emit(dhcp_option).unwrap();
12481248

12491249
assert_eq!(

src/wire/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,7 @@ pub use self::tcp::{
243243

244244
#[cfg(feature = "proto-dhcpv4")]
245245
pub use self::dhcpv4::{
246-
DhcpOption, DhcpOptionsBuffer, MessageType as DhcpMessageType, Packet as DhcpPacket,
246+
DhcpOption, DhcpOptionWriter, MessageType as DhcpMessageType, Packet as DhcpPacket,
247247
Repr as DhcpRepr, CLIENT_PORT as DHCP_CLIENT_PORT,
248248
MAX_DNS_SERVER_COUNT as DHCP_MAX_DNS_SERVER_COUNT, SERVER_PORT as DHCP_SERVER_PORT,
249249
};

0 commit comments

Comments
 (0)