Skip to main content

Verified

Struct Verified 

Source
pub struct Verified {
    pub id: String,
    pub cert: Certificate,
    pub expires_at: UtcDateTime,
}
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: UtcDateTime

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: UtcDateTime) -> bool

Whether the certificate has expired at now: now is not before its expires_at.

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 automate_options(&self) -> Option<&[String]>

The options a v1.3 certificate’s consumer automates; None before v1.3. A consumer refuses a certificate whose list differs from the options it automates (spec v1.3 §4).

Source

pub fn automated_for(&self, segment: Option<&str>) -> Option<&Automated>

The automated cases of the test that decides a case in segment (a certified segment’s own, else the top level’s): their share and error. None before v1.3.

Source

pub fn cost(&self) -> Option<&Cost>

A v1.4 selective_cost certificate’s costs; None otherwise. A consumer refuses a certificate whose matrix differs from the costs it is configured with (spec v1.4 §4), and reports the bound as alpha * c_max in unit.

Source

pub fn sequential(&self) -> Option<&Sequential>

A v1.6 certificate’s attempt, pre-registration citation, records and per-class results; None before v1.6.

Source

pub fn attempt_role(&self) -> Option<&AttemptRole>

A v1.7 certificate’s role, the champion a challenger runs beside, and its delta budget; None before v1.7.

Source

pub fn tenant(&self) -> Option<&str>

A v1.5 certificate’s tenant (equal to the expected tenant it was verified with); None before v1.5.

Source

pub fn signer(&self) -> Option<&Signer>

Who signed a v1.5 certificate; None before v1.5.

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§

§

impl Forget for Verified

§

impl Freeze for Verified

§

impl Move for Verified

§

impl RefUnwindSafe for Verified

§

impl Send for Verified
where RawVecInner: Send, NodeRef<Owned, String, f64, LeafOrInternal>: Send, BoxRaw<(String, f64)>: Send, NonZero<i32>: Send,

§

impl Sync for Verified
where RawVecInner: Sync, NodeRef<Owned, String, f64, LeafOrInternal>: Sync, BoxRaw<(String, f64)>: Sync, NonZero<i32>: Sync,

§

impl Unpin for Verified
where *const u8 is !null: Unpin, *const LeafNode<String, f64> is !null: Unpin, Box<(String, f64)>: Unpin, NonZero<i32>: Unpin,

§

impl UnsafeUnpin for Verified

§

impl UnwindSafe for Verified

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.