pub struct Module<'a> { /* private fields */ }
Expand description
Top-level module definition in a jeff program.
Implementations§
Source§impl<'a> Module<'a>
impl<'a> Module<'a>
Sourcepub fn functions(&self) -> impl Iterator<Item = Function<'a>>
pub fn functions(&self) -> impl Iterator<Item = Function<'a>>
Returns an iterator over the functions defined in this module.
Sourcepub fn function_count(&self) -> usize
pub fn function_count(&self) -> usize
Returns the number of functions defined in this module.
Sourcepub fn function(&self, n: FunctionId) -> Function<'a>
pub fn function(&self, n: FunctionId) -> Function<'a>
Returns the n
-th function defined in this module.
§Panics
Panics if n
is equal or greater than Module::function_count
.
Sourcepub fn try_function(&self, n: FunctionId) -> Option<Function<'a>>
pub fn try_function(&self, n: FunctionId) -> Option<Function<'a>>
Returns the n
-th function defined in this module.
Sourcepub fn entrypoint_id(&self) -> FunctionId
pub fn entrypoint_id(&self) -> FunctionId
Returns the FunctionId of the entrypoint function for this module.
Sourcepub fn entrypoint(&self) -> Function<'a>
pub fn entrypoint(&self) -> Function<'a>
Returns the entrypoint function for this module.
§Panics
Panics if the entrypoint id in the jeff definition is out of range.
Sourcepub fn tool(&self) -> &str
pub fn tool(&self) -> &str
Returns the tool name used to generate this program.
See Module::tool_version
.
Sourcepub fn tool_version(&self) -> &str
pub fn tool_version(&self) -> &str
Returns the tool version used to generate this program.
See Module::tool
.
Trait Implementations§
impl<'a> Copy for Module<'a>
Auto Trait Implementations§
impl<'a> Freeze for Module<'a>
impl<'a> !RefUnwindSafe for Module<'a>
impl<'a> !Send for Module<'a>
impl<'a> !Sync for Module<'a>
impl<'a> Unpin for Module<'a>
impl<'a> !UnwindSafe for Module<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more