Publisher

Trait Publisher 

Source
pub trait Publisher {
    // Required methods
    fn publish_primary<T: AsRef<[u8]> + AsMut<[u8]>>(
        &mut self,
        buff: T,
    ) -> Result<(usize, Page), Error>;
    fn publish_data<T: AsRef<[u8]> + AsMut<[u8]>>(
        &mut self,
        options: DataOptions,
        buff: T,
    ) -> Result<(usize, Page), Error>;
    fn publish_secondary<T: AsRef<[u8]> + AsMut<[u8]>>(
        &mut self,
        id: &Id,
        options: SecondaryOptions,
        buff: T,
    ) -> Result<(usize, Page), Error>;
}
Expand description

Publisher trait allows services to generate primary, data, and secondary pages as well as to encode (and sign and optionally encrypt) generated pages

Required Methods§

Source

fn publish_primary<T: AsRef<[u8]> + AsMut<[u8]>>( &mut self, buff: T, ) -> Result<(usize, Page), Error>

Generates a primary page to publish for the given service and encodes it into the provided buffer

Source

fn publish_data<T: AsRef<[u8]> + AsMut<[u8]>>( &mut self, options: DataOptions, buff: T, ) -> Result<(usize, Page), Error>

Create a data object for publishing with the provided options and encodes it into the provided buffer

Source

fn publish_secondary<T: AsRef<[u8]> + AsMut<[u8]>>( &mut self, id: &Id, options: SecondaryOptions, buff: T, ) -> Result<(usize, Page), Error>

Create a secondary page for publishing with the provided options and encodes it into the provided buffer

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§