Skip to main content

document_url

Function document_url 

Source
pub fn document_url(did: &str) -> Result<String, ResolveError>
Expand description

The URL did’s document lives at, or why did cannot be resolved at all.

Public because resolve is not the only shape a caller needs. A caller holding an async HTTP client — didbot-serve’s operator poll — cannot implement the synchronous DidDocumentSource over it, and still needs the same method dispatch this module already performs: the did:web rules in AccountDid for one method, the directory join for the other, and ResolveError::UnsupportedMethod for anything else. That caller fetches the body itself and makes resolve’s id check on what comes back.