[]Trait html5ever::tendril::fmt::Slice

pub unsafe trait Slice {
    fn as_bytes(&self) -> &[u8];
unsafe fn from_bytes(x: &[u8]) -> &Self;
unsafe fn from_mut_bytes(x: &mut [u8]) -> &mut Self; }

Indicates a Rust slice type that is represented in memory as bytes.

Required methods

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

Access the raw bytes of the slice.

unsafe fn from_bytes(x: &[u8]) -> &Self

Convert a byte slice to this kind of slice.

You may assume the buffer is already validated for Format.

unsafe fn from_mut_bytes(x: &mut [u8]) -> &mut Self

Convert a byte slice to this kind of slice.

You may assume the buffer is already validated for Format.

Loading content...

Implementations on Foreign Types

impl Slice for [u8]

impl Slice for str

Loading content...

Implementors

Loading content...