pub struct PathMapping {
pub from: String,
pub to: String,
}Expand description
A single path mapping rule for include directive resolution.
When an include directive’s path contains path segment(s) that exactly
match from, they are replaced with to before the path is resolved on
disk. Matching is performed at the path-component level (split by /),
so from = "sites-enabled" matches .../sites-enabled/... but does NOT
match .../asites-enabled/.... Multi-segment values like
from = "nginx/sites-enabled" match consecutive components.
This is useful when the production config references a directory
(e.g. sites-enabled) that is only populated at runtime via symlinks,
and you want nginx-lint to evaluate the actual source files
(e.g. sites-available) instead.
Mappings are applied in declaration order and chained, so the output of one mapping is fed into the next.
Fields§
§from: StringPath segment(s) to match in the include path (compared component-wise)
to: StringReplacement path segment(s)
Trait Implementations§
Source§impl Clone for PathMapping
impl Clone for PathMapping
Source§fn clone(&self) -> PathMapping
fn clone(&self) -> PathMapping
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for PathMapping
impl Debug for PathMapping
Source§impl<'de> Deserialize<'de> for PathMapping
impl<'de> Deserialize<'de> for PathMapping
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>,
Source§impl JsonSchema for PathMapping
impl JsonSchema for PathMapping
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Source§fn inline_schema() -> bool
fn inline_schema() -> bool
$ref keyword. Read more