[][src]Struct jlrs::value::module::Module

#[repr(transparent)]pub struct Module<'base>(_, _);

Functionality in Julia can be accessed through its module system. You can get a handle to the three standard modules, Main, Base, and Core and access their submodules through them. If you include your own Julia code with Julia::include, its contents are made available relative to Main.

This struct implements JuliaTypecheck and Cast. It can be used in combination with DataType::is and Value::is; if the check returns true the Value can be cast to Module.

Implementations

impl<'base> Module<'base>[src]

pub fn main(_: Global<'base>) -> Self[src]

Returns a handle to Julia's Main-module. If you include your own Julia code by calling Julia::include, handles to functions, globals, and submodules defined in these included files are available through this module.

pub fn core(_: Global<'base>) -> Self[src]

Returns a handle to Julia's Core-module.

pub fn base(_: Global<'base>) -> Self[src]

Returns a handle to Julia's Base-module.

pub fn submodule<N>(self, name: N) -> JlrsResult<Self> where
    N: TemporarySymbol
[src]

Returns the submodule named name relative to this module. You have to visit this level by level: you can't access Main.A.B by calling this function with "A.B", but have to access A first and then B.

Returns an error if the submodule doesn't exist.

pub fn global<N>(self, name: N) -> JlrsResult<Value<'base, 'static>> where
    N: TemporarySymbol
[src]

Returns the global named name in this module. Returns an error if the global doesn't exist.

pub fn function<N>(self, name: N) -> JlrsResult<Value<'base, 'static>> where
    N: TemporarySymbol
[src]

Returns the function named name in this module. Note that all globals defined within the module will be successfully resolved into a function; Julia will throw an exception if you try to call something that isn't a function. This means that this method is just an alias for Module::global.

Returns an error if th function doesn't exist.

Trait Implementations

impl<'frame, 'data> Cast<'frame, 'data> for Module<'frame>[src]

type Output = Self

impl<'base> Clone for Module<'base>[src]

impl<'base> Copy for Module<'base>[src]

impl<'frame> JuliaTypecheck for Module<'frame>[src]

Auto Trait Implementations

impl<'base> RefUnwindSafe for Module<'base>

impl<'base> !Send for Module<'base>

impl<'base> !Sync for Module<'base>

impl<'base> Unpin for Module<'base>

impl<'base> UnwindSafe for Module<'base>

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.