[][src]Struct rustpython_vm::obj::objbytes::PyBytes

pub struct PyBytes { /* fields omitted */ }

"bytes(iterable_of_ints) -> bytes\n
bytes(string, encoding[, errors]) -> bytes\n
bytes(bytes_or_buffer) -> immutable copy of bytes_or_buffer\n
bytes(int) -> bytes object of size given by the parameter initialized with null bytes\n
bytes() -> empty bytes object\n\nConstruct an immutable array of bytes from:\n

  • an iterable yielding integers in range(256)\n
  • a text string encoded using the specified encoding\n
  • any object implementing the buffer API.\n
  • an integer";

Methods

impl PyBytes[src]

pub fn new(elements: Vec<u8>) -> Self[src]

pub fn from_string(
    value: &str,
    encoding: &str,
    vm: &VirtualMachine
) -> PyResult<Self>
[src]

pub fn get_value(&self) -> &[u8][src]

Trait Implementations

impl PyValue for PyBytes[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 PyBytes[src]

impl Clone for PyBytes[src]

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

Performs copy-assignment from source. Read more

impl Debug for PyBytes[src]

impl Deref for PyBytes[src]

type Target = [u8]

The resulting type after dereferencing.

Auto Trait Implementations

impl Sync for PyBytes

impl Unpin for PyBytes

impl Send for PyBytes

impl UnwindSafe for PyBytes

impl RefUnwindSafe for PyBytes

Blanket Implementations

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

impl<T> PyObjectPayload for T where
    T: 'static + PyValue
[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, 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> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<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