//! These definitions are similar to their `ct` equivalents, but differ in that
//! these can be statically allocated and are slightly optimized for the runtime
-use option::Option;
-
-#[doc(hidden)]
-pub enum Piece<'a> {
- String(&'a str),
- // FIXME(#8259): this shouldn't require the unit-value here
- CurrentArgument(()),
- Argument(Argument<'a>),
-}
-
#[doc(hidden)]
pub struct Argument<'a> {
pub position: Position,
pub format: FormatSpec,
- pub method: Option<&'a Method<'a>>
}
#[doc(hidden)]
AlignLeft,
/// Indication that contents should be right-aligned.
AlignRight,
+ /// Indication that contents should be center-aligned.
+ AlignCenter,
/// No alignment was requested.
AlignUnknown,
}
/// being aware of the sign to be printed.
FlagSignAwareZeroPad,
}
-
-#[doc(hidden)]
-pub enum Method<'a> {
- Plural(Option<uint>, &'a [PluralArm<'a>], &'a [Piece<'a>]),
- Select(&'a [SelectArm<'a>], &'a [Piece<'a>]),
-}
-
-#[doc(hidden)]
-pub enum PluralSelector {
- Keyword(PluralKeyword),
- Literal(uint),
-}
-
-#[doc(hidden)]
-pub enum PluralKeyword {
- Zero,
- One,
- Two,
- Few,
- Many,
-}
-
-#[doc(hidden)]
-pub struct PluralArm<'a> {
- pub selector: PluralSelector,
- pub result: &'a [Piece<'a>],
-}
-
-#[doc(hidden)]
-pub struct SelectArm<'a> {
- pub selector: &'a str,
- pub result: &'a [Piece<'a>],
-}