pub struct ParserConfig {
pub kind: String,
pub options: Value,
}Expand description
Template parser definition
Fields§
§kind: StringParser used to process the rendered template into API-compatible format
options: ValueOptions for the parser
Implementations§
Source§impl ParserConfig
impl ParserConfig
Sourcepub fn from_json(json: &str, ctx: &LoadContext) -> Result<Self, Error>
pub fn from_json(json: &str, ctx: &LoadContext) -> Result<Self, Error>
Load ParserConfig from a JSON string.
Sourcepub fn from_yaml(yaml: &str, ctx: &LoadContext) -> Result<Self, Error>
pub fn from_yaml(yaml: &str, ctx: &LoadContext) -> Result<Self, Error>
Load ParserConfig from a YAML string.
Sourcepub fn load_from_value(value: &Value, ctx: &LoadContext) -> Self
pub fn load_from_value(value: &Value, ctx: &LoadContext) -> Self
Load ParserConfig from a serde_json::Value.
Calls ctx.process_input before field extraction.
Sourcepub fn to_value(&self, ctx: &SaveContext) -> Value
pub fn to_value(&self, ctx: &SaveContext) -> Value
Serialize ParserConfig to a serde_json::Value.
Calls ctx.process_dict after serialization.
Sourcepub fn to_json(&self, ctx: &SaveContext) -> Result<String, Error>
pub fn to_json(&self, ctx: &SaveContext) -> Result<String, Error>
Serialize ParserConfig to a JSON string.
Trait Implementations§
Source§impl Clone for ParserConfig
impl Clone for ParserConfig
Source§fn clone(&self) -> ParserConfig
fn clone(&self) -> ParserConfig
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ParserConfig
impl Debug for ParserConfig
Source§impl Default for ParserConfig
impl Default for ParserConfig
Source§fn default() -> ParserConfig
fn default() -> ParserConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ParserConfig
impl RefUnwindSafe for ParserConfig
impl Send for ParserConfig
impl Sync for ParserConfig
impl Unpin for ParserConfig
impl UnsafeUnpin for ParserConfig
impl UnwindSafe for ParserConfig
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
Mutably borrows from an owned value. Read more