Struct LxTxid
pub struct LxTxid(pub Txid);Expand description
Almost exactly [bitcoin::Txid], but fixes the inconsistency between the
string-serialized and unserialized orderings caused by bitcoin sha256d hash
types being displayed in reverse hex order (thanks Satoshi!). Also provides
an Arbitrary impl. When neither of these are required, it is perfectly
fine (and equivalent) to use [bitcoin::Txid] directly.
To ensure that we don’t accidentally display a non-reversed hash to a Lexe
user, we still display using [Txid]’s provided reverse hex impl, but we
override the Ord implementation to be consistent with the user-facing
lexicographic ordering.
See [bitcoin::hashes::Hash::DISPLAY_BACKWARD] or the hash_newtype!
definition of [Txid] for more info.
Tuple Fields§
§0: TxidTrait Implementations§
§impl<'de> Deserialize<'de> for LxTxid
impl<'de> Deserialize<'de> for LxTxid
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<LxTxid, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<LxTxid, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl Ord for LxTxid
impl Ord for LxTxid
§impl PartialOrd for LxTxid
impl PartialOrd for LxTxid
§impl Serialize for LxTxid
impl Serialize for LxTxid
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Copy for LxTxid
impl Eq for LxTxid
impl StructuralPartialEq for LxTxid
Auto Trait Implementations§
impl Freeze for LxTxid
impl RefUnwindSafe for LxTxid
impl Send for LxTxid
impl Sync for LxTxid
impl Unpin for LxTxid
impl UnwindSafe for LxTxid
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
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,
§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
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.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> PolicyExt for Twhere
T: ?Sized,
impl<T> PolicyExt for Twhere
T: ?Sized,
§impl<T> ToStringFallible for Twhere
T: Display,
impl<T> ToStringFallible for Twhere
T: Display,
§fn try_to_string(&self) -> Result<String, TryReserveError>
fn try_to_string(&self) -> Result<String, TryReserveError>
ToString::to_string, but without panic on OOM.