pub enum EscapedToken<'a> {
Literal(&'a str),
Escaped(&'static str),
}
Expand description
A token representing a piece of an escaped JSON string.
This enum is the item yielded by the EscapeTokens
iterator.
Variants§
Literal(&'a str)
A slice of the original input that did not require escaping.
Escaped(&'static str)
The &'static str
representation of an escaped character (e.g., r#"\n"#
).
Trait Implementations§
Source§impl<'a> Clone for EscapedToken<'a>
impl<'a> Clone for EscapedToken<'a>
Source§fn clone(&self) -> EscapedToken<'a>
fn clone(&self) -> EscapedToken<'a>
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<'a> Debug for EscapedToken<'a>
impl<'a> Debug for EscapedToken<'a>
Source§impl Display for EscapedToken<'_>
impl Display for EscapedToken<'_>
Source§impl<'a> Extend<EscapedToken<'a>> for String
Extends a String
with an iterator of escaped tokens.
impl<'a> Extend<EscapedToken<'a>> for String
Extends a String
with an iterator of escaped tokens.
Source§fn extend<I: IntoIterator<Item = EscapedToken<'a>>>(&mut self, iter: I)
fn extend<I: IntoIterator<Item = EscapedToken<'a>>>(&mut self, iter: I)
Extends a collection with the contents of an iterator. Read more
Source§fn extend_one(&mut self, item: A)
fn extend_one(&mut self, item: A)
🔬This is a nightly-only experimental API. (
extend_one
)Extends a collection with exactly one element.
Source§fn extend_reserve(&mut self, additional: usize)
fn extend_reserve(&mut self, additional: usize)
🔬This is a nightly-only experimental API. (
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
Source§impl<'a> FromIterator<EscapedToken<'a>> for String
Collects an iterator of escaped chunks into a single String
.
impl<'a> FromIterator<EscapedToken<'a>> for String
Collects an iterator of escaped chunks into a single String
.
Source§fn from_iter<I: IntoIterator<Item = EscapedToken<'a>>>(iter: I) -> String
fn from_iter<I: IntoIterator<Item = EscapedToken<'a>>>(iter: I) -> String
Creates a value from an iterator. Read more
Source§impl<'a> PartialEq for EscapedToken<'a>
impl<'a> PartialEq for EscapedToken<'a>
impl<'a> Copy for EscapedToken<'a>
impl<'a> Eq for EscapedToken<'a>
impl<'a> StructuralPartialEq for EscapedToken<'a>
Auto Trait Implementations§
impl<'a> Freeze for EscapedToken<'a>
impl<'a> RefUnwindSafe for EscapedToken<'a>
impl<'a> Send for EscapedToken<'a>
impl<'a> Sync for EscapedToken<'a>
impl<'a> Unpin for EscapedToken<'a>
impl<'a> UnwindSafe for EscapedToken<'a>
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