Struct pyo3::PyString [] [src]

pub struct PyString(_);

Represents a Python string.

Methods

impl PyString
[src]

[src]

Creates a new Python string object.

Panics if out of memory.

[src]

[src]

Gets the python string data in its underlying representation.

[src]

Convert the PyString into a Rust string.

Returns a UnicodeDecodeError if the input is not valid unicode (containing unpaired surrogates).

[src]

Convert the PyString into a Rust string.

Unpaired surrogates invalid UTF-8 sequences are replaced with U+FFFD REPLACEMENT CHARACTER.

Trait Implementations

impl<'a> From<&'a PyString> for &'a PyObjectRef
[src]

[src]

Performs the conversion.

impl AsRef<PyObjectRef> for PyString
[src]

[src]

Performs the conversion.

impl PyObjectWithToken for PyString
[src]

[src]

impl ToPyPointer for PyString
[src]

[src]

Gets the underlying FFI pointer, returns a borrowed pointer.

impl PartialEq for PyString
[src]

[src]

This method tests for self and other values to be equal, and is used by ==. Read more

1.0.0
[src]

This method tests for !=.

impl PyTypeInfo for PyString
[src]

Type of objects to store in PyObject struct

Base class

NAME: &'static str = "PyString"

Class name

SIZE: usize = ::std::mem::size_of::<::ffi::PyObject>()

Size of the rust PyObject structure (PyObject + rust structure)

OFFSET: isize = 0

Type instance offset inside PyObject structure

[src]

PyTypeObject instance for this type

[src]

Check if *mut ffi::PyObject is instance of this type

DESCRIPTION: &'static str = "\u{0}"

Class doc string

FLAGS: usize = 0

Type flags (ie PY_TYPE_FLAG_GC, PY_TYPE_FLAG_WEAKREF)

[src]

Check if *mut ffi::PyObject is exact instance of this type

impl PyTypeObject for PyString
[src]

[src]

Initialize type object

[src]

Retrieves the type object for this Python object type.

[src]

Create PyRawObject which can be initialized with rust value

impl ToPyObject for PyString
[src]

[src]

Converts self into a Python object.

impl ToBorrowedObject for PyString
[src]

[src]

Converts self into a Python object and calls the specified closure on the native FFI pointer underlying the Python object. Read more

impl Debug for PyString
[src]

[src]

Formats the value using the given formatter. Read more

impl Display for PyString
[src]

[src]

Formats the value using the given formatter. Read more

impl<'a> FromPyObject<'a> for &'a PyString
[src]

[src]

Extracts Self from the source PyObject.

Auto Trait Implementations

impl Send for PyString

impl Sync for PyString