[][src]Enum just_fetch::Resource

pub enum Resource {
    Url(Url),
    PathBuf(PathBuf),
}

An enum wrapping the two common fetchers PathBuf and Url. This is more efficient than using Box<dyn Fetcher>.

Variants

Url(Url)

Fetcher for a URL, either for an online http(s):// resource or for a file://

PathBuf(PathBuf)

Fetcher for a local file path

Implementations

impl Resource[src]

pub fn is_absolute(&self) -> bool[src]

Return true if a resource is absolute. This is used in join to disgard the first parent part.

pub fn join(self, other: Self) -> Result<Self, Error>[src]

Join a resource (relative or absolute) with self. Useful for resolving relative paths.

Trait Implementations

impl AsRef<OsStr> for Resource[src]

impl Clone for Resource[src]

impl Debug for Resource[src]

impl Display for Resource[src]

impl Eq for Resource[src]

impl Fetchable for Resource[src]

type Reader = Box<dyn Read>

The output reader type

type Error = Error

Any potential error that could occur

impl<'_> From<&'_ str> for Resource[src]

impl From<PathBuf> for Resource[src]

impl From<String> for Resource[src]

impl From<Url> for Resource[src]

impl Hash for Resource[src]

impl Ord for Resource[src]

impl PartialEq<Resource> for Resource[src]

impl PartialOrd<Resource> for Resource[src]

impl StructuralEq for Resource[src]

impl StructuralPartialEq for Resource[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.