Trait ByteString

Source
pub trait ByteString {
    type OutSlice: ?Sized + ByteStringSlice;

    // Required method
    unsafe fn as_mut_bytes(&mut self) -> &mut [u8] ;
}
Expand description

Trait representing types that can be in-place parsed (i.e. ASCII-compatible byte strings)

Required Associated Types§

Source

type OutSlice: ?Sized + ByteStringSlice

Output slice type (e.g str or OsStr)

Required Methods§

Source

unsafe fn as_mut_bytes(&mut self) -> &mut [u8]

Get the string as a mutable sequence of bytes

Implementations on Foreign Types§

Source§

impl ByteString for str

Parse a rust UTF-8 string, yeilding string slices

Source§

impl ByteString for String

Source§

impl ByteString for OsStr

Source§

impl ByteString for [u8]

Parse a byte slice as a ASCII (or UTF-8/WTF-8/…) string, returning byte slices

Implementors§