use crate::core::VoidpMut;
pub struct Pvec {
pub v: Vec<VoidpMut>
}
impl Drop for Pvec {
fn drop(&mut self) {
}
}
impl Pvec {
pub fn new(v: Vec<VoidpMut>) -> Self {
Pvec{v}
}
pub fn disp(&self) -> String {
let s = self.v.iter().enumerate().map(|(i, &e)| format!("{} {:016x}",
if self.v.len() > 4 && i % 4 == 0 { "\n" } else { "" }, e as usize));
format!("[{}]", s.collect::<Vec<_>>().concat())
}
}
impl std::fmt::Display for Pvec {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}", self.disp())
}
}
impl std::fmt::Debug for Pvec {
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
write!(f, "{}", self.disp())
}
}