Trait tough::schema::Transport[][src]

pub trait Transport: Debug + DynClone {
    fn fetch(&self, url: Url) -> Result<Box<dyn Read + Send>, TransportError>;
}

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.

Required methods

fn fetch(&self, url: Url) -> Result<Box<dyn Read + Send>, TransportError>[src]

Opens a Read object for the file specified by url.

Loading content...

Implementors

Loading content...