pub enum CharacterDataSpec {
    Enum {
        items: &'static [(EnumItem, u32)],
    },
    Pattern {
        check_fn: fn(_: &[u8]) -> bool,
        regex: &'static str,
        max_length: Option<usize>,
    },
    String {
        preserve_whitespace: bool,
        max_length: Option<usize>,
    },
    UnsignedInteger,
    Double,
}
Expand description

Specifies the data type and restrictions of the character data in an element or attribute

Variants

Enum

Fields

items: &'static [(EnumItem, u32)]

The character data is an enum value; valid values are given in items and the character data must match one of these

Pattern

Fields

check_fn: fn(_: &[u8]) -> bool
regex: &'static str
max_length: Option<usize>

The character data is restricted to match a regex, which is given in text form in the filed regex. The check_fn is a function that validates input according to the regex. If a max_length is given, then it restricts the length (in bytes).

String

Fields

preserve_whitespace: bool
max_length: Option<usize>

An arbitrary string; if preserve whitepace is set, then whitespace should be preserved during parsing (see the XML standard)

UnsignedInteger

Double

Trait Implementations

Formats the value using the given formatter. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.