melior/diagnostic/handler_id.rs
1use mlir_sys::MlirDiagnosticHandlerID;
2
3/// Diagnostic handler ID.
4#[derive(Clone, Copy, Debug)]
5pub struct DiagnosticHandlerId {
6 raw: MlirDiagnosticHandlerID,
7}
8
9impl DiagnosticHandlerId {
10 /// Creates a diagnostic handler ID from a raw object.
11 ///
12 /// # Safety
13 ///
14 /// A raw object must be valid.
15 pub const unsafe fn from_raw(raw: MlirDiagnosticHandlerID) -> Self {
16 Self { raw }
17 }
18
19 /// Converts a diagnostic handler ID into a raw object.
20 pub const fn to_raw(self) -> MlirDiagnosticHandlerID {
21 self.raw
22 }
23}