pub enum Inline {
Text(String),
#[non_exhaustive] Tag {
id: String,
kind: TagKind,
display: String,
free: bool,
},
}Expand description
One piece of segment content, in logical order.
The enum is closed (text or a code), matching catcore’s JSON. The Tag variant is #[non_exhaustive]: build it
with Inline::tag or Inline::free_tag (and Inline::with_free), and match it with .., so a code can
carry more in a 1.x release.
Variants§
Text(String)
Plain text.
#[non_exhaustive]Tag
An inline code. free is true for a standalone code that names its argument (%1$s, {name}, {0}, an
XLIFF <x id> or <ph id>): a translation may move it, because the writer finds it again by id. It is
false for markup and for unnumbered placeholders (%s), whose order is the argument order. Only a
standalone code can be free.
Fields
This variant is marked as non-exhaustive
id: StringThe code’s id: the key of its original markup in Unit::codes. An open and its close share it.
Implementations§
Source§impl Inline
impl Inline
Sourcepub fn tag(
id: impl Into<String>,
kind: TagKind,
display: impl Into<String>,
) -> Inline
pub fn tag( id: impl Into<String>, kind: TagKind, display: impl Into<String>, ) -> Inline
A code that is not free (markup, or an unnumbered placeholder).