Enum ext_php_rs::flags::DataType
source · #[repr(C, u8)]
pub enum DataType {
}
Expand description
Valid data types for PHP.
Variants§
Undef
Null
False
True
Long
Double
String
Array
Object(Option<&'static str>)
Resource
Reference
Callable
ConstantExpression
Void
Mixed
Bool
Ptr
Implementations§
source§impl DataType
impl DataType
sourcepub const fn as_u32(&self) -> u32
pub const fn as_u32(&self) -> u32
Returns the integer representation of the data type.
Examples found in repository?
More examples
src/zend/_type.rs (line 153)
147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166
pub(crate) fn type_init_code(
type_: DataType,
pass_by_ref: bool,
is_variadic: bool,
allow_null: bool,
) -> u32 {
let type_ = type_.as_u32();
(if type_ == _IS_BOOL {
MAY_BE_BOOL
} else if type_ == IS_MIXED {
MAY_BE_ANY
} else {
1 << type_
}) | (if allow_null {
_ZEND_TYPE_NULLABLE_BIT
} else {
0
}) | Self::arg_info_flags(pass_by_ref, is_variadic)
}
Trait Implementations§
source§impl Ord for DataType
impl Ord for DataType
source§impl PartialEq<DataType> for DataType
impl PartialEq<DataType> for DataType
source§impl PartialOrd<DataType> for DataType
impl PartialOrd<DataType> for DataType
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read more