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
0: DLDataType
String(*mut c_char)
Device(DLDevice)
Tuple Fields
0: DLDevice
Handle(*mut c_void)
ArrayHandle(TVMArrayHandle)
Tuple Fields
ObjectHandle(*mut c_void)
ModuleHandle(TVMModuleHandle)
Tuple Fields
FuncHandle(TVMFunctionHandle)
Tuple Fields
NDArrayHandle(*mut c_void)
Bytes(TVMByteArray)
Tuple Fields
0: TVMByteArray
Str(&'static CStr)
Tuple Fields
0: &'static CStr
Implementations
Trait Implementations
Performs the conversion.
Performs the conversion.
Auto Trait Implementations
impl RefUnwindSafe for RetValue
impl UnwindSafe for RetValue
Blanket Implementations
Mutably borrows from an owned value. Read more