[][src]Trait dsf_core::service::publisher::Publisher

pub trait Publisher {
    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,
        options: SecondaryOptions,
        buff: T
    ) -> Result<(usize, Page), Error>; }

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

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

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

fn publish_secondary<T: AsRef<[u8]> + AsMut<[u8]>>(
    &mut self,
    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

Loading content...

Implementors

impl Publisher for Service[src]

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

Publish generates a page to publishing for the given service.

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

Secondary generates a secondary page using this service to be attached to the provided service ID

Loading content...