Enum cpython::PyStringData [−][src]
Expand description
Enum of possible Python string representations.
Variants
Implementations
Convert the Python string data to a Rust string.
For UTF-8 and ASCII-only latin-1, returns a borrow into the original string data. For Latin-1, UTF-16 and UTF-32, returns an owned string.
Fails with UnicodeDecodeError if the string data isn’t valid in its encoding.
Convert the Python string data to a Rust string.
Returns a borrow into the original string data if possible.
Data that isn’t valid in its encoding will be replaced with U+FFFD REPLACEMENT CHARACTER.
Trait Implementations
Performs the conversion.
Auto Trait Implementations
impl<'a> RefUnwindSafe for PyStringData<'a>
impl<'a> Send for PyStringData<'a>
impl<'a> Sync for PyStringData<'a>
impl<'a> Unpin for PyStringData<'a>
impl<'a> UnwindSafe for PyStringData<'a>
Blanket Implementations
Mutably borrows from an owned value. Read more