pub enum KeyCoercion {
Php,
None,
}Expand description
How map keys are normalized before a map is indexed.
§Examples
use bcgen_lang::KeyCoercion;
assert_eq!(KeyCoercion::default(), KeyCoercion::Php);Variants§
Php
PHP’s array-key rules: a string holding a canonical decimal i64
("7", "-3", not "07", "-0", or "+1") becomes that integer, a
float is truncated toward zero (saturating at the i64 range; NaN
gives 0), true/false become 1/0, and null becomes "".
Other keys are left as they are.
None
No normalization: keys compare by LSB’s rules (1 and 1.0 differ).
Trait Implementations§
Source§impl Clone for KeyCoercion
impl Clone for KeyCoercion
impl Copy for KeyCoercion
Source§impl Debug for KeyCoercion
impl Debug for KeyCoercion
Source§impl Default for KeyCoercion
impl Default for KeyCoercion
impl Eq for KeyCoercion
Source§impl Hash for KeyCoercion
impl Hash for KeyCoercion
Source§impl PartialEq for KeyCoercion
impl PartialEq for KeyCoercion
impl StructuralPartialEq for KeyCoercion
Auto Trait Implementations§
impl Freeze for KeyCoercion
impl RefUnwindSafe for KeyCoercion
impl Send for KeyCoercion
impl Sync for KeyCoercion
impl Unpin for KeyCoercion
impl UnsafeUnpin for KeyCoercion
impl UnwindSafe for KeyCoercion
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