Struct bc::WitnessProgram
source · pub struct WitnessProgram { /* private fields */ }
Expand description
Witness program as defined in BIP141.
Implementations§
source§impl WitnessProgram
impl WitnessProgram
sourcepub fn new(version: WitnessVer, program: Vec<u8>) -> Result<Self, SegwitError>
pub fn new(version: WitnessVer, program: Vec<u8>) -> Result<Self, SegwitError>
Creates a new witness program.
sourcepub fn version(&self) -> WitnessVer
pub fn version(&self) -> WitnessVer
Returns the witness program version.
Trait Implementations§
source§impl Clone for WitnessProgram
impl Clone for WitnessProgram
source§fn clone(&self) -> WitnessProgram
fn clone(&self) -> WitnessProgram
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 Debug for WitnessProgram
impl Debug for WitnessProgram
source§impl Hash for WitnessProgram
impl Hash for WitnessProgram
source§impl Ord for WitnessProgram
impl Ord for WitnessProgram
source§fn cmp(&self, other: &WitnessProgram) -> Ordering
fn cmp(&self, other: &WitnessProgram) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
source§impl PartialEq for WitnessProgram
impl PartialEq for WitnessProgram
source§fn eq(&self, other: &WitnessProgram) -> bool
fn eq(&self, other: &WitnessProgram) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for WitnessProgram
impl PartialOrd for WitnessProgram
source§fn partial_cmp(&self, other: &WitnessProgram) -> Option<Ordering>
fn partial_cmp(&self, other: &WitnessProgram) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl StrictDecode for WitnessProgram
impl StrictDecode for WitnessProgram
fn strict_decode(reader: &mut impl TypedRead) -> Result<Self, DecodeError>
fn strict_read(lim: usize, reader: impl Read) -> Result<Self, DecodeError>
source§impl StrictDumb for WitnessProgram
impl StrictDumb for WitnessProgram
fn strict_dumb() -> Self
source§impl StrictEncode for WitnessProgram
impl StrictEncode for WitnessProgram
fn strict_encode<W: TypedWrite>(&self, writer: W) -> Result<W>
fn strict_write(&self, lim: usize, writer: impl Write) -> Result<usize, Error>
source§impl StrictStruct for WitnessProgram
impl StrictStruct for WitnessProgram
const ALL_FIELDS: &'static [&'static str] = _
fn strict_check_fields()
fn strict_type_info() -> TypeInfo<Self>
source§impl StrictType for WitnessProgram
impl StrictType for WitnessProgram
const STRICT_LIB_NAME: &'static str = LIB_NAME_BITCOIN
fn strict_name() -> Option<TypeName>
impl Eq for WitnessProgram
impl StrictProduct for WitnessProgram
impl StructuralEq for WitnessProgram
impl StructuralPartialEq for WitnessProgram
Auto Trait Implementations§
impl RefUnwindSafe for WitnessProgram
impl Send for WitnessProgram
impl Sync for WitnessProgram
impl Unpin for WitnessProgram
impl UnwindSafe for WitnessProgram
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
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.