Struct srx::SRX[][src]

pub struct SRX { /* fields omitted */ }

The SRX root. Does not execute rules on is own.

Implementations

impl SRX[src]

pub fn from_reader<R: Read>(reader: R) -> Result<Self, Error>[src]

This is supported on crate feature from_xml only.

Creates a new SRX struct from a reader.

Errors

  • If the file is not in valid SRX format.
  • If an unsupported rule is encountered in the <maprules>.

impl SRX[src]

pub fn language_rules<S: AsRef<str>>(&self, lang_code: S) -> Rules[src]

Gets the rules for a language code by

  • aggregating rules from all Languages with a matching <languagepattern> (if the SRX is set to be cascading)
  • finding the first matching <languagepattern> (if the SRX is set to be not cascading)

Result should be cached instead of calling this repeatedly as it clones the rules.

pub fn errors(&self) -> &HashMap<Language, Vec<String>>[src]

Maps Languages to a vector of string representations of errors which occured during parsing regular expressions for this language.

Trait Implementations

impl Clone for SRX[src]

impl Debug for SRX[src]

impl<'de> Deserialize<'de> for SRX[src]

impl FromStr for SRX[src]

This is supported on crate feature from_xml only.

type Err = Error

The associated error which can be returned from parsing.

impl Serialize for SRX[src]

Auto Trait Implementations

impl RefUnwindSafe for SRX

impl Send for SRX

impl Sync for SRX

impl Unpin for SRX

impl UnwindSafe for SRX

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.