pub struct ParserEffect {
pub ts_unix_ms: u128,
pub kind: ParserEffectKind,
pub operation: String,
pub message: String,
pub mode: CompatibilityMode,
pub source_location: Option<String>,
pub risk_probability: f64,
}Expand description
A single effect that occurred during parsing.
Fields§
§ts_unix_ms: u128Timestamp when the effect occurred (Unix milliseconds).
kind: ParserEffectKindThe kind of effect.
operation: StringThe parser operation that produced this effect.
message: StringA human-readable message describing the effect.
mode: CompatibilityModeThe compatibility mode in which the effect occurred.
source_location: Option<String>Optional source location (e.g., line number in input).
risk_probability: f64Associated risk probability (0.0 to 1.0).
Implementations§
Source§impl ParserEffect
impl ParserEffect
Sourcepub fn new(
kind: ParserEffectKind,
operation: impl Into<String>,
message: impl Into<String>,
mode: CompatibilityMode,
risk_probability: f64,
) -> Self
pub fn new( kind: ParserEffectKind, operation: impl Into<String>, message: impl Into<String>, mode: CompatibilityMode, risk_probability: f64, ) -> Self
Create a new parser effect with current timestamp.
Sourcepub fn with_location(self, location: impl Into<String>) -> Self
pub fn with_location(self, location: impl Into<String>) -> Self
Create a new parser effect with a source location.
Sourcepub fn warning(
operation: impl Into<String>,
message: impl Into<String>,
mode: CompatibilityMode,
) -> Self
pub fn warning( operation: impl Into<String>, message: impl Into<String>, mode: CompatibilityMode, ) -> Self
Create a warning effect.
Sourcepub fn fail_closed(
operation: impl Into<String>,
message: impl Into<String>,
mode: CompatibilityMode,
) -> Self
pub fn fail_closed( operation: impl Into<String>, message: impl Into<String>, mode: CompatibilityMode, ) -> Self
Create a fail-closed effect.
Trait Implementations§
Source§impl Clone for ParserEffect
impl Clone for ParserEffect
Source§fn clone(&self) -> ParserEffect
fn clone(&self) -> ParserEffect
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · 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 ParserEffect
impl Debug for ParserEffect
Source§impl<'de> Deserialize<'de> for ParserEffect
impl<'de> Deserialize<'de> for ParserEffect
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for ParserEffect
impl PartialEq for ParserEffect
Source§fn eq(&self, other: &ParserEffect) -> bool
fn eq(&self, other: &ParserEffect) -> bool
Tests for
self and other values to be equal, and is used by ==.Source§impl Serialize for ParserEffect
impl Serialize for ParserEffect
impl StructuralPartialEq for ParserEffect
Auto Trait Implementations§
impl Freeze for ParserEffect
impl RefUnwindSafe for ParserEffect
impl Send for ParserEffect
impl Sync for ParserEffect
impl Unpin for ParserEffect
impl UnsafeUnpin for ParserEffect
impl UnwindSafe for ParserEffect
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