pub struct ClosureCore<N: Network, Instruction: InstructionTrait<N>> { /* private fields */ }
Implementations§
Source§impl<N: Network, Instruction: InstructionTrait<N>> ClosureCore<N, Instruction>
impl<N: Network, Instruction: InstructionTrait<N>> ClosureCore<N, Instruction>
Sourcepub fn new(name: Identifier<N>) -> Self
pub fn new(name: Identifier<N>) -> Self
Initializes a new closure with the given name.
Sourcepub const fn name(&self) -> &Identifier<N>
pub const fn name(&self) -> &Identifier<N>
Returns the name of the closure.
Sourcepub fn instructions(&self) -> &[Instruction]
pub fn instructions(&self) -> &[Instruction]
Returns the closure instructions.
Source§impl<N: Network, Instruction: InstructionTrait<N>> ClosureCore<N, Instruction>
impl<N: Network, Instruction: InstructionTrait<N>> ClosureCore<N, Instruction>
Sourcepub fn add_instruction(&mut self, instruction: Instruction) -> Result<()>
pub fn add_instruction(&mut self, instruction: Instruction) -> Result<()>
Adds the given instruction to the closure.
§Errors
This method will halt if there are output statements already. This method will halt if the maximum number of instructions has been reached.
Trait Implementations§
Source§impl<N: Clone + Network, Instruction: Clone + InstructionTrait<N>> Clone for ClosureCore<N, Instruction>
impl<N: Clone + Network, Instruction: Clone + InstructionTrait<N>> Clone for ClosureCore<N, Instruction>
Source§fn clone(&self) -> ClosureCore<N, Instruction>
fn clone(&self) -> ClosureCore<N, Instruction>
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>> Debug for ClosureCore<N, Instruction>
impl<N: Network, Instruction: InstructionTrait<N>> Debug for ClosureCore<N, Instruction>
Source§impl<N: Network, Instruction: InstructionTrait<N>> Display for ClosureCore<N, Instruction>
impl<N: Network, Instruction: InstructionTrait<N>> Display for ClosureCore<N, Instruction>
Source§impl<N: Network, Instruction: InstructionTrait<N>> FromBytes for ClosureCore<N, Instruction>
impl<N: Network, Instruction: InstructionTrait<N>> FromBytes for ClosureCore<N, Instruction>
Source§impl<N: Network, Instruction: InstructionTrait<N>> FromStr for ClosureCore<N, Instruction>
impl<N: Network, Instruction: InstructionTrait<N>> FromStr for ClosureCore<N, Instruction>
Source§impl<N: Network, Instruction: InstructionTrait<N>> Parser for ClosureCore<N, Instruction>
impl<N: Network, Instruction: InstructionTrait<N>> Parser for ClosureCore<N, Instruction>
Source§fn parse(string: &str) -> ParserResult<'_, Self>
fn parse(string: &str) -> ParserResult<'_, Self>
Parses a string into a closure.
Source§impl<N: PartialEq + Network, Instruction: PartialEq + InstructionTrait<N>> PartialEq for ClosureCore<N, Instruction>
impl<N: PartialEq + Network, Instruction: PartialEq + InstructionTrait<N>> PartialEq for ClosureCore<N, Instruction>
Source§impl<N: Network, Instruction: InstructionTrait<N>> ToBytes for ClosureCore<N, Instruction>
impl<N: Network, Instruction: InstructionTrait<N>> ToBytes for ClosureCore<N, Instruction>
Source§impl<N: Network, Instruction: InstructionTrait<N>> TypeName for ClosureCore<N, Instruction>
impl<N: Network, Instruction: InstructionTrait<N>> TypeName for ClosureCore<N, Instruction>
impl<N: Eq + Network, Instruction: Eq + InstructionTrait<N>> Eq for ClosureCore<N, Instruction>
impl<N: Network, Instruction: InstructionTrait<N>> StructuralPartialEq for ClosureCore<N, Instruction>
Auto Trait Implementations§
impl<N, Instruction> Freeze for ClosureCore<N, Instruction>
impl<N, Instruction> RefUnwindSafe for ClosureCore<N, Instruction>where
<N as Environment>::Field: RefUnwindSafe,
Instruction: RefUnwindSafe,
<N as Environment>::Projective: RefUnwindSafe,
<N as Environment>::Scalar: RefUnwindSafe,
N: RefUnwindSafe,
impl<N, Instruction> Send for ClosureCore<N, Instruction>where
Instruction: Send,
impl<N, Instruction> Sync for ClosureCore<N, Instruction>where
Instruction: Sync,
impl<N, Instruction> Unpin for ClosureCore<N, Instruction>where
<N as Environment>::Field: Unpin,
Instruction: Unpin,
<N as Environment>::Projective: Unpin,
<N as Environment>::Scalar: Unpin,
N: Unpin,
impl<N, Instruction> UnwindSafe for ClosureCore<N, Instruction>where
<N as Environment>::Field: UnwindSafe,
Instruction: 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