EscapedStr

Struct EscapedStr 

Source
pub struct EscapedStr(/* private fields */);
Expand description

A slice buffer which is in an escaped format: containing possible 0u8 and 1u8 bytes escaped with a 1u8 as well as a final terminating null byte

Implementations§

Source§

impl EscapedStr

Source

pub unsafe fn from_str(b: &str) -> &EscapedStr

Create an escaped str from a normal str.

§Safety

User must ensure the str is properly escaped.

Source

pub fn as_bytes(&self) -> &[u8]

Returns the raw underlying byte representation of the escaped string, including escaped bytes.

Source

pub fn as_slice(&self) -> &EscapedSlice

Source

pub fn chars(&self) -> EscapedChars<'_>

Returns a iterator over the characters in this string, unescaping escaped characters.

Trait Implementations§

Source§

impl<'de, F> BorrowDecode<'de, F> for &'de EscapedStr

Source§

impl Debug for EscapedStr

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Display for EscapedStr

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<F> Encode<F> for EscapedStr

Source§

fn encode<W: Write>(&self, w: &mut Writer<W>) -> Result<(), EncodeError>

Source§

impl PartialEq<EscapedStr> for str

Source§

fn eq(&self, other: &EscapedStr) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq<str> for EscapedStr

Source§

fn eq(&self, other: &str) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialEq for EscapedStr

Source§

fn eq(&self, other: &Self) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Eq for EscapedStr

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more