pub struct PreprocessResult {
pub original: String,
pub preprocessed: String,
pub warnings: Vec<CorrectionWarning>,
pub success: bool,
pub error: Option<FerroError>,
}Expand description
Result of preprocessing an input string.
Fields§
§original: StringThe original input.
preprocessed: StringThe preprocessed input (may be same as original if no corrections).
warnings: Vec<CorrectionWarning>Warnings generated during preprocessing.
success: boolWhether preprocessing was successful (no rejected errors).
error: Option<FerroError>Error if preprocessing failed due to a rejected error.
Implementations§
Source§impl PreprocessResult
impl PreprocessResult
Sourcepub fn corrected(
original: String,
preprocessed: String,
warnings: Vec<CorrectionWarning>,
) -> Self
pub fn corrected( original: String, preprocessed: String, warnings: Vec<CorrectionWarning>, ) -> Self
Create a successful result with corrections.
Sourcepub fn failed(original: String, error: FerroError) -> Self
pub fn failed(original: String, error: FerroError) -> Self
Create a failed result.
Sourcepub fn has_corrections(&self) -> bool
pub fn has_corrections(&self) -> bool
Returns true if there were any corrections made.
Sourcepub fn has_warnings(&self) -> bool
pub fn has_warnings(&self) -> bool
Returns true if there were any warnings.
Trait Implementations§
Source§impl Clone for PreprocessResult
impl Clone for PreprocessResult
Source§fn clone(&self) -> PreprocessResult
fn clone(&self) -> PreprocessResult
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 moreAuto Trait Implementations§
impl Freeze for PreprocessResult
impl RefUnwindSafe for PreprocessResult
impl Send for PreprocessResult
impl Sync for PreprocessResult
impl Unpin for PreprocessResult
impl UnsafeUnpin for PreprocessResult
impl UnwindSafe for PreprocessResult
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