Don't require Transport::{Ok, Error} to inherit specific traits
This commit is contained in:
22
src/lib.rs
22
src/lib.rs
@@ -59,7 +59,6 @@ pub use crate::{address::Address, transport::stub::StubTransport};
|
|||||||
use async_trait::async_trait;
|
use async_trait::async_trait;
|
||||||
#[cfg(feature = "builder")]
|
#[cfg(feature = "builder")]
|
||||||
use std::convert::TryFrom;
|
use std::convert::TryFrom;
|
||||||
use std::{error::Error as StdError, fmt};
|
|
||||||
|
|
||||||
/// Simple email envelope representation
|
/// Simple email envelope representation
|
||||||
///
|
///
|
||||||
@@ -139,9 +138,10 @@ impl TryFrom<&Headers> for Envelope {
|
|||||||
|
|
||||||
/// Blocking Transport method for emails
|
/// Blocking Transport method for emails
|
||||||
pub trait Transport {
|
pub trait Transport {
|
||||||
/// Result types for the transport
|
/// Response produced by the Transport
|
||||||
type Ok: fmt::Debug;
|
type Ok;
|
||||||
type Error: StdError;
|
/// Error produced by the Transport
|
||||||
|
type Error;
|
||||||
|
|
||||||
/// Sends the email
|
/// Sends the email
|
||||||
#[cfg(feature = "builder")]
|
#[cfg(feature = "builder")]
|
||||||
@@ -157,9 +157,10 @@ pub trait Transport {
|
|||||||
#[cfg(feature = "async-std1")]
|
#[cfg(feature = "async-std1")]
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
pub trait AsyncStd1Transport {
|
pub trait AsyncStd1Transport {
|
||||||
/// Result types for the transport
|
/// Response produced by the Transport
|
||||||
type Ok: fmt::Debug;
|
type Ok;
|
||||||
type Error: StdError;
|
/// Error produced by the Transport
|
||||||
|
type Error;
|
||||||
|
|
||||||
/// Sends the email
|
/// Sends the email
|
||||||
#[cfg(feature = "builder")]
|
#[cfg(feature = "builder")]
|
||||||
@@ -177,9 +178,10 @@ pub trait AsyncStd1Transport {
|
|||||||
#[cfg(feature = "tokio02")]
|
#[cfg(feature = "tokio02")]
|
||||||
#[async_trait]
|
#[async_trait]
|
||||||
pub trait Tokio02Transport {
|
pub trait Tokio02Transport {
|
||||||
/// Result types for the transport
|
/// Response produced by the Transport
|
||||||
type Ok: fmt::Debug;
|
type Ok;
|
||||||
type Error: StdError;
|
/// Error produced by the Transport
|
||||||
|
type Error;
|
||||||
|
|
||||||
/// Sends the email
|
/// Sends the email
|
||||||
#[cfg(feature = "builder")]
|
#[cfg(feature = "builder")]
|
||||||
|
|||||||
Reference in New Issue
Block a user