pub enum Function<'a> {
Definition(FunctionDefinition<'a>),
Declaration(FunctionDeclaration<'a>),
}Expand description
Function in a jeff module.
Variants§
Definition(FunctionDefinition<'a>)
Function definition with a body.
Declaration(FunctionDeclaration<'a>)
Function declaration with only a signature.
Implementations§
Source§impl<'a> Function<'a>
impl<'a> Function<'a>
Sourcepub fn name(&self) -> &str
pub fn name(&self) -> &str
Returns the name of this function.
§Panics
Panics if the function name index is out of bounds or not valid utf8.
Sourcepub fn input_types(
&self,
) -> impl Iterator<Item = Result<FunctionIOValue<'a>, ReadError>> + '_
pub fn input_types( &self, ) -> impl Iterator<Item = Result<FunctionIOValue<'a>, ReadError>> + '_
Returns the input types of this function.
Sourcepub fn output_types(
&self,
) -> impl Iterator<Item = Result<FunctionIOValue<'a>, ReadError>> + '_
pub fn output_types( &self, ) -> impl Iterator<Item = Result<FunctionIOValue<'a>, ReadError>> + '_
Returns the output types of this function.
Trait Implementations§
Auto Trait Implementations§
impl<'a> !RefUnwindSafe for Function<'a>
impl<'a> !Send for Function<'a>
impl<'a> !Sync for Function<'a>
impl<'a> !UnwindSafe for Function<'a>
impl<'a> Freeze for Function<'a>
impl<'a> Unpin for Function<'a>
impl<'a> UnsafeUnpin for Function<'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