[−][src]Struct pgn_reader::RawHeader
A header value.
Provides helper methods for decoding backslash escaped values.
A quote inside a string is represented by the backslash immediately followed by a quote. A backslash inside a string is represented by two adjacent backslashes.
Methods
impl<'a> RawHeader<'a>[src]
pub fn as_bytes(&self) -> &[u8][src]
Returns the raw byte representation of the header value.
pub fn decode(&self) -> Cow<'a, [u8]>[src]
Decodes escaped quotes and backslashes into bytes. Allocates only when the value actually contains escape sequences.
pub fn decode_utf8(&self) -> Result<Cow<'a, str>, Utf8Error>[src]
Tries to decode the header as UTF-8. This is guaranteed to succeed on valid PGNs.
Errors
Errors if the header contains an invalid UTF-8 byte sequence.
pub fn decode_utf8_lossy(&self) -> Cow<'a, str>[src]
Decodes the header as UTF-8, replacing any invalid byte sequences with the placeholder � U+FFFD.
Trait Implementations
impl<'a> PartialEq<RawHeader<'a>> for RawHeader<'a>[src]
impl<'a> Clone for RawHeader<'a>[src]
fn clone(&self) -> RawHeader<'a>[src]
fn clone_from(&mut self, source: &Self)1.0.0[src]
Performs copy-assignment from source. Read more
impl<'a> Eq for RawHeader<'a>[src]
impl<'a> Debug for RawHeader<'a>[src]
Auto Trait Implementations
Blanket Implementations
impl<T, U> Into for T where
U: From<T>, [src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone, [src]
T: Clone,
impl<T> From for T[src]
impl<T, U> TryFrom for T where
U: Into<T>, [src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>[src]
impl<T> Borrow for T where
T: ?Sized, [src]
T: ?Sized,
impl<T> Any for T where
T: 'static + ?Sized, [src]
T: 'static + ?Sized,
impl<T> BorrowMut for T where
T: ?Sized, [src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T[src]
impl<T, U> TryInto for T where
U: TryFrom<T>, [src]
U: TryFrom<T>,