Skip to main content

ChainBreak

Struct ChainBreak 

Source
#[non_exhaustive]
pub struct ChainBreak { pub rtype: String, pub id: String, pub version_id: i64, pub algorithm: &'static str, pub detail: String, }
Expand description

A break in one resource’s hash chain (spec M3.16, M3.16a).

One break per algorithm, never merged: a regime that recognises only SHA-3 must be able to see the SHA-3 verdict on its own, and a break that appears under one algorithm but not the other is itself worth seeing — it means the stored digests disagree about the same bytes. #[non_exhaustive] so that a future algorithm or field is a patch, not a break: adding a public field to a struct callers can build or destructure exhaustively is a breaking change, and this type gained algorithm exactly that way.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§rtype: String§id: String§version_id: i64§algorithm: &'static str

"sha256" or "sha3-256".

§detail: String

Implementations§

Source§

impl ChainBreak

Source

pub fn new( rtype: impl Into<String>, id: impl Into<String>, version_id: i64, algorithm: &'static str, detail: impl Into<String>, ) -> Self

Record a break.

A constructor rather than a struct literal because this type is #[non_exhaustive]: it gained algorithm after release, and keeping that freedom is the point. A literal can only be written inside this crate, and the ports that detect breaks are outside it, so without this they would have to choose between constructing the type and keeping the guarantee.

Trait Implementations§

Source§

impl Clone for ChainBreak

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 ChainBreak

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Forget for ChainBreak

§

impl Freeze for ChainBreak
where *const u8 is !null: Freeze, PhantomData<u8>: Freeze, &'static str: Freeze,

§

impl Move for ChainBreak

§

impl RefUnwindSafe for ChainBreak

§

impl Send for ChainBreak
where RawVecInner: Send, &'static str: Send,

§

impl Sync for ChainBreak
where RawVecInner: Sync,

§

impl Unpin for ChainBreak
where *const u8 is !null: Unpin, &'static str: Unpin,

§

impl UnsafeUnpin for ChainBreak

§

impl UnwindSafe for ChainBreak
where RawVecInner: UnwindSafe, &'static str: UnwindSafe,

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.