pub struct RegisterTypes<N>where
N: Network,{ /* private fields */ }Implementations§
Source§impl<N> RegisterTypes<N>where
N: Network,
impl<N> RegisterTypes<N>where
N: Network,
Sourcepub fn matches_struct(
&self,
stack: &(impl StackMatches<N> + StackProgram<N>),
operands: &[Operand<N>],
struct_: &StructType<N>,
) -> Result<(), Error>
pub fn matches_struct( &self, stack: &(impl StackMatches<N> + StackProgram<N>), operands: &[Operand<N>], struct_: &StructType<N>, ) -> Result<(), Error>
Checks that the given operands matches the layout of the struct. The ordering of the operands matters.
Sourcepub fn matches_array(
&self,
stack: &(impl StackMatches<N> + StackProgram<N>),
operands: &[Operand<N>],
array_type: &ArrayType<N>,
) -> Result<(), Error>
pub fn matches_array( &self, stack: &(impl StackMatches<N> + StackProgram<N>), operands: &[Operand<N>], array_type: &ArrayType<N>, ) -> Result<(), Error>
Checks that the given operands matches the layout of the array.
Sourcepub fn matches_record(
&self,
stack: &(impl StackMatches<N> + StackProgram<N>),
operands: &[Operand<N>],
record_type: &RecordType<N>,
) -> Result<(), Error>
pub fn matches_record( &self, stack: &(impl StackMatches<N> + StackProgram<N>), operands: &[Operand<N>], record_type: &RecordType<N>, ) -> Result<(), Error>
Checks that the given record matches the layout of the record type.
Source§impl<N> RegisterTypes<N>where
N: Network,
impl<N> RegisterTypes<N>where
N: Network,
Sourcepub fn from_closure(
stack: &(impl StackMatches<N> + StackProgram<N>),
closure: &ClosureCore<N, Instruction<N>>,
) -> Result<RegisterTypes<N>, Error>
pub fn from_closure( stack: &(impl StackMatches<N> + StackProgram<N>), closure: &ClosureCore<N, Instruction<N>>, ) -> Result<RegisterTypes<N>, Error>
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: &(impl StackMatches<N> + StackProgram<N>),
function: &FunctionCore<N, Instruction<N>, Command<N>>,
) -> Result<RegisterTypes<N>, Error>
pub fn from_function( stack: &(impl StackMatches<N> + StackProgram<N>), function: &FunctionCore<N, Instruction<N>, Command<N>>, ) -> Result<RegisterTypes<N>, Error>
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 StackMatches<N> + StackProgram<N>),
operand: &Operand<N>,
) -> Result<RegisterType<N>, Error>
pub fn get_type_from_operand( &self, stack: &(impl StackMatches<N> + StackProgram<N>), operand: &Operand<N>, ) -> Result<RegisterType<N>, Error>
Returns the register type of the given operand.
Sourcepub fn get_type(
&self,
stack: &(impl StackMatches<N> + StackProgram<N>),
register: &Register<N>,
) -> Result<RegisterType<N>, Error>
pub fn get_type( &self, stack: &(impl StackMatches<N> + StackProgram<N>), register: &Register<N>, ) -> Result<RegisterType<N>, Error>
Returns the register type of the given register.
Trait Implementations§
Source§impl<N> Clone for RegisterTypes<N>
impl<N> 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 for RegisterTypes<N>
impl<N> Default for RegisterTypes<N>
Source§fn default() -> RegisterTypes<N>
fn default() -> RegisterTypes<N>
Returns the “default value” for a type. Read more
Source§impl<N> PartialEq for RegisterTypes<N>
impl<N> PartialEq for RegisterTypes<N>
impl<N> Eq for RegisterTypes<N>
impl<N> StructuralPartialEq for RegisterTypes<N>where
N: Network,
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§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> 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