Struct bulwark_config::Resource
source · pub struct Resource {
pub route: 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§
§route: 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 Plugin
s.
Arguments
config
- AConfig
reference to perform lookups againsts.Resource
s do not maintain their own references to their parentConfig
so this must be passed in.
See Config::plugin
and Config::preset
.
Trait Implementations§
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§
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