Struct pgn_reader::RawHeader [−][src]
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.
Implementations
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> Clone for RawHeader<'a>
[src]
impl<'a> Debug for RawHeader<'a>
[src]
impl<'a> Eq for RawHeader<'a>
[src]
impl<'a> PartialEq<RawHeader<'a>> for RawHeader<'a>
[src]
impl<'a> StructuralEq for RawHeader<'a>
[src]
impl<'a> StructuralPartialEq for RawHeader<'a>
[src]
Auto Trait Implementations
impl<'a> RefUnwindSafe for RawHeader<'a>
impl<'a> Send for RawHeader<'a>
impl<'a> Sync for RawHeader<'a>
impl<'a> Unpin for RawHeader<'a>
impl<'a> UnwindSafe for RawHeader<'a>
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,