pub struct Config {
pub items: Vec<ConfigItem>,
pub include_context: Vec<String>,
}Expand description
Root node of a parsed nginx configuration file.
Use directives() for top-level directives only, or
all_directives() to recurse into blocks.
Call to_source() to reconstruct the source text.
Fields§
§items: Vec<ConfigItem>Top-level items (directives, comments, blank lines).
include_context: Vec<String>Context from parent file when this config was included Empty for root file, e.g., [“http”, “server”] for a file included in server block
Implementations§
Source§impl Config
impl Config
pub fn new() -> Self
Sourcepub fn directives(&self) -> impl Iterator<Item = &Directive>
pub fn directives(&self) -> impl Iterator<Item = &Directive>
Returns an iterator over top-level directives (excludes comments and blank lines)
Sourcepub fn all_directives(&self) -> AllDirectives<'_> ⓘ
pub fn all_directives(&self) -> AllDirectives<'_> ⓘ
Returns an iterator over all directives recursively (for lint rules)
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Config
impl<'de> Deserialize<'de> for Config
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for Config
impl RefUnwindSafe for Config
impl Send for Config
impl Sync for Config
impl Unpin for Config
impl UnsafeUnpin for Config
impl UnwindSafe for Config
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