pub trait FileSource: Send + Sync {
// Required methods
fn load(&self, resource: &Resource, responder: Responder);
fn can_request(&self, resource: &Resource) -> bool;
// Provided method
fn supports_cache_only(&self) -> bool { ... }
}Expand description
A source of resources. File sources are shared between threads, hence
Send + Sync. Each takes its configuration when it’s made, or through
methods of its own type.
Required Methods§
Sourcefn load(&self, resource: &Resource, responder: Responder)
fn load(&self, resource: &Resource, responder: Responder)
Starts loading resource, and sends its responses to responder
from any thread. It returns at once.
Sourcefn can_request(&self, resource: &Resource) -> bool
fn can_request(&self, resource: &Resource) -> bool
Whether this file source loads resource.
Provided Methods§
Sourcefn supports_cache_only(&self) -> bool
fn supports_cache_only(&self) -> bool
Whether this file source answers cache-only requests: ones that are worth answering only cheaply, from a local cache, to cover part of the map while it loads.
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".