[][src]Struct rustypy::pytypes::pystring::PyString

pub struct PyString { /* fields omitted */ }

An analog of a Python string.

Read the module docs for more information.

Methods

impl PyString[src]

pub unsafe fn from_ptr(ptr: *mut PyString) -> PyString[src]

Get a PyString from a previously boxed raw pointer.

Safety

Ensure that the passed ptr is valid

pub unsafe fn from_ptr_to_string(ptr: *mut PyString) -> String[src]

Constructs an owned String from a raw pointer.

Safety

Ensure that the passed ptr is valid

pub fn into_raw(self) -> *mut PyString[src]

Returns PyString as a raw pointer. Use this whenever you want to return a PyString to Python.

pub unsafe fn from_raw(ptr: *const c_char) -> PyString[src]

Return a PyString from a raw char pointer.

Trait Implementations

impl AsRef<PyString> for PyArg[src]

impl Clone for PyString[src]

impl Debug for PyString[src]

impl Display for PyString[src]

impl Eq for PyString[src]

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

fn from(s: &'a str) -> PyString[src]

Copies a string slice to a PyString.

impl From<PyArg> for PyString[src]

impl From<PyString> for String[src]

impl From<PyString> for PyArg[src]

impl From<String> for PyString[src]

fn from(s: String) -> PyString[src]

Copies a String to a PyString.

impl Hash for PyString[src]

impl PartialEq<PyString> for PyString[src]

impl StructuralEq for PyString[src]

impl StructuralPartialEq for PyString[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.