pub struct SerdeError { /* private fields */ }Expand description
Struct for formatting the error together with the source file to give a nicer output.
Implementations§
Source§impl SerdeError
impl SerdeError
Sourcepub fn new(input: String, err: impl Into<ErrorTypes>) -> SerdeError
pub fn new(input: String, err: impl Into<ErrorTypes>) -> SerdeError
Create a new SerdeError from compatible serde errors. See
ErrorTypes for more information.
Sourcepub fn set_contextualize(&mut self, should_contextualize: bool) -> &mut Self
pub fn set_contextualize(&mut self, should_contextualize: bool) -> &mut Self
Set if the output should be contextualized or not.
By default contextualization is set to CONTEXTUALIZE_DEFAULT.
Sourcepub fn get_contextualize(&self) -> bool
pub fn get_contextualize(&self) -> bool
Get if the output should be contextualized or not.
By default contextualization is set to CONTEXTUALIZE_DEFAULT.
Sourcepub fn set_context_lines(&mut self, amount_of_context: usize) -> &mut Self
pub fn set_context_lines(&mut self, amount_of_context: usize) -> &mut Self
Set the amount of lines that should be shown before and after the error.
By default the amount of context is set to CONTEXT_LINES_DEFAULT.
Sourcepub fn get_context_lines(&self) -> usize
pub fn get_context_lines(&self) -> usize
Get the amount of lines that should be shown before and after the error.
Sourcepub fn set_context_characters(&mut self, amount_of_context: usize) -> &mut Self
pub fn set_context_characters(&mut self, amount_of_context: usize) -> &mut Self
Set the amount of characters that should be shown before and after the
error. By default the amount of context is set to
CONTEXT_CHARACTERS_DEFAULT.
Sourcepub fn get_context_characters(&self) -> usize
pub fn get_context_characters(&self) -> usize
Get the amount of characters that should be shown before and after the
error. Default value is CONTEXT_CHARACTERS_DEFAULT.