pub struct TxId(pub [u8; 32]);Expand description
ID (hash) of a transaction in the underlying ledger (Bitcoin).
Tuple Fields§
§0: [u8; 32]Implementations§
Source§impl TxId
impl TxId
Sourcepub fn from_str(s: &str) -> Result<Self>
pub fn from_str(s: &str) -> Result<Self>
Try to create TxId from a string of 64 hex characters.
Note that string representation of transaction IDs in Bitcoin is reversed, and so is ours
(for compatibility).
Example:
use charms_data::TxId;
let tx_id = TxId::from_str("92077a14998b31367efeec5203a00f1080facdb270cbf055f09b66ae0a273c7d").unwrap();Trait Implementations§
Source§impl<'de> Deserialize<'de> for TxId
impl<'de> Deserialize<'de> for TxId
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 Ord for TxId
impl Ord for TxId
Source§impl PartialOrd for TxId
impl PartialOrd for TxId
impl Copy for TxId
impl Eq for TxId
impl StructuralPartialEq for TxId
Auto Trait Implementations§
impl Freeze for TxId
impl RefUnwindSafe for TxId
impl Send for TxId
impl Sync for TxId
impl Unpin for TxId
impl UnwindSafe for TxId
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