pub struct CompiledEndpointRules { /* private fields */ }Expand description
Pre-compiled endpoint rules for the request hot path.
Built once at proxy startup from EndpointRule definitions. Holds
compiled globset::GlobMatchers so the hot path does a regex match,
not a glob compile.
Implementations§
Source§impl CompiledEndpointRules
impl CompiledEndpointRules
Sourcepub fn compile(rules: &[EndpointRule]) -> Result<Self, String>
pub fn compile(rules: &[EndpointRule]) -> Result<Self, String>
Compile endpoint rules into matchers. Invalid glob patterns are rejected at startup with an error, not silently ignored at runtime.
Sourcepub fn is_allowed(&self, method: &str, path: &str) -> bool
pub fn is_allowed(&self, method: &str, path: &str) -> bool
Check if the given method+path is allowed.
Returns true if no rules were compiled (allow-all, backward compatible).
Trait Implementations§
Auto Trait Implementations§
impl Freeze for CompiledEndpointRules
impl RefUnwindSafe for CompiledEndpointRules
impl Send for CompiledEndpointRules
impl Sync for CompiledEndpointRules
impl Unpin for CompiledEndpointRules
impl UnsafeUnpin for CompiledEndpointRules
impl UnwindSafe for CompiledEndpointRules
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