Struct bc::TapMerklePath
source · pub struct TapMerklePath(/* private fields */);
Implementations§
source§impl TapMerklePath
impl TapMerklePath
sourcepub fn try_from(path: Vec<TapBranchHash>) -> Result<Self, Error>
pub fn try_from(path: Vec<TapBranchHash>) -> Result<Self, Error>
Tries to construct a confinement over a collection. Fails if the number of items in the collection exceeds one of the confinement bounds.
sourcepub fn try_from_iter<I: IntoIterator<Item = TapBranchHash>>(
iter: I
) -> Result<Self, Error>
pub fn try_from_iter<I: IntoIterator<Item = TapBranchHash>>( iter: I ) -> Result<Self, Error>
Tries to construct a confinement with a collection of elements taken from an iterator. Fails if the number of items in the collection exceeds one of the confinement bounds.
Methods from Deref<Target = Confined<Vec<TapBranchHash>, 0, 128>>§
sourcepub fn len_u8(&self) -> u8
pub fn len_u8(&self) -> u8
Returns number of elements in the confined collection as u8
. The
confinement guarantees that the collection length can’t exceed
u8::MAX
.
sourcepub fn len_u16(&self) -> u16
pub fn len_u16(&self) -> u16
Returns number of elements in the confined collection as u16
. The
confinement guarantees that the collection length can’t exceed
u16::MAX
.
sourcepub fn len_u24(&self) -> u24
pub fn len_u24(&self) -> u24
Returns number of elements in the confined collection as u24
. The
confinement guarantees that the collection length can’t exceed
u24::MAX
.
Trait Implementations§
source§impl AsRef<Confined<Vec<TapBranchHash>, 0, 128>> for TapMerklePath
impl AsRef<Confined<Vec<TapBranchHash>, 0, 128>> for TapMerklePath
source§impl Borrow<Confined<Vec<TapBranchHash>, 0, 128>> for TapMerklePath
impl Borrow<Confined<Vec<TapBranchHash>, 0, 128>> for TapMerklePath
source§impl Clone for TapMerklePath
impl Clone for TapMerklePath
source§fn clone(&self) -> TapMerklePath
fn clone(&self) -> TapMerklePath
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 TapMerklePath
impl Debug for TapMerklePath
source§impl Default for TapMerklePath
impl Default for TapMerklePath
source§fn default() -> TapMerklePath
fn default() -> TapMerklePath
Returns the “default value” for a type. Read more
source§impl Deref for TapMerklePath
impl Deref for TapMerklePath
source§impl<'de> Deserialize<'de> for TapMerklePath
impl<'de> Deserialize<'de> for TapMerklePath
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl From<Confined<Vec<TapBranchHash>, 0, 128>> for TapMerklePath
impl From<Confined<Vec<TapBranchHash>, 0, 128>> for TapMerklePath
source§impl From<TapMerklePath> for Confined<Vec<TapBranchHash>, 0, 128>
impl From<TapMerklePath> for Confined<Vec<TapBranchHash>, 0, 128>
source§fn from(wrapped: TapMerklePath) -> Self
fn from(wrapped: TapMerklePath) -> Self
Converts to this type from the input type.
source§impl Hash for TapMerklePath
impl Hash for TapMerklePath
source§impl<'a> IntoIterator for &'a TapMerklePath
impl<'a> IntoIterator for &'a TapMerklePath
source§impl IntoIterator for TapMerklePath
impl IntoIterator for TapMerklePath
source§impl Ord for TapMerklePath
impl Ord for TapMerklePath
source§fn cmp(&self, other: &TapMerklePath) -> Ordering
fn cmp(&self, other: &TapMerklePath) -> 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 TapMerklePath
impl PartialEq for TapMerklePath
source§fn eq(&self, other: &TapMerklePath) -> bool
fn eq(&self, other: &TapMerklePath) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for TapMerklePath
impl PartialOrd for TapMerklePath
source§fn partial_cmp(&self, other: &TapMerklePath) -> Option<Ordering>
fn partial_cmp(&self, other: &TapMerklePath) -> 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 Serialize for TapMerklePath
impl Serialize for TapMerklePath
source§impl StrictDecode for TapMerklePath
impl StrictDecode for TapMerklePath
fn strict_decode(reader: &mut impl TypedRead) -> Result<Self, DecodeError>
fn strict_read(lim: usize, reader: impl Read) -> Result<Self, DecodeError>
source§impl StrictEncode for TapMerklePath
impl StrictEncode for TapMerklePath
fn strict_encode<W: TypedWrite>(&self, writer: W) -> Result<W>
fn strict_write(&self, lim: usize, writer: impl Write) -> Result<usize, Error>
source§impl StrictTuple for TapMerklePath
impl StrictTuple for TapMerklePath
const FIELD_COUNT: u8 = 1u8
fn strict_check_fields()
fn strict_type_info() -> TypeInfo<Self>
source§impl StrictType for TapMerklePath
impl StrictType for TapMerklePath
const STRICT_LIB_NAME: &'static str = LIB_NAME_BITCOIN
fn strict_name() -> Option<TypeName>
source§impl Wrapper for TapMerklePath
impl Wrapper for TapMerklePath
§type Inner = Confined<Vec<TapBranchHash>, 0, 128>
type Inner = Confined<Vec<TapBranchHash>, 0, 128>
Inner type wrapped by the current newtype
source§fn from_inner(inner: Self::Inner) -> Self
fn from_inner(inner: Self::Inner) -> Self
Instantiates wrapper type with the inner data
source§fn as_inner(&self) -> &Self::Inner
fn as_inner(&self) -> &Self::Inner
Returns reference to the inner representation for the wrapper type
source§fn into_inner(self) -> Self::Inner
fn into_inner(self) -> Self::Inner
Unwraps the wrapper returning the inner type
impl Eq for TapMerklePath
impl StrictProduct for TapMerklePath
impl StructuralEq for TapMerklePath
impl StructuralPartialEq for TapMerklePath
Auto Trait Implementations§
impl RefUnwindSafe for TapMerklePath
impl Send for TapMerklePath
impl Sync for TapMerklePath
impl Unpin for TapMerklePath
impl UnwindSafe for TapMerklePath
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> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§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 Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.