#[non_exhaustive]pub enum TransformReason {
EscapeSequence,
LineFolding,
MultiLineNormalization,
BlockScalarProcessing,
SingleQuoteEscape,
InputNotBorrowable,
ParserReturnedOwned,
VariableInterpolation,
}Expand description
The reason why a string value was transformed during parsing and cannot be borrowed.
When deserializing to &str, the value must exist verbatim in the input. However,
certain YAML constructs require string transformation, making borrowing impossible.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
EscapeSequence
Escape sequences were processed (e.g., \n, \t, \uXXXX in double-quoted strings).
LineFolding
Line folding was applied (folded block scalar >).
MultiLineNormalization
Multi-line plain or quoted scalar with whitespace normalization.
BlockScalarProcessing
Block scalar processing (literal | or folded > with chomping/indentation).
SingleQuoteEscape
Single-quoted string with '' escape processing.
InputNotBorrowable
Borrowing is not supported because the deserializer does not have access to the full input
buffer (for example, when deserializing from a Reader), or because the parser did not
provide a slice that is a subslice of the original input.
ParserReturnedOwned
The parser returned an owned string for this scalar.
In newer saphyr-parser versions, zero-copy is represented directly as Cow::Borrowed.
If a scalar comes through as Cow::Owned, the deserializer cannot safely fabricate a
borrow, because it would not refer to the original input buffer.
VariableInterpolation
Property interpolation transformed the scalar.
Trait Implementations§
Source§impl Clone for TransformReason
impl Clone for TransformReason
Source§fn clone(&self) -> TransformReason
fn clone(&self) -> TransformReason
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more