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

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.