pub trait Transport: Debug + DynClone {
// Required method
fn fetch(
&self,
url: Url
) -> Result<Box<dyn Read + Send + '_>, TransportError>;
}
Expand description
A trait to abstract over the method/protocol by which files are obtained.
The trait hides the underlying types involved by returning the Read
object as a
Box<dyn Read + Send>
and by requiring concrete type TransportError
as the error type.
Inclusion of the DynClone
trait means that you will need to implement Clone
when
implementing a Transport
.