Skip to main content

Verified

Struct Verified 

Source
pub struct Verified {
    pub id: String,
    pub cert: Certificate,
    pub expires_at: DateTime<Utc>,
}
Expand description

A certificate whose signature verified against a trusted key.

Fields§

§id: String

sha256:<hex> of the signed certificate’s JCS bytes.

§cert: Certificate§expires_at: DateTime<Utc>

Implementations§

Source§

impl Verified

Source

pub fn threshold_for(&self, segment: Option<&str>) -> f64

The threshold for a case in segment: a certified segment’s own, else the top-level one.

Source

pub fn is_expired(&self, now: DateTime<Utc>) -> bool

Source

pub fn confidence_bins(&self) -> Option<&[f64]>

The bin edges of a v1.2 certificate’s confidence histograms; None before v1.2.

Source

pub fn histogram_for(&self, segment: Option<&str>) -> Option<&Histogram>

The stored confidence histogram of the cases decided by the same threshold as a case in segment: a certified segment’s own, else the top level’s. None before v1.2, or when the issuer withheld it.

Source

pub fn probabilities(&self, scores: &[f64]) -> Option<Vec<f64>>

The probabilities the certificate’s calibration map gives a case’s raw scores, one per option (spec v1.2 §1, probabilities). None when the map’s kind is not one this crate applies (MAP_KINDS), its params do not fit that kind, or scores does not have one score per option, or the map is dr in a certificate before v1.2, which did not define it. A consumer refuses a certificate whose map it does not apply (spec v1.2 §4).

Source

pub fn confidence(&self, scores: &[f64]) -> Option<f64>

A case’s confidence: the largest of its Verified::probabilities. A case is answered when this is at least Verified::threshold_for its segment (and the rule does not abstain on it).

Source

pub fn temperature(&self) -> Option<f64>

The temperature of a kind: temperature calibration map; None for other kinds.

Trait Implementations§

Source§

impl Clone for Verified

Source§

fn clone(&self) -> Self

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 Verified

Source§

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

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

impl PartialEq for Verified

Source§

fn eq(&self, other: &Self) -> 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 Verified

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 = !

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

fn try_from(value: U) -> Result<T, !>

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.