use rustc_data_structures::sync::Lrc;
use std::path::PathBuf;
#[derive(HashStable)]
#[derive(Copy, PartialEq, PartialOrd, Clone, Ord, Eq, Hash, Debug, Encodable, Decodable)]
pub enum DebuggerVisualizerType {
Natvis,
GdbPrettyPrinter,
}
#[derive(HashStable)]
#[derive(Clone, Debug, Hash, PartialEq, Eq, PartialOrd, Ord, Encodable, Decodable)]
pub struct DebuggerVisualizerFile {
pub src: Lrc<[u8]>,
pub visualizer_type: DebuggerVisualizerType,
pub path: Option<PathBuf>,
}
impl DebuggerVisualizerFile {
pub fn new(src: Lrc<[u8]>, visualizer_type: DebuggerVisualizerType, path: PathBuf) -> Self {
DebuggerVisualizerFile { src, visualizer_type, path: Some(path) }
}
pub fn path_erased(&self) -> Self {
DebuggerVisualizerFile {
src: self.src.clone(),
visualizer_type: self.visualizer_type,
path: None,
}
}
}