Skip to content

cargo doc improvements tracking issue #865

Description

@nothingmuch

Following up from #769, I went through cargo doc --no-deps --all-features, there's a few things I think we should do to improve the docs even more:

  • Each typestate struct Foo in v2 should link to Receiver<Foo>
  • v2 sender states (WithReplyKey, PollingForProposal, PendingFallback) should link to Sender<Foo>
  • v1 should be refactored to use the typestate pattern
    • both for consistency with v2
    • and more importantly because that has the effect of showing the state machine in its logical order under Receiver struct, that alone is justification enough IMO
      • Dan's comment: one struct per state, each transition consuming self
  • the top level payjoin module doc should:
  • Document the Uri top level type alias and struct
    • documentation for the individual fields exists but this assumes the reader is familiar with the Extras pattern of bitcoin_uri
      • Uri and PjUri are newtypes with their own docs, so the Extras-pattern complaint no longer applies
    • it should have an example of parsing a URI checking the version, and initializing sender state machine
  • we should eliminate as many top level pub symbols as we can Keeping these. Since Clean up re-exports #688 the crate root is the only public path to them, and most appear in public signatures (OhttpKeys in ReceiverBuilder::new, HpkePublicKey from PjParam::receiver_pubkey, OhttpResponse and Request from create_*_request).
    • instead of pub use crate::core::* we should only re-export what really makes sense at the top level
    • if i'm not mistaken HpkeKeyPair, HpkePublicKey, OhttpKeys don't need to be reexported anymore at the very least
    • Url seems especially problematic since it's a re-export of a crate we're considering trying to remove, and is largely superseded by the IntoUrl trait IIUC it's its own type now
  • OHTTP request reuse warning can be removed from top level send module since the v2 sub-module already contains it too (but that one lacks a level 2 heading, sorry i missed this in review)
  • payjoin-cli, nolooking and bitmask-core are linked as examples in the top level v2::send module docs but:
    • this should be moved to the top level payjoin module rather than v2::send
    • afaik nolooking doesn't include v2 integration, should a caveat be added? should it be brought up to date? or is it no longer a useful example?
    • seems worth mentioning bbmobile & cake or at least payjoin-ffi?
  • ///Foo -> /// Foo
  • update README.md
    • link to payjoin docs
    • explain that payjoin-cli is intended to be a reference
    • Cargo-minimal.lock seems to supersede MSRV sections

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    apigood first issueDoes NOT mean "an LLM can do this." Please discuss the constraints and intended approach.trackingHigh-level tracking issues

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions