Skip to main content

AadPath

Struct AadPath 

Source
pub struct AadPath { /* private fields */ }
Expand description

The stack of string mapping keys from the document root down to a leaf.

Push on the way down, pop on the way back up. Descending into a sequence pushes nothing, which is not an omission — see the module docs.

Implementations§

Source§

impl AadPath

Source

pub fn root() -> Self

A path at the document root.

Source

pub fn push_key(&mut self, key: impl Into<String>)

Descend into a mapping under key.

Source

pub fn pop(&mut self)

Ascend back out of the last mapping.

Source

pub fn within<T>( &mut self, key: impl Into<String>, f: impl FnOnce(&mut Self) -> T, ) -> T

Run f with key pushed, restoring the path afterwards even if f returns early.

The manual push/pop pair is the shape that goes wrong under ?, so the walker uses this instead.

Source

pub fn depth(&self) -> usize

The number of mapping keys from the root.

Source

pub fn components(&self) -> &[String]

The components, for the selector rules — which test every component, not just the leaf’s own key.

Source

pub fn aad(&self) -> Aad

Build the AAD for a leaf at this path.

Exactly strings.Join(path, ":") + ":".

Written as a join-then-append rather than a push-each-with-separator loop, because the two disagree at depth 0: Go’s Join over an empty slice is "", so the AAD at the root is a bare ":", whereas the loop form produces "". That is not a degenerate case nobody reaches — a top-level comment has an empty path, because walkBranch passes item.Key to walkValue with path unchanged. The loop form was the first version of this function and the depth-0 test is what caught it.

Source

pub fn has_ambiguous_component(&self) -> bool

Whether any component contains :, which makes this path’s AAD ambiguous with a differently-nested document.

Upstream neither escapes nor detects this. We reproduce the encoding — the wire is the wire — but we can at least tell a caller, so refusing is a policy decision made in the open instead of a silent collision.

Trait Implementations§

Source§

impl Clone for AadPath

Source§

fn clone(&self) -> AadPath

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 AadPath

Source§

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

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

impl Default for AadPath

Source§

fn default() -> AadPath

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

impl Eq for AadPath

Source§

impl PartialEq for AadPath

Source§

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

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

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

Inequality operator !=. Read more
Source§

impl StructuralPartialEq for AadPath

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> 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> Same for T

Source§

type Output = T

Should always be Self
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, 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.