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§

source§

impl FrozenModule

source

pub fn dump_debug(&self) -> String

Print a lot of module internals for debugging.

source§

impl FrozenModule

source

pub fn from_globals(globals: &Globals) -> Result<FrozenModule>

Convert items in globals into a FrozenModule. This function can be used to implement starlark module using the #[starlark_module] attribute.

This function does not return an error, but we prefer not to panic if there’s some high level logic error.

source

pub fn get_option(&self, name: &str) -> Result<Option<OwnedFrozenValue>>

Get the value of the exported variable name.

§Returns
  • None if symbol is not found
  • error if symbol is private
source

pub fn get(&self, name: &str) -> Result<OwnedFrozenValue>

Get the value of the exported variable name. Returns an error if the variable isn’t defined in the module or it is private.

source

pub fn names(&self) -> impl Iterator<Item = FrozenStringValue> + '_

Iterate through all the names defined in this module. Only includes symbols that are publicly exposed.

source

pub fn frozen_heap(&self) -> &FrozenHeapRef

Obtain the FrozenHeapRef which owns the storage of all values defined in this module.

source

pub fn describe(&self) -> String

Print out some approximation of the module definitions.

source

pub fn documentation(&self) -> DocModule

The documentation for the module, and all of its top level values

Returns (<module documentation>, { <symbol> : <that symbol's documentation> })

source

pub fn aggregated_heap_profile_info(&self) -> Result<&AggregateHeapProfileInfo>

Retained memory info, or error if not enabled.

source

pub fn heap_profile(&self) -> Result<ProfileData>

Retained memory info, or error if not enabled.

source

pub fn extra_value(&self) -> Option<FrozenValue>

extra_value field from Module, frozen.

source

pub fn owned_extra_value(&self) -> Option<OwnedFrozenValue>

extra_value field from Module, frozen.

Trait Implementations§

source§

impl Allocative for FrozenModule

source§

fn visit<'allocative_a, 'allocative_b: 'allocative_a>( &self, visitor: &'allocative_a mut Visitor<'allocative_b> )

source§

impl Clone for FrozenModule

source§

fn clone(&self) -> FrozenModule

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 FrozenModule

source§

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

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

impl Dupe for FrozenModule

source§

fn dupe(&self) -> Self

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> ToAst for T

source§

fn ast(self, begin: usize, end: usize) -> Spanned<Self>

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.