pub enum OriginalLiteral {
Integer {
lit: String,
},
String {
form: StringForm,
},
}Expand description
Per-node literal-form record, captured during decoding so that
encode can re-emit the value in the same source form (integer
base, string flavor, heredoc modifiers). Keyed off the node’s path
in Document::original_forms. Spec §encode.
Variants§
Integer
An integer literal, stored as its exact source lexeme:
"0x1F40", "0o755", "0b1010_0110", "1_000_000",
"+42", "-7", etc. Re-emitted verbatim.
String
A string value, stored with its original surface form (basic / literal / heredoc-basic / heredoc-literal, plus heredoc label and modifier list).
Fields
§
form: StringFormTrait Implementations§
Source§impl Clone for OriginalLiteral
impl Clone for OriginalLiteral
Source§fn clone(&self) -> OriginalLiteral
fn clone(&self) -> OriginalLiteral
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 OriginalLiteral
impl Debug for OriginalLiteral
Source§impl PartialEq for OriginalLiteral
impl PartialEq for OriginalLiteral
Source§fn eq(&self, other: &OriginalLiteral) -> bool
fn eq(&self, other: &OriginalLiteral) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for OriginalLiteral
Auto Trait Implementations§
impl Freeze for OriginalLiteral
impl RefUnwindSafe for OriginalLiteral
impl Send for OriginalLiteral
impl Sync for OriginalLiteral
impl Unpin for OriginalLiteral
impl UnsafeUnpin for OriginalLiteral
impl UnwindSafe for OriginalLiteral
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