Struct bitcoins::types::script::WitnessStackItem [−][src]
pub struct WitnessStackItem(_);
Expand description
A WitnessStackItem is a marked Vec<u8>
intended for use in witnesses. Each
Witness is a PrefixVec<WitnessStackItem>
. The Transactions witnesses
is a non-prefixed
Vec<Witness>.
WitnessStackItem::null()
and WitnessStackItem::default()
return the empty byte vector
with a 0 prefix, which represents numerical 0, or null bytestring.
Implementations
Return a reference to the underlying bytes
Determine the byte-length of the vector length prefix
Trait Implementations
Returns the byte-length of the serialized data structure.
Deserializes an instance of Self
from a std::io::Read
.
The limit
argument is used only when deserializing collections, and specifies a maximum
number of instances of the underlying type to read. Read more
Serializes self
to a std::io::Write
. Following Write
trait conventions, its Ok
type must be a usize
denoting the number of bytes written. Read more
fn read_seq_from<R>(
reader: &mut R,
mode: ReadSeqMode
) -> Result<Vec<Self, Global>, Self::Error> where
R: Read,
fn read_seq_from<R>(
reader: &mut R,
mode: ReadSeqMode
) -> Result<Vec<Self, Global>, Self::Error> where
R: Read,
Read a sequence of exactly limit
objects from the reader.
Write a sequence of ByteFormat
objects to a writer. The iter
argument may be any object that implements
IntoIterator<Item = &Item>
. This means we can seamlessly use vectors,
slices, etc. Read more
Decodes a hex string to a Vec<u8>
, deserializes an instance of Self
from that vector.
Serialize self
to a base64 string, using standard RFC4648 non-url safe characters
Serializes self
to a vector, returns the hex-encoded vector
Serialize self
to a base64 string, using standard RFC4648 non-url safe characters
Returns the “default value” for a type. Read more
fn deserialize<D>(deserializer: D) -> Result<WitnessStackItem, D::Error> where
D: Deserializer<'de>,
fn deserialize<D>(deserializer: D) -> Result<WitnessStackItem, D::Error> where
D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Extends a collection with the contents of an iterator. Read more
extend_one
)Extends a collection with exactly one element.
extend_one
)Reserves capacity in a collection for the given number of additional elements. Read more
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
Performs the conversion.
This method tests for self
and other
values to be equal, and is used
by ==
. Read more
This method tests for !=
.
This method returns an ordering between self
and other
values if one exists. Read more
This method tests less than (for self
and other
) and is used by the <
operator. Read more
This method tests less than or equal to (for self
and other
) and is used by the <=
operator. Read more
This method tests greater than (for self
and other
) and is used by the >
operator. Read more
Auto Trait Implementations
impl RefUnwindSafe for WitnessStackItem
impl Send for WitnessStackItem
impl Sync for WitnessStackItem
impl Unpin for WitnessStackItem
impl UnwindSafe for WitnessStackItem
Blanket Implementations
Calculate the base32 serialized length
Mutably borrows from an owned value. Read more
pub fn write_base32<W>(
&self,
writer: &mut W
) -> Result<(), <W as WriteBase32>::Err> where
W: WriteBase32,
pub fn write_base32<W>(
&self,
writer: &mut W
) -> Result<(), <W as WriteBase32>::Err> where
W: WriteBase32,
Encode as base32 and write it to the supplied writer Implementations shouldn’t allocate. Read more