Struct DLDataType
#[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§
§impl DLDataType
impl DLDataType
pub fn new(code: DLDataTypeCode, bits: u8, lanes: u16) -> DLDataType
Trait Implementations§
Source§impl AnyCompatible for DLDataType
AnyCompatible implementation for DLDataType
impl AnyCompatible for DLDataType
AnyCompatible implementation for DLDataType
This implementation allows DLDataType to be used with the TVM FFI Any system, enabling type-safe conversion between DLDataType and the generic Any type.
Source§fn type_str() -> String
fn type_str() -> String
Get the type string identifier for DLDataType
§Returns
The string “DataType” to match the C++ representation
Source§unsafe fn copy_to_any_view(src: &Self, data: &mut TVMFFIAny)
unsafe fn copy_to_any_view(src: &Self, data: &mut TVMFFIAny)
Copy a DLDataType to an Any view
§Arguments
src- The DLDataType to copy fromdata- The Any view to copy to
Source§unsafe fn move_to_any(src: Self, data: &mut TVMFFIAny)
unsafe fn move_to_any(src: Self, data: &mut TVMFFIAny)
Move a DLDataType into an Any
§Arguments
src- The DLDataType to move fromdata- The Any to move into
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
Source§unsafe fn move_from_any_after_check(data: &mut TVMFFIAny) -> Self
unsafe fn move_from_any_after_check(data: &mut TVMFFIAny) -> Self
Source§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, as C++ UnsafeInit
leaves a reference undefined (null). Unlike a C++ undefined reference,
it 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
Get the type key of a type when TryCastFromAnyView fails.
Source§fn type_schema() -> String
fn type_schema() -> String
The type schema of the type: the JSON object C++
TypeTraits<T>::TypeSchema writes, which the type schemas of functions
and fields embed. Read moreSource§impl<'a> ArgIntoRef for &'a DLDataType
impl<'a> ArgIntoRef for &'a DLDataType
Source§impl ArgIntoRef for DLDataType
impl ArgIntoRef for DLDataType
§impl Clone for DLDataType
impl Clone for DLDataType
§fn clone(&self) -> DLDataType
fn clone(&self) -> DLDataType
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl DLDataTypeExt for DLDataType
impl DLDataTypeExt for DLDataType
§impl Debug for DLDataType
impl Debug for DLDataType
Source§impl<'a> IntoArgHolder for &'a DLDataType
impl<'a> IntoArgHolder for &'a DLDataType
type Target = &'a DLDataType
fn into_arg_holder(self) -> Self::Target
Source§impl IntoArgHolder for DLDataType
impl IntoArgHolder for DLDataType
type Target = DLDataType
fn into_arg_holder(self) -> Self::Target
§impl PartialEq for DLDataType
impl PartialEq for DLDataType
Source§impl TryFrom<Any> for DLDataType
impl TryFrom<Any> for DLDataType
Source§impl<'a> TryFrom<AnyView<'a>> for DLDataType
impl<'a> TryFrom<AnyView<'a>> for DLDataType
impl Copy for DLDataType
impl Eq for DLDataType
impl OptionalCompatible for DLDataType
impl StructuralPartialEq for DLDataType
Auto Trait Implementations§
impl Freeze for DLDataType
impl RefUnwindSafe for DLDataType
impl Send for DLDataType
impl Sync for DLDataType
impl Unpin 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