#[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 granit-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 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreimpl Copy for TransformReason
Source§impl Debug for TransformReason
impl Debug for TransformReason
Source§impl Display for TransformReason
impl Display for TransformReason
impl Eq for TransformReason
Source§impl PartialEq for TransformReason
impl PartialEq for TransformReason
Source§fn eq(&self, other: &TransformReason) -> bool
fn eq(&self, other: &TransformReason) -> bool
self and other values to be equal, and is used by ==.