Struct bulwark_config::Resource
source · 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 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 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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)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