#[repr(u8)]pub enum PType {
U8 = 0,
U16 = 1,
U32 = 2,
U64 = 3,
I8 = 4,
I16 = 5,
I32 = 6,
I64 = 7,
F16 = 8,
F32 = 9,
F64 = 10,
}Expand description
Physical type enum, represents the in-memory physical layout but might represent a different logical type.
Variants§
U8 = 0
An 8-bit unsigned integer
U16 = 1
A 16-bit unsigned integer
U32 = 2
A 32-bit unsigned integer
U64 = 3
A 64-bit unsigned integer
I8 = 4
An 8-bit signed integer
I16 = 5
A 16-bit signed integer
I32 = 6
A 32-bit signed integer
I64 = 7
A 64-bit signed integer
F16 = 8
A 16-bit floating point number
F32 = 9
A 32-bit floating point number
F64 = 10
A 64-bit floating point number
Implementations§
Source§impl PType
impl PType
Sourcepub const fn is_unsigned_int(self) -> bool
pub const fn is_unsigned_int(self) -> bool
Returns true iff this PType is an unsigned integer type
Sourcepub const fn is_signed_int(self) -> bool
pub const fn is_signed_int(self) -> bool
Returns true iff this PType is a signed integer type
Sourcepub const fn is_int(self) -> bool
pub const fn is_int(self) -> bool
Returns true iff this PType is an integer type
Equivalent to self.is_unsigned_int() || self.is_signed_int()
Sourcepub const fn byte_width(&self) -> usize
pub const fn byte_width(&self) -> usize
Returns the number of bytes in this PType
Sourcepub fn max_value_as_u64(&self) -> u64
pub fn max_value_as_u64(&self) -> u64
Returns the maximum value of this PType if it is an integer type
Returns u64::MAX if the value is too large to fit in a u64
Sourcepub const fn to_signed(self) -> Self
pub const fn to_signed(self) -> Self
Returns the PType that corresponds to the signed version of this PType
Sourcepub const fn to_unsigned(self) -> Self
pub const fn to_unsigned(self) -> Self
Returns the PType that corresponds to the unsigned version of this PType
For floating point types, this will simply return self
Trait Implementations§
Source§impl PartialOrd for PType
impl PartialOrd for PType
Source§impl TryFrom<&DType> for PType
impl TryFrom<&DType> for PType
Source§type Error = VortexError
type Error = VortexError
Source§fn try_from(value: &DType) -> VortexResult<Self>
fn try_from(value: &DType) -> VortexResult<Self>
Source§impl TryFromArrowType<&DataType> for PType
impl TryFromArrowType<&DataType> for PType
Source§fn try_from_arrow(value: &DataType) -> VortexResult<Self>
fn try_from_arrow(value: &DataType) -> VortexResult<Self>
impl Copy for PType
impl Eq for PType
impl StructuralPartialEq for PType
Auto Trait Implementations§
impl Freeze for PType
impl RefUnwindSafe for PType
impl Send for PType
impl Sync for PType
impl Unpin for PType
impl UnwindSafe for PType
Blanket Implementations§
Source§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
Source§type ArchivedMetadata = ()
type ArchivedMetadata = ()
Source§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata,
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata, ) -> <T as Pointee>::Metadata
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> LayoutRaw for T
impl<T> LayoutRaw for T
Source§fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
fn layout_raw(_: <T as Pointee>::Metadata) -> Result<Layout, LayoutError>
Source§impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
impl<T, N1, N2> Niching<NichedOption<T, N1>> for N2
Source§unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
unsafe fn is_niched(niched: *const NichedOption<T, N1>) -> bool
Source§fn resolve_niched(out: Place<NichedOption<T, N1>>)
fn resolve_niched(out: Place<NichedOption<T, N1>>)
out indicating that a T is niched.