use alloc::borrow::ToOwned;
use alloc::boxed::Box;
use alloc::format;
use alloc::string::{String, ToString};
use alloc::vec;
use alloc::vec::Vec;
use eko::path::PathBuf;
use alloc::sync::Arc;
use crate::rustc_hir::attrs::DebuggerVisualizerType;
use rustc_macros::{Decodable, Encodable, StableHash};
#[derive(StableHash)]
#[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord, Encodable, Decodable)]
pub struct DebuggerVisualizerFile {
pub src: Arc<[u8]>,
pub visualizer_type: DebuggerVisualizerType,
pub path: Option<PathBuf>,
}
impl DebuggerVisualizerFile {
pub fn new(src: Arc<[u8]>, visualizer_type: DebuggerVisualizerType, path: PathBuf) -> Self {
DebuggerVisualizerFile { src, visualizer_type, path: Some(path) }
}
pub fn path_erased(&self) -> Self {
DebuggerVisualizerFile {
src: Arc::clone(&self.src),
visualizer_type: self.visualizer_type,
path: None,
}
}
}