Struct bean_script::modules::CustomModule

source ·
pub struct CustomModule {
    pub registry: MutRc<ModuleRegistry>,
    pub file_path: PathBuf,
    pub if_state: IfState,
    pub exported_functions: MutRc<HashMap<String, Function>>,
    pub submodules: MutRc<HashMap<String, MutRc<CustomModule>>>,
    /* private fields */
}

Fields§

§registry: MutRc<ModuleRegistry>§file_path: PathBuf§if_state: IfState§exported_functions: MutRc<HashMap<String, Function>>§submodules: MutRc<HashMap<String, MutRc<CustomModule>>>

Implementations§

source§

impl CustomModule

source

pub fn new(registry: MutRc<ModuleRegistry>, file_path: PathBuf) -> Self

Trait Implementations§

source§

impl Clone for CustomModule

source§

fn clone(&self) -> CustomModule

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 Debug for CustomModule

source§

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

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

impl Module for CustomModule

source§

fn get_submodule(&self, name: &str) -> Option<Rc<RefCell<dyn Module>>>

source§

fn has_pub_function(&self, name: &str) -> bool

source§

fn get_pub_function(&self, name: &str) -> Option<Function>

source§

impl Scope for CustomModule

source§

fn has_function(&self, name: &str) -> bool

source§

fn get_function(&self, name: &str) -> Option<Function>

source§

fn set_function(&mut self, name: &str, function: Function)

source§

fn delete_function(&mut self, name: &str)

source§

fn parent(&self) -> Option<ScopeRef>

source§

fn set_return_value(&mut self, _v: Data)

source§

fn get_function_list(&self) -> HashMap<String, Function>

source§

fn get_file_module(&self) -> Option<ScopeRef>

source§

fn as_any(&self) -> &dyn Any

source§

fn as_mut(&mut self) -> &mut dyn Any

source§

fn set_if_state(&mut self, state: IfState)

source§

fn get_call_scope(&self) -> Option<Rc<RefCell<CallScope>>>

source§

fn to_string(&self) -> String

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> 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.
source§

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

source§

fn vzip(self) -> V