Skip to main content

Pattern

Enum Pattern 

Source
pub enum Pattern {
Show 17 variants Empty, Ref(String), Element { name: QName, pattern: Box<Pattern>, }, Attribute { name: QName, pattern: Box<Pattern>, }, Sequence(Vec<Pattern>), Choice(Vec<Pattern>), Interleave(Vec<Pattern>), Optional(Box<Pattern>), ZeroOrMore(Box<Pattern>), OneOrMore(Box<Pattern>), StringLiteral(String), Datatype { library: String, name: String, params: Vec<DatatypeParam>, }, Group(Box<Pattern>), Mixed(Box<Pattern>), List(Box<Pattern>), Text, Any,
}
Expand description

RELAX NG pattern (simplified for OOXML schemas).

Variants§

§

Empty

Empty content.

§

Ref(String)

Reference to another definition.

§

Element

element name { pattern }.

Fields

§name: QName
§pattern: Box<Pattern>
§

Attribute

attribute name { pattern }.

Fields

§name: QName
§pattern: Box<Pattern>
§

Sequence(Vec<Pattern>)

Sequence: pattern, pattern.

§

Choice(Vec<Pattern>)

Choice: pattern | pattern.

§

Interleave(Vec<Pattern>)

Interleave (unordered): pattern & pattern.

§

Optional(Box<Pattern>)

Optional: pattern?.

§

ZeroOrMore(Box<Pattern>)

Zero or more: pattern*.

§

OneOrMore(Box<Pattern>)

One or more: pattern+.

§

StringLiteral(String)

String literal: string "value".

§

Datatype

XSD datatype: xsd:integer, xsd:string, etc.

Fields

§library: String
§name: String
§

Group(Box<Pattern>)

Parenthesized pattern.

§

Mixed(Box<Pattern>)

Mixed content: mixed { pattern }.

§

List(Box<Pattern>)

List content: list { pattern } (space-separated).

§

Text

Text content.

§

Any

Any content (wildcard pattern).

Implementations§

Source§

impl Pattern

Source

pub fn is_simple_type(&self) -> bool

Returns true if this pattern represents a simple type (enum of string literals).

Trait Implementations§

Source§

impl Clone for Pattern

Source§

fn clone(&self) -> Pattern

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Pattern

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

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

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.