Rust docs (#681)

This commit is contained in:
thesimplekid
2025-03-25 23:27:38 +00:00
committed by GitHub
parent 1e20e8fc2b
commit 7b4951041e
77 changed files with 795 additions and 80 deletions

View File

@@ -8,6 +8,7 @@ homepage = "https://github.com/cashubtc/cdk"
repository = "https://github.com/cashubtc/cdk.git"
rust-version.workspace = true # MSRV
license.workspace = true
readme = "README.md"
[[bin]]
name = "cdk-payment-processor"

View File

@@ -2,6 +2,8 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
println!("cargo:rerun-if-changed=src/proto/payment_processor.proto");
tonic_build::configure()
.protoc_arg("--experimental_allow_proto3_optional")
.type_attribute(".", "#[allow(missing_docs)]")
.field_attribute(".", "#[allow(missing_docs)]")
.compile_protos(&["src/proto/payment_processor.proto"], &["src/proto"])?;
Ok(())
}

View File

@@ -1,3 +1,7 @@
#![doc = include_str!("../README.md")]
#![warn(missing_docs)]
#![warn(rustdoc::bare_urls)]
pub mod error;
pub mod proto;

View File

@@ -1,3 +1,5 @@
//! Proto types for payment processor
use std::str::FromStr;
use cdk_common::payment::{

View File

@@ -32,6 +32,7 @@ pub struct PaymentProcessorServer {
}
impl PaymentProcessorServer {
/// Create new [`PaymentProcessorServer`]
pub fn new(
payment_processor: Arc<dyn MintPayment<Err = cdk_common::payment::Error> + Send + Sync>,
addr: &str,