pub enum StyleError {
Template {
text: String,
diagnostics: Vec<FlmDiagnostic>,
},
UnknownKey {
text: String,
key: String,
},
UnknownJoiner {
name: Name,
},
UnknownWriter {
name: Name,
},
UnknownVariable {
text: String,
name: String,
},
Parse {
text: String,
diagnostics: Vec<FlmDiagnostic>,
},
ParseFailed {
text: String,
detail: String,
},
}Expand description
Why a counter style, a within-joiner or a number writer could not be compiled.
The numbering feature compiles once, when the registry is built, so each of these errors reveals a mistake in a declaration or in configuration. The numbering stage also compiles the within-joiners of a document’s numbering options and a point’s own number template; there, an error is reported as a diagnostic of the document.
Variants§
Template
A template did not compile: it is not valid FLM, it holds a #{…}
whose name the template does not accept (a name that is not a number
format, a counter no feature declares), or it puts keys in brackets on
a name that accepts none.
Fields
diagnostics: Vec<FlmDiagnostic>What the compilation reported.
UnknownKey
A #[…]{counter} of a within template carries a key that is neither
bare nor the name of a number format.
UnknownJoiner
A counter is numbered within another through a within-joiner name that no feature registers.
UnknownWriter
A counter style asks for a number writer that no feature registers.
UnknownVariable
A ${…} of a join text refers to a name that is not a join key.
Fields
Parse
A text of the counter style is not valid FLM: the parse reported errors.
Fields
text: StringThe text, as it was declared. A single-letter number template is cut at its letter and parsed in pieces, and the error gives the whole template, as its author wrote it.
diagnostics: Vec<FlmDiagnostic>The parse’s errors.
ParseFailed
A text of the counter style could not be parsed at all: it nests too deeply, or no worker thread was available.
Trait Implementations§
Source§impl Clone for StyleError
impl Clone for StyleError
Source§impl Debug for StyleError
impl Debug for StyleError
Source§impl Display for StyleError
impl Display for StyleError
Source§impl Error for StyleError
impl Error for StyleError
1.30.0 · Source§fn source(&self) -> Option<&(dyn Error + 'static)>
fn source(&self) -> Option<&(dyn Error + 'static)>
1.0.0 · Source§fn description(&self) -> &str
fn description(&self) -> &str
use the Display impl or to_string()
Auto Trait Implementations§
impl !RefUnwindSafe for StyleError
impl !UnwindSafe for StyleError
impl Forget for StyleError
impl Freeze for StyleErrorwhere
*const u8 is !null: Freeze,
PhantomData<u8>: Freeze,
PhantomData<Diagnostic<FlmOrigin>>: Freeze,
*const ArcInner<str> is !null: Freeze,
PhantomData<ArcInner<str>>: Freeze,
impl Move for StyleError
impl Send for StyleError
impl Sync for StyleError
impl Unpin for StyleError
impl UnsafeUnpin for StyleErrorwhere
*const u8 is !null: UnsafeUnpin,
PhantomData<u8>: UnsafeUnpin,
PhantomData<Diagnostic<FlmOrigin>>: UnsafeUnpin,
*const ArcInner<str> is !null: UnsafeUnpin,
PhantomData<ArcInner<str>>: UnsafeUnpin,
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CheckedAs for T
impl<T> CheckedAs for T
Source§fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
fn checked_as<Dst>(self) -> Option<Dst>where
T: CheckedCast<Dst>,
Source§impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere
Src: CheckedCast<Dst>,
Source§fn checked_cast_from(src: Src) -> Option<Dst>
fn checked_cast_from(src: Src) -> Option<Dst>
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more