pub(crate) struct LispFloat(GcHeap<f64>);
Expand description
A wrapper type for floats to work around issues with Eq. Rust only allows types to be used in match statements if they derive Eq. Even if you never actually use that field in a match. So we need a float wrapper that implements that trait.
Tuple Fields§
§0: GcHeap<f64>
Implementations§
Trait Implementations§
Source§impl RootedDeref for LispFloat
impl RootedDeref for LispFloat
type Target = RootedLispFloat
fn rooted_deref(rooted: &Rt<Self>) -> &Self::Target
fn rooted_derefmut(rooted: &mut Rt<Self>) -> &mut Self::Target
Source§impl TaggedPtr for &LispFloat
impl TaggedPtr for &LispFloat
Source§const TAG: Tag = Tag::Float
const TAG: Tag = Tag::Float
Tag value. This is only applicable to base values. Use Int for sum
types.
Source§type Ptr = LispFloat
type Ptr = LispFloat
The type of object being pointed to. This will be different for all
implementors.
Source§unsafe fn from_obj_ptr(ptr: *const u8) -> Self
unsafe fn from_obj_ptr(ptr: *const u8) -> Self
Given an untyped pointer, reinterpret to self. Read more
Source§unsafe fn tag_ptr(ptr: *const Self::Ptr) -> Gc<Self>
unsafe fn tag_ptr(ptr: *const Self::Ptr) -> Gc<Self>
Given a pointer to
Ptr
return a Tagged pointer. Read moreSource§fn untag(val: Gc<Self>) -> Self
fn untag(val: Gc<Self>) -> Self
Remove the tag from the
Gc<T>
and return the inner type. If it is
base type then it will only have a single possible value and can be
untagged without checks, but sum types need to create all values
they can hold. We use tagged base types to let us reinterpret bits
without actually modify them. Read moreSource§impl<'old, 'new> WithLifetime<'new> for &'old LispFloat
impl<'old, 'new> WithLifetime<'new> for &'old LispFloat
impl Eq for LispFloat
impl GcPtr for &LispFloat
impl StructuralPartialEq for LispFloat
Auto Trait Implementations§
impl !Freeze for LispFloat
impl !RefUnwindSafe for LispFloat
impl Send for LispFloat
impl Sync for LispFloat
impl Unpin for LispFloat
impl UnwindSafe for LispFloat
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
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.