pub struct DocPath { /* private fields */ }Expand description
A canonical document-model path — an ordered DocSeg list with one
Display serializer and one FromStr parser. See the module
docs for the grammar.
Implementations§
Source§impl DocPath
impl DocPath
Sourcepub fn main() -> Self
pub fn main() -> Self
The main-card root, main — the base every main-card address extends
(main.title, main.recipients[0].name, main.body).
Sourcepub fn card(kind: Option<&str>, index: usize) -> Self
pub fn card(kind: Option<&str>, index: usize) -> Self
A composable card root. kind: None is the unknown-kind whole-card
form cards[<i>]; Some(k) is cards.<k>[<i>].
Sourcepub fn field(&self, name: &str) -> Self
pub fn field(&self, name: &str) -> Self
This path extended by a field segment. The name is stored verbatim —
callers pass validated field names, or a config-space prefix
($seed.<kind>) as an opaque head.
Sourcepub fn segment(&self, seg: &PathSegment) -> Self
pub fn segment(&self, seg: &PathSegment) -> Self
This path extended by a value-relative PathSegment — the bridge
from the value-tree walk (!must_fill collection): Key becomes a
field, Index an index.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for DocPath
impl<'de> Deserialize<'de> for DocPath
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>,
impl Eq for DocPath
Source§impl FromStr for DocPath
impl FromStr for DocPath
Source§fn from_str(s: &str) -> Result<Self, Self::Err>
fn from_str(s: &str) -> Result<Self, Self::Err>
The inverse of Display, total over every emitted path. A
main head is the main root — main.body the body, main alone the bare
root, otherwise a main field chain; a cards-headed shape matching a card
root becomes a Card; a trailing .body under a root is
Body; an unrooted chain is a config-space anchor
($seed.<kind>).
Source§type Err = DocPathParseError
type Err = DocPathParseError
impl StructuralPartialEq for DocPath
Auto Trait Implementations§
impl Freeze for DocPath
impl RefUnwindSafe for DocPath
impl Send for DocPath
impl Sync for DocPath
impl Unpin for DocPath
impl UnsafeUnpin for DocPath
impl UnwindSafe for DocPath
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.