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

pub trait Transport: Debug + DynClone {
    pub 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

pub 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

impl Transport for FilesystemTransport[src]

impl Transport for DefaultTransport[src]

Loading content...