Enum tvm_sys::packed_func::RetValue[][src]

pub enum RetValue {
Show 15 variants Int(i64), UInt(i64), Float(f64), Null, DataType(DLDataType), String(*mut c_char), Device(DLDevice), Handle(*mut c_void), ArrayHandle(TVMArrayHandle), ObjectHandle(*mut c_void), ModuleHandle(TVMModuleHandle), FuncHandle(TVMFunctionHandle), NDArrayHandle(*mut c_void), Bytes(TVMByteArray), Str(&'static CStr),
}
Expand description

An owned TVMPODValue. Can be converted from a variety of primitive and object types. Can be downcasted using try_from if it contains the desired type.

Example

use std::convert::{TryFrom, TryInto};
use tvm_sys::RetValue;

let a = 42u32;
let b: u32 = tvm_sys::RetValue::from(a).try_into().unwrap();

let s = "hello, world!";
let t: RetValue = s.to_string().into();
assert_eq!(String::try_from(t).unwrap(), s);

Variants

Int(i64)

Tuple Fields

0: i64

UInt(i64)

Tuple Fields

0: i64

Float(f64)

Tuple Fields

0: f64

Null

DataType(DLDataType)

Tuple Fields

String(*mut c_char)

Tuple Fields

Device(DLDevice)

Tuple Fields

Handle(*mut c_void)

Tuple Fields

ArrayHandle(TVMArrayHandle)

Tuple Fields

ObjectHandle(*mut c_void)

Tuple Fields

ModuleHandle(TVMModuleHandle)

Tuple Fields

FuncHandle(TVMFunctionHandle)

Tuple Fields

NDArrayHandle(*mut c_void)

Tuple Fields

Bytes(TVMByteArray)

Tuple Fields

Str(&'static CStr)

Tuple Fields

0: &'static CStr

Implementations

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

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

🔬 This is a nightly-only experimental API. (toowned_clone_into)

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

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.