pub struct WitnessValues(/* private fields */);
Expand description
Map of witness values.
Implementations§
Source§impl WitnessValues
impl WitnessValues
pub fn analyze(from: &ModuleProgram) -> Result<Self, RichError>
Source§impl WitnessValues
impl WitnessValues
Sourcepub fn get(&self, name: &WitnessName) -> Option<&Value>
pub fn get(&self, name: &WitnessName) -> Option<&Value>
Get the value that is assigned to the given name.
Sourcepub fn iter(&self) -> impl Iterator<Item = (&WitnessName, &Value)>
pub fn iter(&self) -> impl Iterator<Item = (&WitnessName, &Value)>
Create an iterator over all name-value pairs.
Sourcepub fn shallow_clone(&self) -> Self
pub fn shallow_clone(&self) -> Self
Make a cheap copy of the map.
Source§impl WitnessValues
impl WitnessValues
Sourcepub fn is_consistent(&self, witness_types: &WitnessTypes) -> Result<(), Error>
pub fn is_consistent(&self, witness_types: &WitnessTypes) -> Result<(), Error>
Check if the witness values are consistent with the declared witness types.
- Values that occur in the program are type checked.
- Values that don’t occur in the program are skipped. The witness map may contain more values than necessary.
There may be witnesses that are referenced in the program that are not assigned a value in the witness map. These witnesses may lie on pruned branches that will not be part of the finalized Simplicity program. However, before the finalization, we cannot know which witnesses will be pruned and which won’t be pruned. This check skips unassigned witnesses.
Trait Implementations§
Source§impl Clone for WitnessValues
impl Clone for WitnessValues
Source§fn clone(&self) -> WitnessValues
fn clone(&self) -> WitnessValues
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 Debug for WitnessValues
impl Debug for WitnessValues
Source§impl Default for WitnessValues
impl Default for WitnessValues
Source§fn default() -> WitnessValues
fn default() -> WitnessValues
Returns the “default value” for a type. Read more
Source§impl Display for WitnessValues
impl Display for WitnessValues
Source§impl From<HashMap<WitnessName, Value>> for WitnessValues
impl From<HashMap<WitnessName, Value>> for WitnessValues
Source§impl ParseFromStr for WitnessValues
impl ParseFromStr for WitnessValues
Source§impl PartialEq for WitnessValues
impl PartialEq for WitnessValues
impl Eq for WitnessValues
impl StructuralPartialEq for WitnessValues
Auto Trait Implementations§
impl Freeze for WitnessValues
impl RefUnwindSafe for WitnessValues
impl Send for WitnessValues
impl Sync for WitnessValues
impl Unpin for WitnessValues
impl UnwindSafe for WitnessValues
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