[−][src]Struct proteus::parser::Parser
This type represents a set of static methods for parsing transformation syntax into Action's.
The parser is responsible for parsing the transformation action specific syntax, take the
following source syntax: join(" ", const("Mr."), first_name, last_name)
the parser knows how to breakdown the syntax into a join
action which calls the const
action, and 2 getter actions and joins those actions results.
Actions currently supported include:
- const eg.
const(<value>)
- join eg. `join(<separator,
)
Implementations
impl Parser
[src]
pub fn add_action_parser(
name: &str,
f: &'static ActionParserFn
) -> Result<(), Error>
[src]
name: &str,
f: &'static ActionParserFn
) -> Result<(), Error>
add_action_parser adds an Action parsing function to dynamically be parsed. NOTE: this WILL overwrite any pre-existing functions with the same name.
name only accepts ASCII letters, numbers and _ equivalent to [a-zA-Z0-9_].
pub fn parse(source: &str, destination: &str) -> Result<Box<dyn Action>, Error>
[src]
parses a single transformation action to be taken with the provided source & destination.
pub fn parse_multi(
parsables: &[Parsable<'_>]
) -> Result<Vec<Box<dyn Action>>, Error>
[src]
parsables: &[Parsable<'_>]
) -> Result<Vec<Box<dyn Action>>, Error>
parses a set of transformation actions into Action's.
pub fn parse_multi_from_str(s: &str) -> Result<Vec<Box<dyn Action>>, Error>
[src]
parses a set of transformation actions into Action's from a JSON string of serialized Parsable structs.
pub fn parse_action(source: &str) -> Result<Box<dyn Action>, Error>
[src]
parses an Action given the provided str. This is primarily used as a helper in custom Action Parsers.
Auto Trait Implementations
impl RefUnwindSafe for Parser
[src]
impl Send for Parser
[src]
impl Sync for Parser
[src]
impl Unpin for Parser
[src]
impl UnwindSafe for Parser
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,