pub struct RawStr<'buf>(/* private fields */);Expand description
A &str with surrounding quotes removed; escape sequences are not decoded.
Implementations§
Source§impl<'buf> RawStr<'buf>
impl<'buf> RawStr<'buf>
Sourcepub fn eq_escape_aware(&self, other: &str) -> Result<bool, Warning>
pub fn eq_escape_aware(&self, other: &str) -> Result<bool, Warning>
Compare other against this raw &str, decoding any JSON escape
sequences in the &str on the fly without allocating.
Returns Ok(true)/Ok(false) for the comparison, or Err if the key
contains a decoding problem (an invalid escape or a control character) at
or before the first differing character.
Sourcepub fn eq_any_escape_aware(&self, other: &[&str]) -> bool
pub fn eq_any_escape_aware(&self, other: &[&str]) -> bool
Compare this raw &str against a list of &strs, decoding any JSON escape
sequences in the &str on the fly without allocating.
Returns true if any of the other &strs match self.
Sourcepub fn eq_any_escape_aware_ignore_ascii_case(&self, other: &[&str]) -> bool
pub fn eq_any_escape_aware_ignore_ascii_case(&self, other: &[&str]) -> bool
Like RawStr::eq_any_escape_aware, but compares ASCII letters case-insensitively.
Sourcepub fn as_unescaped_str(&self) -> &'buf str
pub fn as_unescaped_str(&self) -> &'buf str
Return the raw unescaped &str.
Sourcepub fn decode_escapes(&self) -> CaveatDeferred<Cow<'_, str>, Warning>
pub fn decode_escapes(&self) -> CaveatDeferred<Cow<'_, str>, Warning>
Return the &str with all escapes decoded.
Sourcepub fn has_escapes(
&self,
elem: &Element<'buf>,
) -> Caveat<PendingStr<'buf>, Warning>
pub fn has_escapes( &self, elem: &Element<'buf>, ) -> Caveat<PendingStr<'buf>, Warning>
Return a &str marked as either having escapes or not.
Trait Implementations§
impl<'buf> Copy for RawStr<'buf>
impl<'buf> Eq for RawStr<'buf>
Source§impl<'buf> Ord for RawStr<'buf>
impl<'buf> Ord for RawStr<'buf>
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl<'buf> PartialEq for RawStr<'buf>
impl<'buf> PartialEq for RawStr<'buf>
Source§impl<'buf> PartialOrd for RawStr<'buf>
impl<'buf> PartialOrd for RawStr<'buf>
impl<'buf> StructuralPartialEq for RawStr<'buf>
Auto Trait Implementations§
impl<'buf> Freeze for RawStr<'buf>
impl<'buf> RefUnwindSafe for RawStr<'buf>
impl<'buf> Send for RawStr<'buf>
impl<'buf> Sync for RawStr<'buf>
impl<'buf> Unpin for RawStr<'buf>
impl<'buf> UnsafeUnpin for RawStr<'buf>
impl<'buf> UnwindSafe for RawStr<'buf>
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