#[repr(C)]pub struct DLDataType {
pub code: u8,
pub bits: u8,
pub lanes: u16,
}Expand description
DLPack data type struct
Fields§
§code: u8§bits: u8§lanes: u16Implementations§
Source§impl DLDataType
impl DLDataType
pub fn new(code: DLDataTypeCode, bits: u8, lanes: u16) -> DLDataType
Trait Implementations§
Source§impl AnyCompatible for DLDataType
impl AnyCompatible for DLDataType
Source§fn type_str() -> String
fn type_str() -> String
The type name in conversion errors and type schemas, such as
int,
ffi.String or Array<int>.Source§unsafe fn copy_to_any_view(src: &Self, data: &mut TVMFFIAny)
unsafe fn copy_to_any_view(src: &Self, data: &mut TVMFFIAny)
Source§unsafe fn move_to_any(src: Self, data: &mut TVMFFIAny)
unsafe fn move_to_any(src: Self, data: &mut TVMFFIAny)
Source§unsafe fn check_any_strict(data: &TVMFFIAny) -> bool
unsafe fn check_any_strict(data: &TVMFFIAny) -> bool
Source§unsafe fn copy_from_any_view_after_check(data: &TVMFFIAny) -> Self
unsafe fn copy_from_any_view_after_check(data: &TVMFFIAny) -> Self
Copy a
Self out of a cell that holds one, retaining any object. Read moreSource§unsafe fn move_from_any_after_check(data: &mut TVMFFIAny) -> Self
unsafe fn move_from_any_after_check(data: &mut TVMFFIAny) -> Self
Move a
Self out of an owning cell that holds one. Read moreSource§unsafe fn try_cast_from_any_view(data: &TVMFFIAny) -> Result<Self, ()>
unsafe fn try_cast_from_any_view(data: &TVMFFIAny) -> Result<Self, ()>
Convert
data into a Self by the FFI rules, such as an integer into a
float; Err if it does not convert. Read moreSource§unsafe fn is_undefined(field: *const Self) -> bool
unsafe fn is_undefined(field: *const Self) -> bool
Whether
field, which holds a value of this type or all-zero bytes,
holds all-zero bytes that are no value of this type, as a null object
reference, a string of type index None or a zero device type: a field
that a creator left undefined for reflection to set. An undefined field
is no value; a nullable reference is Option<T>, whose None is a
defined value. Read moreSource§fn get_mismatch_type_info(data: &TVMFFIAny) -> String
fn get_mismatch_type_info(data: &TVMFFIAny) -> String
The name of the mismatched value
data in conversion errors; by
default its runtime type key.Source§fn type_schema() -> String
fn type_schema() -> String
The type schema of the type: the JSON object that describes it, which
the type schemas of functions and fields embed. Read more
Source§impl Clone for DLDataType
impl Clone for DLDataType
Source§fn clone(&self) -> DLDataType
fn clone(&self) -> DLDataType
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreimpl Copy for DLDataType
Source§impl DLDataTypeExt for DLDataType
impl DLDataTypeExt for DLDataType
Source§impl Debug for DLDataType
impl Debug for DLDataType
Source§impl DowncastRefFromAny for DLDataType
impl DowncastRefFromAny for DLDataType
impl Eq for DLDataType
Source§impl IntoArg<DLDataType> for DLDataType
impl IntoArg<DLDataType> for DLDataType
Source§type Output = DLDataType
type Output = DLDataType
T when owned, &T when borrowed.Source§fn into_arg(self) -> DLDataType
fn into_arg(self) -> DLDataType
Convert into a
T or a &T.Source§fn into_owned(self) -> DLDataType
fn into_owned(self) -> DLDataType
Convert into an owned
T, cloning only a borrowed value.Source§impl<'a> IntoArg<DLDataType> for &'a DLDataType
impl<'a> IntoArg<DLDataType> for &'a DLDataType
Source§type Output = &'a DLDataType
type Output = &'a DLDataType
T when owned, &T when borrowed.Source§fn into_arg(self) -> &'a DLDataType
fn into_arg(self) -> &'a DLDataType
Convert into a
T or a &T.Source§fn into_owned(self) -> DLDataType
fn into_owned(self) -> DLDataType
Convert into an owned
T, cloning only a borrowed value.impl OptionalCompatible for DLDataType
Source§impl PackedCallArg for DLDataType
impl PackedCallArg for DLDataType
Source§type Holder = DLDataType
type Holder = DLDataType
What keeps the argument alive during the call.
fn into_packed_arg(self) -> DLDataType
fn as_packed_arg(holder: &Self::Holder) -> AnyView<'_>
Source§impl<'a> PackedCallArg for &'a DLDataType
impl<'a> PackedCallArg for &'a DLDataType
Source§type Holder = &'a DLDataType
type Holder = &'a DLDataType
What keeps the argument alive during the call.
fn into_packed_arg(self) -> &'a DLDataType
fn as_packed_arg(holder: &Self::Holder) -> AnyView<'_>
Source§impl PartialEq for DLDataType
impl PartialEq for DLDataType
impl StructuralPartialEq for DLDataType
Source§impl<'a> TryFrom<&'a Any> for DLDataType
impl<'a> TryFrom<&'a Any> for DLDataType
Source§impl TryFrom<Any> for DLDataType
impl TryFrom<Any> for DLDataType
Auto Trait Implementations§
impl Forget for DLDataType
impl Freeze for DLDataType
impl Move for DLDataType
impl RefUnwindSafe for DLDataType
impl Send for DLDataType
impl Sync for DLDataType
impl Unpin for DLDataType
impl UnsafeUnpin for DLDataType
impl UnwindSafe for DLDataType
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more