rune::core::gc::context

Struct Block

Source
pub(crate) struct Block<const CONST: bool> {
    pub(in core) objects: Bump,
    pub(in core) drop_stack: RefCell<Vec<DropStackElem>>,
    pub(in core) lisp_hashtables: RefCell<Vec<*const LispHashTable>>,
    pub(in core) uninterned_symbol_map: UninternedSymbolMap,
}
Expand description

A block of allocations. This type should be owned by Context and not used directly.

Fields§

§objects: Bump§drop_stack: RefCell<Vec<DropStackElem>>§lisp_hashtables: RefCell<Vec<*const LispHashTable>>§uninterned_symbol_map: UninternedSymbolMap

Implementations§

Source§

impl Block<true>

Source

pub(crate) fn new_global() -> Self

Source§

impl Block<false>

Source

pub(crate) fn new_local() -> Self

Source

pub(crate) fn new_local_unchecked() -> Self

Source

pub(crate) fn assert_unique()

Source§

impl<const CONST: bool> Block<CONST>

Source

pub(crate) fn add<'ob, T, Tx>(&'ob self, obj: T) -> Gc<ObjectType<'ob>>
where T: IntoObject<Out<'ob> = Tx>, Gc<Tx>: Into<Gc<ObjectType<'ob>>>,

Source

pub(crate) fn add_as<'ob, T, Tx, V>(&'ob self, obj: T) -> Gc<V>
where T: IntoObject<Out<'ob> = Tx>, Gc<Tx>: Into<Gc<V>>,

Source

pub(crate) fn string_with_capacity(&self, cap: usize) -> String<'_>

Create a new String whose backing storage is already part of the GC heap. Does not require dropping when moved during garbage collection (unlike std::string).

Source

pub(crate) fn vec_new(&self) -> GcVec<'_, Gc<ObjectType<'_>>>

Create a new Vec whose backing storage is already part of the GC heap. Does not require dropping when moved during garbage collection (unlike std::vec).

Source

pub(crate) fn vec_with_capacity( &self, cap: usize, ) -> GcVec<'_, Gc<ObjectType<'_>>>

Trait Implementations§

Source§

impl AsRef<Block<false>> for Context<'_>

Source§

fn as_ref(&self) -> &Block<false>

Converts this type into a shared reference of the (usually inferred) input type.
Source§

impl<const CONST: bool> Default for Block<CONST>

Source§

fn default() -> Block<CONST>

Returns the “default value” for a type. Read more
Source§

impl<const CONST: bool> Drop for Block<CONST>

Source§

fn drop(&mut self)

Executes the destructor for this type. Read more
Source§

impl<const C: bool> Send for Block<C>

Auto Trait Implementations§

§

impl<const CONST: bool> !Freeze for Block<CONST>

§

impl<const CONST: bool> !RefUnwindSafe for Block<CONST>

§

impl<const CONST: bool> !Sync for Block<CONST>

§

impl<const CONST: bool> Unpin for Block<CONST>

§

impl<const CONST: bool> !UnwindSafe for Block<CONST>

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

§

fn vzip(self) -> V

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.