[−][src]Enum just_fetch::Resource
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
fn reader_for(self, f: &mut Fetcher) -> Result<Self::Reader, Self::Error>
[src]
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]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for Resource
[src]
fn cmp(&self, other: &Resource) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<Resource> for Resource
[src]
impl PartialOrd<Resource> for Resource
[src]
fn partial_cmp(&self, other: &Resource) -> Option<Ordering>
[src]
fn lt(&self, other: &Resource) -> bool
[src]
fn le(&self, other: &Resource) -> bool
[src]
fn gt(&self, other: &Resource) -> bool
[src]
fn ge(&self, other: &Resource) -> bool
[src]
impl StructuralEq for Resource
[src]
impl StructuralPartialEq for Resource
[src]
Auto Trait Implementations
impl RefUnwindSafe for Resource
impl Send for Resource
impl Sync for Resource
impl Unpin for Resource
impl UnwindSafe for Resource
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,