Struct gluon_base::ast::ArenaRef

source ·
pub struct ArenaRef<'a, 'ast, Id>(/* private fields */);

Implementations§

source§

impl<'a, 'ast, Id> ArenaRef<'a, 'ast, Id>

source

pub fn alloc<T>(self, value: T) -> &'ast mut T
where T: AstAlloc<'ast, Id> + 'ast,

source

pub fn alloc_extend<T>(self, iter: impl IntoIterator<Item = T>) -> &'ast mut [T]
where T: AstAlloc<'ast, Id> + 'ast,

Trait Implementations§

source§

impl<'a, 'ast, Id> Clone for ArenaRef<'a, 'ast, Id>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'ast, Id> TypeContext<Id, AstType<'ast, Id>> for ArenaRef<'_, 'ast, Id>

source§

fn intern(&mut self, typ: Type<Id, AstType<'ast, Id>>) -> AstType<'ast, Id>

source§

fn intern_types( &mut self, types: impl IntoIterator<Item = AstType<'ast, Id>> ) -> &'ast mut [AstType<'ast, Id>]

source§

fn intern_generics( &mut self, types: impl IntoIterator<Item = Generic<Id>> ) -> &'ast mut [Generic<Id>]

source§

fn intern_fields( &mut self, types: impl IntoIterator<Item = Field<Spanned<Id, BytePos>, AstType<'ast, Id>>> ) -> &'ast mut [Field<Spanned<Id, BytePos>, AstType<'ast, Id>>]

source§

fn intern_type_fields( &mut self, types: impl IntoIterator<Item = Field<Spanned<Id, BytePos>, Alias<Id, AstType<'ast, Id>>>> ) -> &'ast mut [Field<Spanned<Id, BytePos>, Alias<Id, AstType<'ast, Id>>>]

source§

fn intern_flags( &mut self, typ: Type<Id, AstType<'ast, Id>>, _flags: Flags ) -> AstType<'ast, Id>

source§

fn hole(&mut self) -> T

source§

fn opaque(&mut self) -> T

source§

fn error(&mut self) -> T

source§

fn builtin(&mut self, typ: BuiltinType) -> T

source§

fn forall(&mut self, params: T::Generics, typ: T) -> T

source§

fn array(&mut self, typ: T) -> T

source§

fn array_builtin(&mut self) -> T

source§

fn app(&mut self, id: T, args: T::Types) -> T

source§

fn variant(&mut self, fields: T::Fields) -> T

source§

fn poly_variant(&mut self, fields: T::Fields, rest: T) -> T

source§

fn effect(&mut self, fields: T::Fields) -> T

source§

fn poly_effect(&mut self, fields: T::Fields, rest: T) -> T

source§

fn record(&mut self, types: T::TypeFields, fields: T::Fields) -> T

source§

fn poly_record(&mut self, types: T::TypeFields, fields: T::Fields, rest: T) -> T

source§

fn extend_full_row( &mut self, types: T::TypeFields, fields: T::Fields, rest: T ) -> T

source§

fn extend_row(&mut self, fields: T::Fields, rest: T) -> T

source§

fn extend_type_row(&mut self, types: T::TypeFields, rest: T) -> T

source§

fn empty_row(&mut self) -> T

source§

fn function<I>(&mut self, args: I, ret: T) -> T
where I: IntoIterator<Item = T>, I::IntoIter: DoubleEndedIterator<Item = T>,

source§

fn function_implicit<I>(&mut self, args: I, ret: T) -> T
where I: IntoIterator<Item = T>, I::IntoIter: DoubleEndedIterator<Item = T>,

source§

fn function_type<I>(&mut self, arg_type: ArgType, args: I, ret: T) -> T
where I: IntoIterator<Item = T>, I::IntoIter: DoubleEndedIterator<Item = T>,

source§

fn generic(&mut self, typ: Generic<Id>) -> T

source§

fn skolem(&mut self, typ: Skolem<Id>) -> T

source§

fn variable(&mut self, typ: TypeVariable) -> T

source§

fn alias(&mut self, name: Id, args: T::Generics, typ: T) -> T

source§

fn ident(&mut self, id: KindedIdent<Id>) -> T

source§

fn projection(&mut self, id: AppVec<Id>) -> T

source§

fn function_builtin(&mut self) -> T

source§

fn string(&mut self) -> T

source§

fn char(&mut self) -> T

source§

fn byte(&mut self) -> T

source§

fn int(&mut self) -> T

source§

fn float(&mut self) -> T

source§

fn unit(&mut self) -> T

source§

fn builtin_type(&mut self, typ: BuiltinType) -> T

source§

fn new_alias(&mut self, name: Id, args: T::Generics, typ: T) -> Alias<Id, T>

source§

fn new_data_alias(&mut self, data: AliasData<Id, T>) -> Alias<Id, T>

source§

impl<'a, 'ast, Id> Copy for ArenaRef<'a, 'ast, Id>

Auto Trait Implementations§

§

impl<'a, 'ast, Id> !RefUnwindSafe for ArenaRef<'a, 'ast, Id>

§

impl<'a, 'ast, Id> !Send for ArenaRef<'a, 'ast, Id>

§

impl<'a, 'ast, Id> !Sync for ArenaRef<'a, 'ast, Id>

§

impl<'a, 'ast, Id> Unpin for ArenaRef<'a, 'ast, Id>

§

impl<'a, 'ast, Id> !UnwindSafe for ArenaRef<'a, 'ast, Id>

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<Id> AsId<Id> for Id
where Id: ?Sized,

source§

fn as_id(&self) -> &Id

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> ToOwned for T
where T: Clone,

§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

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

§

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>,

§

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<T> Any for T
where T: Any,

§

impl<T> CloneAny for T
where T: Any + Clone,