pub struct Path { /* private fields */ }Expand description
The element path being decoded, for error reports.
Implementations§
Source§impl Path
impl Path
Sourcepub fn lenient(root: &str) -> Self
pub fn lenient(root: &str) -> Self
A path starting at root that reads a required primitive stating no
value as the value-less element it would be with only an extension,
and a required repeating element with fewer items than its minimum as
the items it carries.
Cardinality is an aspect of validating a resource, which a server performs at its discretion, and an implementation “should be conservative in its sending behavior, and liberal in its receiving behavior” (https://hl7.org/fhir/R4B/validation.html). A reader that is handed a resource to use, rather than to store, takes this path so one absent element does not cost the whole request.
Sourcepub const fn is_lenient(&self) -> bool
pub const fn is_lenient(&self) -> bool
Whether this read tolerates a required primitive that states no value.
Sourcepub fn with<T, E>(
&mut self,
name: &str,
f: impl FnOnce(&mut Self) -> Result<T, E>,
) -> Result<T, E>
pub fn with<T, E>( &mut self, name: &str, f: impl FnOnce(&mut Self) -> Result<T, E>, ) -> Result<T, E>
Sourcepub fn with_index<T, E>(
&mut self,
name: &str,
index: usize,
f: impl FnOnce(&mut Self) -> Result<T, E>,
) -> Result<T, E>
pub fn with_index<T, E>( &mut self, name: &str, index: usize, f: impl FnOnce(&mut Self) -> Result<T, E>, ) -> Result<T, E>
Sourcepub fn error(&self, kind: DecodeErrorKind) -> DecodeError
pub fn error(&self, kind: DecodeErrorKind) -> DecodeError
An error at the current path.