pub enum SyntaxHint {
Show 15 variants
Str,
LitStr,
LitStr1,
LitStr2,
LitStr3,
Inline,
Inline1,
Delim1,
Delim2,
Delim3,
Block,
Block3,
Block4,
Block5,
Block6,
}Expand description
Hint for serialization: which syntax was used to parse this text.
This hint allows round-tripping to preserve the original syntax when possible.
The generic variants (Inline, Block) let the serializer pick the best syntax
when the exact form doesn’t matter.
Variants§
Str
Escaped string: "..."
LitStr
Literal string: '...'
LitStr1
Literal string with level 1 delimiters: <'...'>
LitStr2
Literal string with level 2 delimiters: <<'...'>>
LitStr3
Literal string with level 3 delimiters: <<<'...'>>>
Inline
Generic inline code (serializer picks appropriate syntax)
Inline1
Single backtick inline: `...`
Delim1
Single-delimited code: <…>
Delim2
Double-delimited code: <<…>>
Delim3
Triple-delimited code: <<<…>>>
Block
Generic block code (serializer picks backtick count)
Block3
Triple backtick block: ```...```
Block4
Quadruple backtick block: ````...````
Block5
Quintuple backtick block
Block6
Sextuple backtick block
Implementations§
Source§impl SyntaxHint
impl SyntaxHint
Sourcepub fn is_string(&self) -> bool
pub fn is_string(&self) -> bool
Returns true if this is any string syntax (escaped or literal).
Sourcepub fn is_escaped_string(&self) -> bool
pub fn is_escaped_string(&self) -> bool
Returns true if this is an escaped string syntax ("...").
Sourcepub fn is_literal_string(&self) -> bool
pub fn is_literal_string(&self) -> bool
Returns true if this is a literal string syntax ('...' variants).
Trait Implementations§
Source§impl Clone for SyntaxHint
impl Clone for SyntaxHint
Source§fn clone(&self) -> SyntaxHint
fn clone(&self) -> SyntaxHint
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for SyntaxHint
impl Debug for SyntaxHint
Source§impl Hash for SyntaxHint
impl Hash for SyntaxHint
Source§impl PartialEq for SyntaxHint
impl PartialEq for SyntaxHint
impl Copy for SyntaxHint
impl Eq for SyntaxHint
impl StructuralPartialEq for SyntaxHint
Auto Trait Implementations§
impl Freeze for SyntaxHint
impl RefUnwindSafe for SyntaxHint
impl Send for SyntaxHint
impl Sync for SyntaxHint
impl Unpin for SyntaxHint
impl UnwindSafe for SyntaxHint
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.