Struct starlark::environment::FrozenModule
source · [−]pub struct FrozenModule { /* private fields */ }
Expand description
The result of freezing a Module
, making it and its contained values immutable.
The values of this FrozenModule
are stored on a frozen heap, a reference to which
can be obtained using frozen_heap
. Be careful not to use
these values after the FrozenModule
has been released unless you obtain a reference
to the frozen heap.
Implementations
sourceimpl FrozenModule
impl FrozenModule
sourcepub fn dump_debug(&self) -> String
pub fn dump_debug(&self) -> String
Print a lot of module internals for debugging.
sourceimpl FrozenModule
impl FrozenModule
sourcepub fn get(&self, name: &str) -> Option<OwnedFrozenValue>
pub fn get(&self, name: &str) -> Option<OwnedFrozenValue>
Get the value of the exported variable name
.
Returns None
if the variable isn’t defined in the module or it is private.
sourcepub fn names(&self) -> impl Iterator<Item = &str>
pub fn names(&self) -> impl Iterator<Item = &str>
Iterate through all the names defined in this module.
sourcepub fn frozen_heap(&self) -> &FrozenHeapRef
pub fn frozen_heap(&self) -> &FrozenHeapRef
Obtain the FrozenHeapRef
which owns the storage of all values defined in this module.
sourcepub fn documentation(&self) -> Option<DocItem>
pub fn documentation(&self) -> Option<DocItem>
Fetch the documentation for the module.
sourcepub fn module_documentation(&self) -> ModuleDocs
pub fn module_documentation(&self) -> ModuleDocs
The documentation for the module, and all of its top level values
Returns (
Trait Implementations
sourceimpl Clone for FrozenModule
impl Clone for FrozenModule
sourcefn clone(&self) -> FrozenModule
fn clone(&self) -> FrozenModule
Returns a copy of the value. Read more
1.0.0 · sourcefn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
sourceimpl Debug for FrozenModule
impl Debug for FrozenModule
sourceimpl Dupe for FrozenModule
impl Dupe for FrozenModule
Auto Trait Implementations
impl !RefUnwindSafe for FrozenModule
impl Send for FrozenModule
impl Sync for FrozenModule
impl Unpin for FrozenModule
impl !UnwindSafe for FrozenModule
Blanket Implementations
sourceimpl<T> AsARef<T> for T where
T: ?Sized,
impl<T> AsARef<T> for T where
T: ?Sized,
sourcefn try_as_aref(this: &T) -> Result<ARef<'_, T>, BorrowError>
fn try_as_aref(this: &T) -> Result<ARef<'_, T>, BorrowError>
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more