pub struct ErrorPath { /* private fields */ }Expand description
A structured operational error address.
Segments are kept separately so callers can use them in logs, JSON, or storage without parsing a rendered string.
Implementations§
Source§impl ErrorPath
impl ErrorPath
Sourcepub fn from_path(path: &'static str) -> Self
pub fn from_path(path: &'static str) -> Self
Create a path from segments separated by path_delimiter, ignoring
empty segments.
Sourcepub fn from_dot_separated(path: &'static str) -> Self
pub fn from_dot_separated(path: &'static str) -> Self
Create a path using the configured delimiter.
Prefer ErrorPath::from_path. This compatibility alias no longer
assumes a dot delimiter.
Sourcepub fn from_segment(segment: &'static str) -> Self
pub fn from_segment(segment: &'static str) -> Self
Create a path containing one atomic segment.
Dots in segment are preserved. This is useful for a stable error code
such as http.0405.
Sourcepub fn to_string_with(&self, delimiter: &str) -> String
pub fn to_string_with(&self, delimiter: &str) -> String
Render this path with delimiter between segments.
Sourcepub fn prepend_path(&mut self, path: &'static str)
pub fn prepend_path(&mut self, path: &'static str)
Prepend segments separated by path_delimiter, ignoring empty
segments.
Sourcepub fn prepend_dot_separated(&mut self, path: &'static str)
pub fn prepend_dot_separated(&mut self, path: &'static str)
Prepend segments using the configured delimiter.
Prefer ErrorPath::prepend_path. This compatibility alias no longer
assumes a dot delimiter.