pub enum SubdiagMessage {
Str(Cow<'static, str>),
Translated(Cow<'static, str>),
FluentIdentifier(Cow<'static, str>),
FluentAttr(Cow<'static, str>),
}
Expand description
Abstraction over a message in a subdiagnostic (i.e. label, note, help, etc) to support both translatable and non-translatable diagnostic messages.
Translatable messages for subdiagnostics are typically attributes attached to a larger Fluent message so messages of this type must be combined with a DiagMessage
(using DiagMessage::with_subdiagnostic_message
) before rendering. However, subdiagnostics from the Subdiagnostic
derive refer to Fluent identifiers directly.
Non-translatable diagnostic message.
§Translatable message which has already been translated eagerly.
Some diagnostics have repeated subdiagnostics where the same interpolated variables would be instantiated multiple times with different values. These subdiagnosticsâ messages are translated when they are added to the parent diagnostic, producing this variant of DiagMessage
.
Identifier of a Fluent message. Instances of this variant are generated by the Subdiagnostic
derive.
Converts to this type from the input type.
Source§ Source§Converts to this type from the input type.
Source§Translating into a subdiagnostic message from a diagnostic message is a little strange - but the subdiagnostic functions (e.g. span_label
) take a SubdiagMessage
and the subdiagnostic derive refers to typed identifiers that are DiagMessage
s, so need to be able to convert between these, as much as theyâll be converted back into DiagMessage
using with_subdiagnostic_message
eventually. Donât use this other than for the derive.
Converts to this type from the input type.
Source§ Source§Converts to this type from the input type.
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's âType Layoutâ chapter for details on type layout guarantees.
Size: 32 bytes
Size for each variant:
Str
: 24 bytesTranslated
: 24 bytesFluentIdentifier
: 24 bytesFluentAttr
: 24 bytesRetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4