pub struct Version(/* private fields */);Expand description
The transaction version.
Currently, as specified by BIP-0068 and BIP-0431, version 1, 2, and 3 are considered standard.
Standardness of the inner u32 is not an invariant because you are free to create transactions
of any version, transactions with non-standard version numbers will not be relayed by the
Bitcoin network.
Implementations§
Source§impl Version
impl Version
Sourcepub const fn maybe_non_standard(version: u32) -> Self
pub const fn maybe_non_standard(version: u32) -> Self
Constructs a potentially non-standard transaction version.
This can accept both standard and non-standard versions.
Sourcepub const fn is_standard(self) -> bool
pub const fn is_standard(self) -> bool
Returns true if this transaction version number is considered standard.
The behavior of this method matches whatever Bitcoin Core considers standard at the time of the release and may change in future versions to accommodate new standard versions. As of Bitcoin Core 28.0 (release notes), versions 1, 2, and 3 are considered standard.
Trait Implementations§
Source§impl<'a> Arbitrary<'a> for Version
Available on crate feature arbitrary only.
impl<'a> Arbitrary<'a> for Version
arbitrary only.Source§fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self>
Self from the given unstructured data. Read moreSource§fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
Self from the entirety of the given
unstructured data. Read moreSource§fn size_hint(depth: usize) -> (usize, Option<usize>)
fn size_hint(depth: usize) -> (usize, Option<usize>)
Unstructured this type
needs to construct itself. Read moreSource§fn try_size_hint(
depth: usize,
) -> Result<(usize, Option<usize>), MaxRecursionReached>
fn try_size_hint( depth: usize, ) -> Result<(usize, Option<usize>), MaxRecursionReached>
Unstructured this type
needs to construct itself. Read more