EscapedSlice

Struct EscapedSlice 

Source
pub struct EscapedSlice(/* 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 EscapedSlice

Source

pub unsafe fn from_slice(b: &[u8]) -> &EscapedSlice

Create an escaped slice from a byte slice.

§Safety

User must ensure the slice 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 iter(&self) -> EscapedIter<'_>

Returns an iterator over the bytes in this slice, unescaping escaped bytes.

Trait Implementations§

Source§

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

Source§

impl Debug for EscapedSlice

Source§

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

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

impl<F> Encode<F> for EscapedSlice

Source§

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

Source§

impl<'a> IntoIterator for &'a EscapedSlice

Source§

type Item = &'a u8

The type of the elements being iterated over.
Source§

type IntoIter = EscapedIter<'a>

Which kind of iterator are we turning this into?
Source§

fn into_iter(self) -> Self::IntoIter

Creates an iterator from a value. Read more
Source§

impl PartialEq<[u8]> for EscapedSlice

Source§

fn eq(&self, other: &[u8]) -> 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<EscapedSlice> for [u8]

Source§

fn eq(&self, other: &EscapedSlice) -> 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 EscapedSlice

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 EscapedSlice

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