pub struct RegisterTypes<N: Network> { /* private fields */ }Implementations§
Source§impl<N: Network> RegisterTypes<N>
impl<N: Network> RegisterTypes<N>
Sourcepub fn matches_struct(
&self,
stack: &Stack<N>,
operands: &[Operand<N>],
struct_: &StructType<N>,
) -> Result<()>
pub fn matches_struct( &self, stack: &Stack<N>, operands: &[Operand<N>], struct_: &StructType<N>, ) -> Result<()>
Checks that the given operands matches the layout of the struct. The ordering of the operands matters.
Sourcepub fn matches_array(
&self,
stack: &Stack<N>,
operands: &[Operand<N>],
array_type: &ArrayType<N>,
) -> Result<()>
pub fn matches_array( &self, stack: &Stack<N>, operands: &[Operand<N>], array_type: &ArrayType<N>, ) -> Result<()>
Checks that the given operands matches the layout of the array.
Sourcepub fn matches_record(
&self,
stack: &Stack<N>,
operands: &[Operand<N>],
record_type: &RecordType<N>,
) -> Result<()>
pub fn matches_record( &self, stack: &Stack<N>, operands: &[Operand<N>], record_type: &RecordType<N>, ) -> Result<()>
Checks that the given record matches the layout of the record type.
Source§impl<N: Network> RegisterTypes<N>
impl<N: Network> RegisterTypes<N>
Sourcepub fn from_closure(stack: &Stack<N>, closure: &Closure<N>) -> Result<Self>
pub fn from_closure(stack: &Stack<N>, closure: &Closure<N>) -> Result<Self>
Initializes a new instance of RegisterTypes for the given closure.
Checks that the given closure is well-formed for the given stack.
Sourcepub fn from_function(stack: &Stack<N>, function: &Function<N>) -> Result<Self>
pub fn from_function(stack: &Stack<N>, function: &Function<N>) -> Result<Self>
Initializes a new instance of RegisterTypes for the given function.
Checks that the given function is well-formed for the given stack.
Sourcepub fn contains(&self, register: &Register<N>) -> bool
pub fn contains(&self, register: &Register<N>) -> bool
Returns true if the given register exists.
Sourcepub fn is_input(&self, register: &Register<N>) -> bool
pub fn is_input(&self, register: &Register<N>) -> bool
Returns true if the given register corresponds to an input register.
Sourcepub fn get_type_from_operand(
&self,
stack: &impl StackTrait<N>,
operand: &Operand<N>,
) -> Result<RegisterType<N>>
pub fn get_type_from_operand( &self, stack: &impl StackTrait<N>, operand: &Operand<N>, ) -> Result<RegisterType<N>>
Returns the register type of the given operand.
Sourcepub fn get_type(
&self,
stack: &impl StackTrait<N>,
register: &Register<N>,
) -> Result<RegisterType<N>>
pub fn get_type( &self, stack: &impl StackTrait<N>, register: &Register<N>, ) -> Result<RegisterType<N>>
Returns the register type of the given register.
Trait Implementations§
Source§impl<N: Clone + Network> Clone for RegisterTypes<N>
impl<N: Clone + Network> Clone for RegisterTypes<N>
Source§fn clone(&self) -> RegisterTypes<N>
fn clone(&self) -> RegisterTypes<N>
Returns a duplicate 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: Default + Network> Default for RegisterTypes<N>
impl<N: Default + Network> Default for RegisterTypes<N>
Source§fn default() -> RegisterTypes<N>
fn default() -> RegisterTypes<N>
Returns the “default value” for a type. Read more
impl<N: Eq + Network> Eq for RegisterTypes<N>
impl<N: Network> StructuralPartialEq for RegisterTypes<N>
Auto Trait Implementations§
impl<N> Freeze for RegisterTypes<N>
impl<N> RefUnwindSafe for RegisterTypes<N>
impl<N> Send for RegisterTypes<N>
impl<N> Sync for RegisterTypes<N>
impl<N> Unpin for RegisterTypes<N>
impl<N> UnwindSafe for RegisterTypes<N>
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§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<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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