Enum PType

Source
#[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

Source

pub fn is_valid(value: i32) -> bool

Returns true if value is a variant of PType.

Source

pub fn from_i32(value: i32) -> Option<PType>

👎Deprecated: Use the TryFrom<i32> implementation instead

Converts an i32 to a PType, or None if value is not a valid variant.

Source§

impl PType

Source

pub const fn is_unsigned_int(self) -> bool

Returns true iff this PType is an unsigned integer type

Source

pub const fn is_signed_int(self) -> bool

Returns true iff this PType is a signed integer type

Source

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()

Source

pub const fn is_float(self) -> bool

Returns true iff this PType is a floating point type

Source

pub const fn byte_width(&self) -> usize

Returns the number of bytes in this PType

Source

pub const fn bit_width(&self) -> usize

Returns the number of bits in this PType

Source

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

Source

pub const fn to_signed(self) -> Self

Returns the PType that corresponds to the signed version of this PType

Source

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 Clone for PType

Source§

fn clone(&self) -> PType

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PType

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for PType

Source§

fn default() -> PType

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

impl Display for PType

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl From<PType> for &DType

Source§

fn from(item: PType) -> Self

Converts to this type from the input type.
Source§

impl From<PType> for DType

Source§

fn from(item: PType) -> Self

Converts to this type from the input type.
Source§

impl From<PType> for PType

Source§

fn from(value: PType) -> Self

Converts to this type from the input type.
Source§

impl From<PType> for PType

Source§

fn from(value: PType) -> Self

Converts to this type from the input type.
Source§

impl From<PType> for PType

Source§

fn from(value: PType) -> Self

Converts to this type from the input type.
Source§

impl From<PType> for i32

Source§

fn from(value: PType) -> i32

Converts to this type from the input type.
Source§

impl Hash for PType

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for PType

Source§

fn eq(&self, other: &PType) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl PartialOrd for PType

Source§

fn partial_cmp(&self, other: &PType) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · Source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · Source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · Source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · Source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
Source§

impl TryFrom<&DType> for PType

Source§

type Error = VortexError

The type returned in the event of a conversion error.
Source§

fn try_from(value: &DType) -> VortexResult<Self>

Performs the conversion.
Source§

impl TryFrom<PType> for PType

Source§

type Error = VortexError

The type returned in the event of a conversion error.
Source§

fn try_from(value: PType) -> Result<Self, Self::Error>

Performs the conversion.
Source§

impl TryFrom<i32> for PType

Source§

type Error = UnknownEnumValue

The type returned in the event of a conversion error.
Source§

fn try_from(value: i32) -> Result<PType, UnknownEnumValue>

Performs the conversion.
Source§

impl TryFromArrowType<&DataType> for PType

Source§

fn try_from_arrow(value: &DataType) -> VortexResult<Self>

Convert the Arrow type to a Vortex type.
Source§

impl Copy for PType

Source§

impl Eq for PType

Source§

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> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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 more
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

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

fn clone_into(&self, target: &mut T)

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

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> ErasedDestructor for T
where T: 'static,