Skip to main content

Destination

Trait Destination 

Source
pub trait Destination {
    // Provided methods
    fn connection_fields(&self) -> Vec<ConnectionField> { ... }
    fn options(&self) -> Vec<OptionField> { ... }
    fn validate(&self, _options: &Map<String, Value>) -> Vec<String> { ... }
    fn deliver(
        &mut self,
        _local: &Path,
        _remote: Option<&str>,
        _connection: &Map<String, Value>,
    ) -> Result<String> { ... }
    fn message_limit(&self) -> Option<u64> { ... }
    fn deliver_message(&mut self, _d: &Delivery, _m: &Message) -> Result<String> { ... }
    fn deliver_files(&mut self, d: &Delivery) -> Result<String> { ... }
}

Provided Methods§

Source

fn connection_fields(&self) -> Vec<ConnectionField>

Source

fn options(&self) -> Vec<OptionField>

The options a report’s destination entry takes: every key but profile and path. String values may still hold Jinja when checked (see options::is_template); core renders it before deliver.

Source

fn validate(&self, _options: &Map<String, Value>) -> Vec<String>

Problems the declared Destination::options can’t catch, each a sentence naming the key. Only called on options whose declared types already passed.

Source

fn deliver( &mut self, _local: &Path, _remote: Option<&str>, _connection: &Map<String, Value>, ) -> Result<String>

Deliver local to remote (rendered by core); return where it landed. Enough for a destination that takes no options; others implement Destination::deliver_files.

Source

fn message_limit(&self) -> Option<u64>

The most characters a message may have in the service (after translation), reported in describe by a plugin advertising message.

Source

fn deliver_message(&mut self, _d: &Delivery, _m: &Message) -> Result<String>

Post d.message (with d.files attached). Called only for a plugin advertising message, which implements it.

Source

fn deliver_files(&mut self, d: &Delivery) -> Result<String>

The whole request, options included (already checked). The default hands a single file to Destination::deliver; several files arrive only with multi_file advertised.

Dyn Compatibility§

This trait is dyn compatible.

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

Implementors§