use crate::ByteView;
pub struct Builder(ByteView);
impl Builder {
#[must_use]
pub const fn new(inner: ByteView) -> Self {
Self(inner)
}
#[must_use]
pub fn freeze(mut self) -> ByteView {
self.0.update_prefix();
self.0
}
}
impl std::ops::Deref for Builder {
type Target = [u8];
fn deref(&self) -> &Self::Target {
&self.0
}
}
impl std::ops::DerefMut for Builder {
fn deref_mut(&mut self) -> &mut Self::Target {
self.0.get_mut_slice()
}
}