[][src]Trait just_fetch::Fetchable

pub trait Fetchable {
    type Reader: Read;
    type Error;
    fn reader_for(self, f: &mut Fetcher) -> Result<Self::Reader, Self::Error>;
}

Something that can be turned into a reader given a fetcher. Example is a URL which can be turned into a reader by sending a GET request, or a file path which can be turned into a reader by just opening the file.

Associated Types

type Reader: Read

The output reader type

type Error

Any potential error that could occur

Loading content...

Required methods

fn reader_for(self, f: &mut Fetcher) -> Result<Self::Reader, Self::Error>

Return a reader given a fetcher

Loading content...

Implementations on Foreign Types

impl<'_> Fetchable for &'_ str[src]

type Reader = Box<dyn Read>

type Error = Error

impl Fetchable for Url[src]

type Reader = Box<dyn Read>

type Error = Error

impl Fetchable for Response[src]

type Reader = Box<dyn Read>

type Error = Error

impl<'_> Fetchable for &'_ Path[src]

type Reader = Box<dyn Read>

type Error = Error

impl Fetchable for PathBuf[src]

type Reader = Box<dyn Read>

type Error = Error

Loading content...

Implementors

impl Fetchable for Resource[src]

type Reader = Box<dyn Read>

type Error = Error

Loading content...