NetdocBuilder

Trait NetdocBuilder 

Source
pub trait NetdocBuilder {
    // Required method
    fn build_sign<R: RngCore + CryptoRng>(
        self,
        rng: &mut R,
    ) -> Result<String, EncodeError>;
}
Available on crate feature encode only.
Expand description

Builders for network documents.

This trait is a bit weird, because its Self type must contain the private keys necessary to sign the document!

So it is implemented for “builders”, not for documents themselves. Some existing documents can be constructed only via these builders. The newer approach is for documents to be transparent data, at the Rust level, and to derive an encoder. TODO this derive approach is not yet implemented!

Actual document types, which only contain the information in the document, don’t implement this trait.

Required Methods§

Source

fn build_sign<R: RngCore + CryptoRng>( self, rng: &mut R, ) -> Result<String, EncodeError>

Build the document into textual form.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.

Implementors§

Source§

impl<'a> NetdocBuilder for HsDescBuilder<'a>

Available on crate features hs-service and hs-common only.