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 validate_connection(
&self,
_connection: &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§
fn connection_fields(&self) -> Vec<ConnectionField>
Sourcefn options(&self) -> Vec<OptionField>
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.
Sourcefn validate(&self, _options: &Map<String, Value>) -> Vec<String>
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.
Sourcefn validate_connection(&self, _connection: &Map<String, Value>) -> Vec<String>
fn validate_connection(&self, _connection: &Map<String, Value>) -> Vec<String>
Rules the declared Destination::connection_fields can’t express, each a sentence
naming the field, never its value. Static: no network. Run by validate_connection and
before every delivery.
Sourcefn deliver(
&mut self,
_local: &Path,
_remote: Option<&str>,
_connection: &Map<String, Value>,
) -> Result<String>
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.
Sourcefn message_limit(&self) -> Option<u64>
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.
Sourcefn deliver_message(&mut self, _d: &Delivery, _m: &Message) -> Result<String>
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.
Sourcefn deliver_files(&mut self, d: &Delivery) -> Result<String>
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".