Skip to main content

PathLints

Struct PathLints 

Source
pub struct PathLints<'a> { /* private fields */ }
Expand description

A linted path.

This is returned by Network::lint_path.

The lifetimes 'a and 'b have the same meaning as for Store: 'a is the lifetime of the object on the backend, 'b is the lifetime of the reference to the object, and the object ('a) must outlive the reference ('b).

Implementations§

Source§

impl<'a> PathLints<'a>

Source

pub fn certification_network(&self) -> bool

Returns whether the path is in a certification network.

In a certification network, depth constraints and regular expressions are ignored.

Source

pub fn root(&self) -> &CertLints<'a>

Returns the path’s root.

Source

pub fn target(&self) -> &CertLints<'a>

Returns the last node in the path.

Source

pub fn certs(&self) -> impl Iterator<Item = &CertLints<'a>>

Returns an iterator over the certificates.

Source

pub fn len(&self) -> usize

Returns the number of nodes (certificates) in the path.

Source

pub fn certifications(&self) -> impl Iterator<Item = &CertificationLints>

Returns an iterator over the certifications.

Source

pub fn amount(&self) -> usize

Returns the amount that the target is trusted.

120 usually means fully trusted. This function checks that there are no errors, that each certification’s depth parameter is sufficient for the rest of the path, and that the regular expression constraints are respected.

Source

pub fn to_path(self) -> Result<Path>

Converts the PathLints into a Path.

This fails if the path is invalid. Note: the path is still considered valid even if it doesn’t have the required trust amount as passed to Network::lint_path.

There may be multiple reasons why a path is invalid. This function tries to return the first (when checking from the root towards the target) reason why it is not valid.

Trait Implementations§

Source§

impl<'a> Debug for PathLints<'a>

Source§

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

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

impl<'a> From<&Path> for PathLints<'a>

Source§

fn from(path: &Path) -> PathLints<'a>

Converts to this type from the input type.

Auto Trait Implementations§

§

impl<'a> Freeze for PathLints<'a>

§

impl<'a> RefUnwindSafe for PathLints<'a>

§

impl<'a> Send for PathLints<'a>

§

impl<'a> Sync for PathLints<'a>

§

impl<'a> Unpin for PathLints<'a>

§

impl<'a> UnsafeUnpin for PathLints<'a>

§

impl<'a> UnwindSafe for PathLints<'a>

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

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

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