Enum PyArg

Source
pub enum PyArg {
Show 16 variants I64(i64), I32(i32), I16(i16), I8(i8), U64(u64), U32(u32), U16(u16), U8(u8), F32(f32), F64(f64), PyBool(PyBool), PyString(PyString), PyTuple(*mut PyTuple), PyList(*mut PyList), PyDict(*mut size_t), None,
}
Expand description

Enum type used to construct PyTuple and PyList types. All the kinds supported in Python are included here.

In Python, conversion of floats default to double precision unless explicitly stated adding the Float custom rustypy type to the return type signature.

    from rustypy.rswrapper import Double, Float
    bindings.my_binded_func.restype = Float
    bindings.my_binded_func.restype = Double

Likewise, all ‘int’ types are converted to signed 64-bit integers by default.

Variants§

§

I64(i64)

§

I32(i32)

§

I16(i16)

§

I8(i8)

§

U64(u64)

§

U32(u32)

§

U16(u16)

§

U8(u8)

§

F32(f32)

§

F64(f64)

§

PyBool(PyBool)

§

PyString(PyString)

§

PyTuple(*mut PyTuple)

§

PyList(*mut PyList)

§

PyDict(*mut size_t)

§

None

Implementations§

Trait Implementations§

Source§

impl AsRef<PyBool> for PyArg

Source§

fn as_ref(&self) -> &PyBool

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<K> AsRef<PyDict<K>> for PyArg
where K: Eq + Hash + PyDictKey,

Source§

fn as_ref(&self) -> &PyDict<K>

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<PyList> for PyArg

Source§

fn as_ref(&self) -> &PyList

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<PyString> for PyArg

Source§

fn as_ref(&self) -> &PyString

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<PyTuple> for PyArg

Source§

fn as_ref(&self) -> &PyTuple

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<f32> for PyArg

Source§

fn as_ref(&self) -> &f32

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<f64> for PyArg

Source§

fn as_ref(&self) -> &f64

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<i16> for PyArg

Source§

fn as_ref(&self) -> &i16

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<i32> for PyArg

Source§

fn as_ref(&self) -> &i32

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<i64> for PyArg

Source§

fn as_ref(&self) -> &i64

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<i8> for PyArg

Source§

fn as_ref(&self) -> &i8

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<u16> for PyArg

Source§

fn as_ref(&self) -> &u16

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<u32> for PyArg

Source§

fn as_ref(&self) -> &u32

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<u64> for PyArg

Source§

fn as_ref(&self) -> &u64

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl AsRef<u8> for PyArg

Source§

fn as_ref(&self) -> &u8

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl Clone for PyArg

Source§

fn clone(&self) -> PyArg

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PyArg

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'a> From<&'a bool> for PyArg

Source§

