Skip to main content

SenderKeys

Trait SenderKeys 

Source
pub trait SenderKeys:
    Send
    + Sync
    + 'static {
    // Required method
    fn key(
        &self,
        sender: &str,
    ) -> impl Future<Output = Result<Option<SenderKey>, QueueError>> + Send;

    // Provided method
    fn gone(&self, sender: &str) -> impl Future<Output = bool> + Send { ... }
}
Expand description

Where a sender’s signing key comes from: the application.

Required Methods§

Source

fn key( &self, sender: &str, ) -> impl Future<Output = Result<Option<SenderKey>, QueueError>> + Send

The key sender signs with, or None when there is no such sender.

Provided Methods§

Source

fn gone(&self, sender: &str) -> impl Future<Output = bool> + Send

Whether sender is gone for good, so that a status DelivererConfig::permanent_if_sender_gone names will not change: Mastodon gives up at once on a 401 to a delivery from an account that is deleted or suspended with nothing left to undo (unsalvageable_authorization_failure?). Asked only after such a status; no sender is gone unless the application says so.

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementations on Foreign Types§

Source§

impl SenderKeys for BTreeMap<String, SenderKey>

A key for each sender, by the name it is sent as.

Source§

fn key( &self, sender: &str, ) -> impl Future<Output = Result<Option<SenderKey>, QueueError>> + Send

Source§

impl SenderKeys for SenderKey

One key, for an application with one sender: it signs whatever is sent.

Source§

fn key( &self, _sender: &str, ) -> impl Future<Output = Result<Option<SenderKey>, QueueError>> + Send

Source§

impl<S: BuildHasher + Send + Sync + 'static> SenderKeys for HashMap<String, SenderKey, S>

A key for each sender, by the name it is sent as.

Source§

fn key( &self, sender: &str, ) -> impl Future<Output = Result<Option<SenderKey>, QueueError>> + Send

Implementors§