1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// Copyright (c) 2026 Mike Grier
//! A diagnostic sink that writes each event to the debugger (DI-12.1.3, DI-D-51).
use ;
use output_debug_str;
/// A sink that writes every event as a line to the debugger, by `OutputDebugStringW`, prefixed `dioring:` as
/// [`StderrDiagnostics`](durable_ioring::StderrDiagnostics)'s lines are.
///
/// It wants every kind. A line is built for each event, whether or not a debugger is attached: with neither a
/// debugger nor an active system debugger the call "does nothing", and it gives no way to tell, so a consumer
/// that does not want the cost chooses another sink, or a [`FanOutDiagnostics`](durable_ioring::FanOutDiagnostics)
/// that leaves this one out.
///
/// The call takes a NUL-terminated string, so a NUL in an event's text, which a domain's name or an inconsistency's
/// detail can carry, is written as the two characters `\0` and the line is sent. Nothing else in the text is
/// changed. The call converts the line to the system's code page, and "some Unicode characters may not be
/// displayed correctly".
;
/// The line an event is written as: the prefix, the event's text, and no NUL.