pub struct LoadedMiddlewares { /* private fields */ }Expand description
An ordered list of compiled middleware handlers.
Compilation happens once at server startup (see [compile]) so the
per-request path is free of filesystem reads and Rhai parsing cost.
Implementations§
Source§impl LoadedMiddlewares
impl LoadedMiddlewares
Sourcepub fn compile(
middleware_file_paths: &[String],
relative_dir_path: &str,
) -> ServerResult<Self>
pub fn compile( middleware_file_paths: &[String], relative_dir_path: &str, ) -> ServerResult<Self>
Compile every Rhai source file listed in middleware_file_paths.
Paths are interpreted relative to relative_dir_path — the same
convention used by Config::new for rule-set paths.
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn iter(&self) -> Iter<'_, MiddlewareHandler>
Trait Implementations§
Source§impl Clone for LoadedMiddlewares
impl Clone for LoadedMiddlewares
Source§fn clone(&self) -> LoadedMiddlewares
fn clone(&self) -> LoadedMiddlewares
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for LoadedMiddlewares
impl Default for LoadedMiddlewares
Source§fn default() -> LoadedMiddlewares
fn default() -> LoadedMiddlewares
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for LoadedMiddlewares
impl !RefUnwindSafe for LoadedMiddlewares
impl Send for LoadedMiddlewares
impl Sync for LoadedMiddlewares
impl Unpin for LoadedMiddlewares
impl UnsafeUnpin for LoadedMiddlewares
impl !UnwindSafe for LoadedMiddlewares
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