[][src]Struct rustpython_vm::obj::objstr::PyString

pub struct PyString {
    pub value: String,
}

str(object='') -> str str(bytes_or_buffer[, encoding[, errors]]) -> str

Create a new string object from the given object. If encoding or errors is specified, then the object must expose a data buffer that will be decoded using the given encoding and error handler. Otherwise, returns the result of object.str() (if defined) or repr(object). encoding defaults to sys.getdefaultencoding(). errors defaults to 'strict'."

Fields

value: String

Methods

impl PyString[src]

pub fn as_str(&self) -> &str[src]

Trait Implementations

impl TryIntoRef<PyString> for String[src]

impl<'_> TryIntoRef<PyString> for &'_ str[src]

impl PyValue for PyString[src]

const HAVE_DICT: bool[src]

fn into_ref(self, vm: &VirtualMachine) -> PyRef<Self>[src]

fn into_ref_with_type(
    self,
    vm: &VirtualMachine,
    cls: PyClassRef
) -> PyResult<PyRef<Self>>
[src]

impl PyClassDef for PyString[src]

impl PyClassImpl for PyString[src]

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

impl Clone for PyString[src]

fn clone_from(&mut self, source: &Self)1.0.0[src]

Performs copy-assignment from source. Read more

impl Debug for PyString[src]

impl Display for PyString[src]

Auto Trait Implementations

Blanket Implementations

impl<T> IntoPyObject for T where
    T: PyValue
[src]

impl<T> PyObjectPayload for T where
    T: 'static + PyValue
[src]

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

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

type Owned = T

The resulting type after obtaining ownership.

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

impl<T, U> Into<U> for T where
    U: From<T>, 
[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.

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

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

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

impl<T> Same<T> for T

type Output = T

Should always be Self