pub struct Resource {
pub routes: Vec<String>,
pub plugins: Vec<Reference>,
pub timeout: Option<u64>,
}Expand description
A mapping between a route pattern and the plugins that should be run for matching requests.
Fields§
§routes: Vec<String>The route pattern used to match requests with.
Uses matchit router patterns.
plugins: Vec<Reference>The plugin references for this route.
timeout: Option<u64>The maximum amount of time a plugin may take for each execution phase.
Implementations§
Source§impl Resource
impl Resource
Sourcepub fn resolve_plugins<'a>(
&'a self,
config: &'a Config,
) -> Result<Vec<&Plugin>, ResolutionError>
pub fn resolve_plugins<'a>( &'a self, config: &'a Config, ) -> Result<Vec<&Plugin>, ResolutionError>
Resolves all references within a Resource, producing a flattened list of the corresponding Plugins.
§Arguments
config- AConfigreference to perform lookups againsts.Resources do not maintain their own references to their parentConfigso this must be passed in.
See Config::plugin and Config::preset.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Resource
impl RefUnwindSafe for Resource
impl Send for Resource
impl Sync for Resource
impl Unpin for Resource
impl UnwindSafe for Resource
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more