pub struct FunctionCore<N: Network, Instruction: InstructionTrait<N>, Command: CommandTrait<N>> { /* private fields */ }
Implementations§
Source§impl<N: Network, Instruction: InstructionTrait<N>, Command: CommandTrait<N>> FunctionCore<N, Instruction, Command>
impl<N: Network, Instruction: InstructionTrait<N>, Command: CommandTrait<N>> FunctionCore<N, Instruction, Command>
Sourcepub fn new(name: Identifier<N>) -> Self
pub fn new(name: Identifier<N>) -> Self
Initializes a new function with the given name.
Sourcepub const fn name(&self) -> &Identifier<N>
pub const fn name(&self) -> &Identifier<N>
Returns the name of the function.
Sourcepub fn input_types(&self) -> Vec<ValueType<N>>
pub fn input_types(&self) -> Vec<ValueType<N>>
Returns the function input types.
Sourcepub fn input_variants(&self) -> Vec<Variant>
pub fn input_variants(&self) -> Vec<Variant>
Returns the function input type variants.
Sourcepub fn instructions(&self) -> &[Instruction]
pub fn instructions(&self) -> &[Instruction]
Returns the function instructions.
Sourcepub fn output_types(&self) -> Vec<ValueType<N>>
pub fn output_types(&self) -> Vec<ValueType<N>>
Returns the function output types.
Sourcepub fn output_variants(&self) -> Vec<Variant>
pub fn output_variants(&self) -> Vec<Variant>
Returns the function output type variants.
Sourcepub const fn finalize_logic(&self) -> Option<&FinalizeCore<N, Command>>
pub const fn finalize_logic(&self) -> Option<&FinalizeCore<N, Command>>
Returns the function finalize logic.
Source§impl<N: Network, Instruction: InstructionTrait<N>, Command: CommandTrait<N>> FunctionCore<N, Instruction, Command>
impl<N: Network, Instruction: InstructionTrait<N>, Command: CommandTrait<N>> FunctionCore<N, Instruction, Command>
Sourcepub fn add_instruction(&mut self, instruction: Instruction) -> Result<()>
pub fn add_instruction(&mut self, instruction: Instruction) -> Result<()>
Adds the given instruction to the function.
§Errors
This method will halt if there are output statements already. This method will halt if the maximum number of instructions has been reached. This method will halt if a finalize logic has been added.
Trait Implementations§
Source§impl<N: Clone + Network, Instruction: Clone + InstructionTrait<N>, Command: Clone + CommandTrait<N>> Clone for FunctionCore<N, Instruction, Command>
impl<N: Clone + Network, Instruction: Clone + InstructionTrait<N>, Command: Clone + CommandTrait<N>> Clone for FunctionCore<N, Instruction, Command>
Source§fn clone(&self) -> FunctionCore<N, Instruction, Command>
fn clone(&self) -> FunctionCore<N, Instruction, Command>
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl<N: Network, Instruction: InstructionTrait<N>, Command: CommandTrait<N>> Debug for FunctionCore<N, Instruction, Command>
impl<N: Network, Instruction: InstructionTrait<N>, Command: CommandTrait<N>> Debug for FunctionCore<N, Instruction, Command>
Source§impl<N: Network, Instruction: InstructionTrait<N>, Command: CommandTrait<N>> Display for FunctionCore<N, Instruction, Command>
impl<N: Network, Instruction: InstructionTrait<N>, Command: CommandTrait<N>> Display for FunctionCore<N, Instruction, Command>
Source§impl<N: Network, Instruction: InstructionTrait<N>, Command: CommandTrait<N>> FromBytes for FunctionCore<N, Instruction, Command>
impl<N: Network, Instruction: InstructionTrait<N>, Command: CommandTrait<N>> FromBytes for FunctionCore<N, Instruction, Command>
Source§impl<N: Network, Instruction: InstructionTrait<N>, Command: CommandTrait<N>> FromStr for FunctionCore<N, Instruction, Command>
impl<N: Network, Instruction: InstructionTrait<N>, Command: CommandTrait<N>> FromStr for FunctionCore<N, Instruction, Command>
Source§impl<N: Network, Instruction: InstructionTrait<N>, Command: CommandTrait<N>> Parser for FunctionCore<N, Instruction, Command>
impl<N: Network, Instruction: InstructionTrait<N>, Command: CommandTrait<N>> Parser for FunctionCore<N, Instruction, Command>
Source§fn parse(string: &str) -> ParserResult<'_, Self>
fn parse(string: &str) -> ParserResult<'_, Self>
Parses a string into a function.
Source§impl<N: PartialEq + Network, Instruction: PartialEq + InstructionTrait<N>, Command: PartialEq + CommandTrait<N>> PartialEq for FunctionCore<N, Instruction, Command>
impl<N: PartialEq + Network, Instruction: PartialEq + InstructionTrait<N>, Command: PartialEq + CommandTrait<N>> PartialEq for FunctionCore<N, Instruction, Command>
Source§fn eq(&self, other: &FunctionCore<N, Instruction, Command>) -> bool
fn eq(&self, other: &FunctionCore<N, Instruction, Command>) -> bool
Tests for
self
and other
values to be equal, and is used by ==
.Source§impl<N: Network, Instruction: InstructionTrait<N>, Command: CommandTrait<N>> ToBytes for FunctionCore<N, Instruction, Command>
impl<N: Network, Instruction: InstructionTrait<N>, Command: CommandTrait<N>> ToBytes for FunctionCore<N, Instruction, Command>
Source§impl<N: Network, Instruction: InstructionTrait<N>, Command: CommandTrait<N>> TypeName for FunctionCore<N, Instruction, Command>
impl<N: Network, Instruction: InstructionTrait<N>, Command: CommandTrait<N>> TypeName for FunctionCore<N, Instruction, Command>
impl<N: Eq + Network, Instruction: Eq + InstructionTrait<N>, Command: Eq + CommandTrait<N>> Eq for FunctionCore<N, Instruction, Command>
impl<N: Network, Instruction: InstructionTrait<N>, Command: CommandTrait<N>> StructuralPartialEq for FunctionCore<N, Instruction, Command>
Auto Trait Implementations§
impl<N, Instruction, Command> Freeze for FunctionCore<N, Instruction, Command>
impl<N, Instruction, Command> RefUnwindSafe for FunctionCore<N, Instruction, Command>where
<N as Environment>::Field: RefUnwindSafe,
Instruction: RefUnwindSafe,
Command: RefUnwindSafe,
<N as Environment>::Projective: RefUnwindSafe,
<N as Environment>::Scalar: RefUnwindSafe,
N: RefUnwindSafe,
impl<N, Instruction, Command> Send for FunctionCore<N, Instruction, Command>
impl<N, Instruction, Command> Sync for FunctionCore<N, Instruction, Command>
impl<N, Instruction, Command> Unpin for FunctionCore<N, Instruction, Command>where
<N as Environment>::Field: Unpin,
Instruction: Unpin,
Command: Unpin,
<N as Environment>::Projective: Unpin,
<N as Environment>::Scalar: Unpin,
N: Unpin,
impl<N, Instruction, Command> UnwindSafe for FunctionCore<N, Instruction, Command>where
<N as Environment>::Field: UnwindSafe,
Instruction: UnwindSafe,
Command: UnwindSafe,
<N as Environment>::Projective: UnwindSafe,
<N as Environment>::Scalar: UnwindSafe,
N: UnwindSafe,
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
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