Struct preserves_schema::compiler::context::ModuleContext

source ·
pub struct ModuleContext<'m, 'b> {
    pub bundle: &'m mut BundleContext<'b>,
    pub module_path: ModulePath,
    pub schema: &'m Schema,
    pub typedefs: Vec<Item>,
    pub functiondefs: Vec<Item>,
    pub mode: ModuleContextMode,
}

Fields§

§bundle: &'m mut BundleContext<'b>§module_path: ModulePath§schema: &'m Schema§typedefs: Vec<Item>§functiondefs: Vec<Item>§mode: ModuleContextMode

Implementations§

source§

impl<'m, 'b> ModuleContext<'m, 'b>

source

pub fn new( bundle: &'m mut BundleContext<'b>, module_path: &ModulePath, schema: &'m Schema, mode: ModuleContextMode ) -> Self

source

pub fn any_type(&self) -> &'static str

source

pub fn reset_mode(&mut self)

source

pub fn define_literal(&mut self, v: &IOValue) -> String

source

pub fn define_type(&mut self, i: Item)

source

pub fn define_function<F: FnOnce(FunctionContext<'_, '_, '_>) -> Item>( &mut self, error_context: &str, f: F )

source

pub fn render_ref(&self, r: &Ref, style: RefRenderStyle) -> Item

source

pub fn ref_has_embedded(&self, r: &Ref) -> bool

source

pub fn parse_unparse_generic_decls(&self, ty: &TDefinition) -> Item

source

pub fn extract(&mut self) -> Vec<Item>

Auto Trait Implementations§

§

impl<'m, 'b> Freeze for ModuleContext<'m, 'b>

§

impl<'m, 'b> !RefUnwindSafe for ModuleContext<'m, 'b>

§

impl<'m, 'b> !Send for ModuleContext<'m, 'b>

§

impl<'m, 'b> !Sync for ModuleContext<'m, 'b>

§

impl<'m, 'b> Unpin for ModuleContext<'m, 'b>

§

impl<'m, 'b> !UnwindSafe for ModuleContext<'m, 'b>

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<L, N> Codec<N> for L
where N: NestedValue,

source§

fn parse<'a, T>(&'a self, value: &N) -> Result<T, ParseError>
where T: Parse<&'a L, N>,

Delegates to T::parse, using self as language and the given value as input.
source§

fn unparse<'a, T>(&'a self, value: &T) -> N
where T: Unparse<&'a L, N>,

Delegates to value.unparse, using self as language.
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>,

§

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.