fn from(a: &'a bool) -> PyArg

Converts to this type from the input type.
Source§

impl<'a> From<&'a str> for PyArg

Source§

fn from(a: &str) -> PyArg

Converts to this type from the input type.
Source§

impl<K, V> From<HashMap<K, V>> for PyArg
where PyArg: From<V>, K: Eq + Hash + PyDictKey,

Source§

fn from(a: HashMap<K, V>) -> PyArg

Converts to this type from the input type.
Source§

impl From<PyArg> for PyBool

Source§

fn from(a: PyArg) -> PyBool

Converts to this type from the input type.
Source§

impl<K> From<PyArg> for PyDict<K>
where K: Eq + Hash + PyDictKey,

Source§

fn from(a: PyArg) -> PyDict<K>

Converts to this type from the input type.
Source§

impl From<PyArg> for PyList

Source§

fn from(a: PyArg) -> PyList

Converts to this type from the input type.
Source§

impl From<PyArg> for PyString

Source§

fn from(a: PyArg) -> PyString

Converts to this type from the input type.
Source§

impl From<PyArg> for PyTuple

Source§

fn from(a: PyArg) -> PyTuple

Converts to this type from the input type.
Source§

impl From<PyArg> for String

Source§

fn from(a: PyArg) -> String

Converts to this type from the input type.
Source§

impl From<PyArg> for f32

Source§

fn from(a: PyArg) -> f32

Converts to this type from the input type.
Source§

impl From<PyArg> for f64

Source§

fn from(a: PyArg) -> f64

Converts to this type from the input type.
Source§

impl From<PyArg> for i16

Source§

fn from(a: PyArg) -> i16

Converts to this type from the input type.
Source§

impl From<PyArg> for i32

Source§

fn from(a: PyArg) -> i32

Converts to this type from the input type.
Source§

impl From<PyArg> for i64

Source§

fn from(a: PyArg) -> i64

Converts to this type from the input type.
Source§

impl From<PyArg> for i8

Source§

fn from(a: PyArg) -> i8

Converts to this type from the input type.
Source§

impl From<PyArg> for u16

Source§

fn from(a: PyArg) -> u16

Converts to this type from the input type.
Source§

impl From<PyArg> for u32

Source§

fn from(a: PyArg) -> u32

Converts to this type from the input type.
Source§

impl From<PyArg> for u64

Source§

fn from(a: PyArg) -> u64

Converts to this type from the input type.
Source§

impl From<PyArg> for u8

Source§

fn from(a: PyArg) -> u8

Converts to this type from the input type.
Source§

impl From<PyBool> for PyArg

Source§

fn from(a: PyBool) -> PyArg

Converts to this type from the input type.
Source§

impl<K> From<PyDict<K>> for PyArg
where K: Eq + Hash + PyDictKey,

Source§

fn from(a: PyDict<K>) -> PyArg

Converts to this type from the input type.
Source§

impl From<PyList> for PyArg

Source§

fn from(a: PyList) -> PyArg

Converts to this type from the input type.
Source§

impl From<PyString> for PyArg

Source§

fn from(a: PyString) -> PyArg

Converts to this type from the input type.
Source§

impl From<PyTuple> for PyArg

Source§

fn from(a: PyTuple) -> PyArg

Converts to this type from the input type.
Source§

impl From<String> for PyArg

Source§

fn from(a: String) -> PyArg

Converts to this type from the input type.
Source§

impl<T> From<Vec<T>> for PyArg
where PyArg: From<T>,

Source§

fn from(a: Vec<T>) -> PyArg

Converts to this type from the input type.
Source§

impl From<bool> for PyArg

Source§

fn from(a: bool) -> PyArg

Converts to this type from the input type.
Source§

impl From<f32> for PyArg

Source§

fn from(a: f32) -> PyArg

Converts to this type from the input type.
Source§

impl From<f64> for PyArg

Source§

fn from(a: f64) -> PyArg

Converts to this type from the input type.
Source§

impl From<i16> for PyArg

Source§

fn from(a: i16) -> PyArg

Converts to this type from the input type.
Source§

impl From<i32> for PyArg

Source§

fn from(a: i32) -> PyArg

Converts to this type from the input type.
Source§

impl From<i64> for PyArg

Source§

fn from(a: i64) -> PyArg

Converts to this type from the input type.
Source§

impl From<i8> for PyArg

Source§

fn from(a: i8) -> PyArg

Converts to this type from the input type.
Source§

impl From<u16> for PyArg

Source§

fn from(a: u16) -> PyArg

Converts to this type from the input type.
Source§

impl From<u32> for PyArg

Source§

fn from(a: u32) -> PyArg

Converts to this type from the input type.
Source§

impl From<u64> for PyArg

Source§

fn from(a: u64) -> PyArg

Converts to this type from the input type.
Source§

impl From<u8> for PyArg

Source§

fn from(a: u8) -> PyArg

Converts to this type from the input type.
Source§

impl PartialEq for PyArg

Source§

fn eq(&self, other: &PyArg) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for PyArg

Auto Trait Implementations§

§

impl Freeze for PyArg

§

impl RefUnwindSafe for PyArg

§

impl !Send for PyArg

§

impl !Sync for PyArg

§

impl Unpin for PyArg

§

impl UnwindSafe for PyArg

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.