///|
/// Stub for the JavaScript target: the socket transport is native-only, so any
/// use on this target raises `Unsupported`. The SMTP protocol core itself is
/// fully portable and still available on this target.
pub struct SocketTransport {
  connected : Bool
}

///|
pub fn SocketTransport::new() -> SocketTransport {
  { connected: false }
}

///|
pub impl SmtpTransport for SocketTransport with fn connect(_self, _config) {
  raise MailFailure::unsupported(
    "SocketTransport requires the native target (js target does not support raw sockets)",
  )
}

///|
pub impl SmtpTransport for SocketTransport with fn write_line(_self, _line) {
  raise MailFailure::unsupported(
    "SocketTransport is not available on the js target",
  )
}

///|
pub impl SmtpTransport for SocketTransport with fn read_line(_self) {
  raise MailFailure::unsupported(
    "SocketTransport is not available on the js target",
  )
}

///|
pub impl SmtpTransport for SocketTransport with fn close(_self) {
  ()
}