Skip to main content

AstArena

Struct AstArena 

Source
pub struct AstArena { /* private fields */ }

Implementations§

Source§

impl AstArena

Source

pub fn new() -> Self

Source

pub fn alloc<T>(&self, value: T) -> &mut T

Source

pub fn alloc_node<T>(&self, value: T) -> &T

Source

pub fn alloc_attribute<'ast>( &'ast self, value: Attribute<'ast>, ) -> &'ast Attribute<'ast>

Source

pub fn alloc_function<'ast>( &'ast self, value: Function<'ast>, ) -> &'ast Function<'ast>

Source

pub fn alloc_generic_type<'ast>( &'ast self, value: GenericType<'ast>, ) -> &'ast GenericType<'ast>

Source

pub fn alloc_generic_type_pack<'ast>( &'ast self, value: GenericTypePack<'ast>, ) -> &'ast GenericTypePack<'ast>

Source

pub fn alloc_local<'ast>(&'ast self, value: Local<'ast>) -> &'ast Local<'ast>

Source

pub fn alloc_local_binding<'ast>( &'ast self, init: LocalInit<'ast>, ) -> &'ast Local<'ast>

Source

pub fn alloc_type<'ast>( &'ast self, location: Location, value: TypeKind<'ast>, ) -> Type<'ast>

Source

pub fn alloc_type_pack<'ast>( &'ast self, location: Location, value: TypePackKind<'ast>, ) -> TypePack<'ast>

Source

pub fn alloc_slice_fill_iter<T, I>(&self, values: I) -> &[T]
where I: IntoIterator<Item = T>, I::IntoIter: ExactSizeIterator,

Source

pub fn alloc_slice_copy<T: Copy>(&self, values: &[T]) -> &[T]

Source

pub fn alloc_bytes(&self, bytes: &[u8]) -> &[u8]

Source

pub fn alloc_ast_string<'ast>(&'ast self, bytes: &[u8]) -> AstString<'ast>

Source§

impl AstArena

Source

pub fn alloc_type_kind<'ast>( &'ast self, location: Location, kind: TypeKind<'ast>, ) -> Type<'ast>

Source

pub fn alloc_type_pack_kind<'ast>( &'ast self, location: Location, kind: TypePackKind<'ast>, ) -> TypePack<'ast>

Trait Implementations§

Source§

impl Debug for AstArena

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for AstArena

Source§

fn default() -> AstArena

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

Auto Trait Implementations§

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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.