pub(crate) struct Cons(GcHeap<ConsInner>);
Tuple Fields§
§0: GcHeap<ConsInner>
Implementations§
Source§impl Cons
impl Cons
unsafe fn new_unchecked( car: Gc<ObjectType<'_>>, cdr: Gc<ObjectType<'_>>, ) -> ConsInner
Sourcepub(crate) fn new<'ob, T, Tx, U, Ux, const C: bool>(
car: T,
cdr: U,
cx: &'ob Block<C>,
) -> &'ob Selfwhere
T: IntoObject<Out<'ob> = Tx>,
Gc<Tx>: Into<Gc<ObjectType<'ob>>>,
U: IntoObject<Out<'ob> = Ux>,
Gc<Ux>: Into<Gc<ObjectType<'ob>>>,
pub(crate) fn new<'ob, T, Tx, U, Ux, const C: bool>(
car: T,
cdr: U,
cx: &'ob Block<C>,
) -> &'ob Selfwhere
T: IntoObject<Out<'ob> = Tx>,
Gc<Tx>: Into<Gc<ObjectType<'ob>>>,
U: IntoObject<Out<'ob> = Ux>,
Gc<Ux>: Into<Gc<ObjectType<'ob>>>,
Create a new cons cell
Sourcepub(crate) fn new1<'ob, T, Tx, const C: bool>(
car: T,
cx: &'ob Block<C>,
) -> &'ob Self
pub(crate) fn new1<'ob, T, Tx, const C: bool>( car: T, cx: &'ob Block<C>, ) -> &'ob Self
Create a new cons cell with the cdr set to nil
pub(super) fn mark_const(&mut self)
Trait Implementations§
Source§impl<'ob> IntoIterator for &'ob Cons
impl<'ob> IntoIterator for &'ob Cons
Source§impl IntoObject for Cons
impl IntoObject for Cons
Source§impl RootedDeref for Cons
impl RootedDeref for Cons
type Target = RootedCons
fn rooted_deref(rooted: &Rt<Self>) -> &Self::Target
fn rooted_derefmut(rooted: &mut Rt<Self>) -> &mut Self::Target
Source§impl TaggedPtr for &Cons
impl TaggedPtr for &Cons
Source§const TAG: Tag = Tag::Cons
const TAG: Tag = Tag::Cons
Tag value. This is only applicable to base values. Use Int for sum
types.
Source§type Ptr = Cons
type Ptr = Cons
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 Cons
impl<'old, 'new> WithLifetime<'new> for &'old Cons
impl Eq for Cons
impl GcPtr for &Cons
impl StructuralPartialEq for Cons
Auto Trait Implementations§
impl !Freeze for Cons
impl !RefUnwindSafe for Cons
impl Send for Cons
impl !Sync for Cons
impl Unpin for Cons
impl !UnwindSafe for Cons
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.