mri_sys/value.rs
1use libc;
2use std;
3
4/// The inner integer of a `VALUE`.
5#[allow(non_camel_case_types)]
6pub type INNER_VALUE = libc::uintptr_t;
7
8#[repr(C)]
9#[derive(Copy,Clone,PartialEq,Eq)]
10/// A Ruby value.
11pub struct VALUE(pub INNER_VALUE);
12
13impl std::fmt::Debug for VALUE {
14 fn fmt(&self, fmt: &mut std::fmt::Formatter) -> std::fmt::Result {
15 write!(fmt, "0x{:x}", self.0)
16 }
17}
18
19impl std::ops::BitAnd for VALUE {
20 type Output = libc::uintptr_t;
21
22 fn bitand(self, rhs: Self) -> libc::uintptr_t {
23 self.0 & rhs.0
24 }
25}