[][src]Trait spartan_lib::core::payload::Sortable

pub trait Sortable {
    type Sort: Ord;
    pub fn sort(&self) -> Self::Sort;
}

Interface for working with sortable messages

Associated Types

type Sort: Ord[src]

Loading content...

Required methods

pub fn sort(&self) -> Self::Sort[src]

Get message sort key. It's used for message prioritization in queue.

use spartan_lib::core::message::builder::MessageBuilder;
use spartan_lib::core::payload::Sortable;

let message = MessageBuilder::default().body("Hello, world").compose().unwrap();

dbg!(message.sort());
Loading content...

Implementors

impl Sortable for Message[src]

type Sort = Option<i64>

Loading content...