pub mod v1 {
use core::fmt;
use vize_l0::dump::{Dump, Error, Mode};
use crate::dump::{Page as CurrentPage, parse, print};
#[derive(Debug, Clone, Default, PartialEq, Eq)]
pub struct Page(CurrentPage);
impl Page {
#[must_use]
pub fn from_current(page: CurrentPage) -> Self {
Self(page)
}
#[must_use]
pub fn into_current(self) -> CurrentPage {
self.0
}
}
impl Dump for Page {
fn print<W: fmt::Write>(&self, w: &mut W, mode: Mode) -> fmt::Result {
print::print(&self.0, w, print::Style::historical_v1(mode))
}
fn parse(input: &str) -> Result<Self, Error> {
parse::parse_historical_v1(input).map(Self)
}
}
}