[][src]Trait mail_core::context::ResourceLoaderComponent

pub trait ResourceLoaderComponent: Debug + Send + Sync + 'static {
    fn load_resource(
        &self,
        source: &Source,
        ctx: &impl Context
    ) -> SendBoxFuture<MaybeEncData, ResourceLoadingError>; fn load_transfer_encoded_resource(
        &self,
        resource: &Resource,
        ctx: &impl Context
    ) -> SendBoxFuture<EncData, ResourceLoadingError> { ... } }

Trait needed to be implemented for providing the resource loading parts to aCompositeContext.

Required methods

fn load_resource(
    &self,
    source: &Source,
    ctx: &impl Context
) -> SendBoxFuture<MaybeEncData, ResourceLoadingError>

Calls to Context::load_resource will be forwarded to this method.

It is the same as Context::load_resource except that a reference to the context containing this component is passed in. To prevent infinite recursion the Context.load_resource method must not be called. Additionally the Context.load_transfer_encoded_resource must not be called if it uses Context.load_resource.

Loading content...

Provided methods

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

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

It is the same as Context::transfer_encode_resource except that a reference to the context containing this component is passed in to make the offload and load_resource methods of Context available.

To prevent infinite recursion the load_transfer_encoded_resource method of the context must not be called.

Loading content...

Implementors

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

Allows using a part of an context as an component.

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]

Loading content...