Trait tough::schema::Transport

source ·
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.

Required Methods§

source

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

Opens a Read object for the file specified by url.

Trait Implementations§

source§

impl<'clone> Clone for Box<dyn Transport + 'clone>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'clone> Clone for Box<dyn Transport + Send + 'clone>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'clone> Clone for Box<dyn Transport + Send + Sync + 'clone>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl<'clone> Clone for Box<dyn Transport + Sync + 'clone>

source§

fn clone(&self) -> Self

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more

Implementors§