]> Untitled Git - bdk/commitdiff
[docs] Add more docs to 'types.rs'
authorSteve Myers <steve@notmandatory.org>
Wed, 16 Dec 2020 19:33:34 +0000 (11:33 -0800)
committerSteve Myers <steve@notmandatory.org>
Wed, 16 Dec 2020 23:12:47 +0000 (15:12 -0800)
src/lib.rs
src/types.rs

index d626b8a2869a6635df3a2890e6ee4daf2b4c1cac..3991aed641d5fef2acf5a26adff870e39c6b5547 100644 (file)
@@ -258,7 +258,6 @@ pub mod descriptor;
 mod doctest;
 pub mod keys;
 pub(crate) mod psbt;
-#[allow(missing_docs)] // TODO add missing docs and remove this allow
 pub(crate) mod types;
 pub mod wallet;
 
index 07d344c522676726cff2d743849542d2babf57d0..4a60e2d9688e5a3cfe11f7d725a638da0c2432fb 100644 (file)
@@ -29,7 +29,7 @@ use bitcoin::hash_types::Txid;
 
 use serde::{Deserialize, Serialize};
 
-/// Types of script
+/// Types of keychains
 #[derive(Serialize, Deserialize, Debug, Clone, Copy, PartialEq, Eq, Hash)]
 pub enum KeychainKind {
     /// External
@@ -39,6 +39,7 @@ pub enum KeychainKind {
 }
 
 impl KeychainKind {
+    /// Return [`KeychainKind`] as a byte
     pub fn as_byte(&self) -> u8 {
         match self {
             KeychainKind::External => b'e',
@@ -92,19 +93,29 @@ impl std::default::Default for FeeRate {
 /// A wallet unspent output
 #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq)]
 pub struct UTXO {
+    /// Reference to a transaction output
     pub outpoint: OutPoint,
+    /// Transaction output
     pub txout: TxOut,
+    /// Type of keychain
     pub keychain: KeychainKind,
 }
 
 /// A wallet transaction
 #[derive(Serialize, Deserialize, Debug, Clone, PartialEq, Eq, Default)]
 pub struct TransactionDetails {
+    /// Optional transaction
     pub transaction: Option<Transaction>,
+    /// Transaction id
     pub txid: Txid,
+    /// Timestamp
     pub timestamp: u64,
+    /// Received value (sats)
     pub received: u64,
+    /// Sent value (sats)
     pub sent: u64,
+    /// Fee value (sats)
     pub fees: u64,
+    /// Confirmed in block height, `None` means unconfirmed
     pub height: Option<u32>,
 }