#[repr(C, u8)]pub enum DataType {
Show 19 variants
Undef,
Null,
False,
True,
Long,
Double,
String,
Array,
Iterable,
Object(Str),
Resource,
Reference,
Callable,
ConstantExpression,
Void,
Mixed,
Bool,
Ptr,
Indirect,
}Expand description
Valid data types for PHP.
The Zend integer representation of each variant depends on the PHP version
and lives in ext-php-rs, behind bindgen. This crate only carries the
ABI-stable enum so cargo-php can read it from a compiled extension.
Variants§
Undef
Undefined
Null
null
False
false
True
true
Long
Integer (the irony)
Double
Floating point number
String
String
Array
Array
Iterable
Iterable
Object(Str)
Object, with an optional class or interface name. An empty name means
any object. Use DataType::object or DataType::ANY_OBJECT to
build it and DataType::class_name to read it.
Resource
Resource
Reference
Reference
Callable
Callable
ConstantExpression
Constant expression
Void
Void
Mixed
Mixed
Bool
Boolean
Ptr
Pointer
Indirect
Indirect (internal)
Implementations§
Source§impl DataType
impl DataType
Sourcepub const ANY_OBJECT: DataType
pub const ANY_OBJECT: DataType
Any object, whatever its class.
Sourcepub const fn object(class_name: &'static str) -> DataType
pub const fn object(class_name: &'static str) -> DataType
An object of the given class or interface.
Sourcepub const fn class_name(&self) -> Option<&'static str>
pub const fn class_name(&self) -> Option<&'static str>
The class name of a DataType::Object, if it has one.
Trait Implementations§
impl Copy for DataType
Source§impl DataTypeExt for DataType
impl DataTypeExt for DataType
impl Eq for DataType
impl StructuralPartialEq for DataType
Auto Trait Implementations§
impl Freeze for DataType
impl RefUnwindSafe for DataType
impl Send for DataType
impl Sync for DataType
impl Unpin for DataType
impl UnsafeUnpin for DataType
impl UnwindSafe for DataType
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
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.