[][src]Struct mail_core::default_impl::FsResourceLoader

pub struct FsResourceLoader<SchemeValidation: ConstSwitch = Enabled> { /* fields omitted */ }

By setting SchemeValidation to Disabled the FsResourceLoader can be used to simple load a resource from a file based on a scheme tail as path independent of the rest, so e.g. it it is used in a Mux which selects a ResourceLoader impl based on a scheme the scheme would not be double validated.

Methods

impl<SVSw> FsResourceLoader<SVSw> where
    SVSw: ConstSwitch
[src]

pub fn new<P: Into<PathBuf>>(root: P) -> Self[src]

create a new file system based FileLoader, which will "just" standard blocking IO to read a file from the file system into a buffer

pub fn new_with_scheme<P: Into<PathBuf>>(root: P, scheme: &'static str) -> Self[src]

pub fn with_cwd_root() -> Result<Self, Error>[src]

pub fn root(&self) -> &Path[src]

pub fn scheme(&self) -> &'static str[src]

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

pub fn iri_has_compatible_scheme(&self, iri: &IRI) -> bool[src]

Trait Implementations

impl<ValidateScheme> ResourceLoaderComponent for FsResourceLoader<ValidateScheme> where
    ValidateScheme: ConstSwitch
[src]

fn load_transfer_encoded_resource(
    &self,
    resource: &Resource,
    ctx: &impl Context
) -> SendBoxFuture<EncData, ResourceLoadingError>
[src]

Calls to Context::transfer_encode_resource will be forwarded to this method. Read more

impl<SchemeValidation: PartialEq + ConstSwitch> PartialEq<FsResourceLoader<SchemeValidation>> for FsResourceLoader<SchemeValidation>[src]

impl<SchemeValidation: Default + ConstSwitch> Default for FsResourceLoader<SchemeValidation>[src]

impl<SchemeValidation: Clone + ConstSwitch> Clone for FsResourceLoader<SchemeValidation>[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl<SchemeValidation: Debug + ConstSwitch> Debug for FsResourceLoader<SchemeValidation>[src]

Auto Trait Implementations

impl<SchemeValidation> Send for FsResourceLoader<SchemeValidation>

impl<SchemeValidation> Sync for FsResourceLoader<SchemeValidation>

Blanket Implementations

impl<C> ResourceLoaderComponent for C where
    C: Context
[src]

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

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

type Owned = T

impl<T> From for T[src]

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

type Error = Infallible

The type returned in the event of a conversion error.

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

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

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

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

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

The type returned in the event of a conversion error.

impl<F, T> HeaderTryInto for F where
    T: HeaderTryFrom<F>, 
[src]

impl<T> HeaderTryFrom for T[src]

impl<T> Erased for T