Skip to main content

DocPath

Struct DocPath 

Source
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

Source

pub fn new() -> Self

The empty base for a config-space / opaque-prefix path ($seed.<kind>, a Quill.yaml schema-literal owner label) — the one unrooted form, not a document-model address. A document-model path roots at main or card.

Source

pub fn main() -> Self

The main-card root, main — the base every main-card address extends (main.title, main.recipients[0].name, main.body).

Source

pub fn main_body() -> Self

The main body anchor, main.body.

Source

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>].

Source

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.

Source

pub fn index(&self, index: usize) -> Self

This path extended by an array index segment.

Source

pub fn body(&self) -> Self

This path extended by the terminal body segment.

Source

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.

Source

pub fn segs(&self) -> &[DocSeg]

The segments, head first.

Trait Implementations§

Source§

impl Clone for DocPath

Source§

fn clone(&self) -> DocPath

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for DocPath

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for DocPath

Source§

fn default() -> DocPath

Returns the “default value” for a type. Read more
Source§

impl<'de> Deserialize<'de> for DocPath

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Display for DocPath

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

The one document-model path serializer. A Field takes a leading . unless it heads the path; Index and Body never do; the card and main roots are self-contained heads.

Source§

impl Eq for DocPath

Source§

impl FromStr for DocPath

Source§

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

The associated error which can be returned from parsing.
Source§

impl Hash for DocPath

Source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for DocPath

Source§

fn eq(&self, other: &DocPath) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for DocPath

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for DocPath

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.