vos_error/for_std/io_error/
mod.rs1use diagnostic::FileID;
2
3use super::*;
4
5impl From<Error> for VosError {
6 fn from(error: Error) -> Self {
7 Self { kind: Box::new(VosErrorKind::IOError(error)), level: DiagnosticLevel::Error, file: Default::default() }
8 }
9}
10
11impl VosError {
12 pub fn with_file(mut self, file: impl TryInto<FileID>) -> Self {
13 match file.try_into() {
14 Ok(o) => self.file = o,
15 Err(_) => {}
16 }
17 self
18 }
19 pub fn set_file(&mut self, file: impl Into<FileID>) {
20 self.file = file.into();
21 }
22}