Struct SealWitness

Source
pub struct SealWitness<Seal>
where Seal: SingleUseSeal,
{ pub published: <Seal as SingleUseSeal>::PubWitness, pub client: <Seal as SingleUseSeal>::CliWitness, /* private fields */ }
Expand description

Seal closing witness, consisting of published and client-side parts.

The seal closing witness commits to the specific SingleUseSeal protocol implementation via its Seal generic parameter.

Fields§

§published: <Seal as SingleUseSeal>::PubWitness

The published part of the single-use seal closing witness.

§client: <Seal as SingleUseSeal>::CliWitness

The client-side part of the single-use seal closing witness.

Implementations§

Source§

impl<Seal> SealWitness<Seal>
where Seal: SingleUseSeal,

Source

pub fn new( published: <Seal as SingleUseSeal>::PubWitness, client: <Seal as SingleUseSeal>::CliWitness, ) -> SealWitness<Seal>

Construct seal closing withness out of published and client-side components.

Source

pub fn verify_seal_closing( &self, seal: impl Borrow<Seal>, message: <Seal as SingleUseSeal>::Message, ) -> Result<(), SealError<Seal>>

Verify that a single seal is correctly closed over the message using the current seal closing witness.

This is the implementation of the single-use seals verigy procedure.

If you have multiple seals closed over the same message, consider calling Self::verify_seals_closing.

Source

pub fn verify_seals_closing( &self, seals: impl IntoIterator<Item = impl Borrow<Seal>>, message: <Seal as SingleUseSeal>::Message, ) -> Result<(), SealError<Seal>>

Verify that all the seals from a set of seals are correctly closed over the single message using the current seal closing witness.

This is the implementation of the single-use seals verigy procedure.

If you have just a single seal, consider calling Self::verify_seal_closing.

Trait Implementations§

Source§

impl<Seal> Clone for SealWitness<Seal>

Source§

fn clone(&self) -> SealWitness<Seal>

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl<Seal> Debug for SealWitness<Seal>

Source§

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

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

impl<'de, Seal> Deserialize<'de> for SealWitness<Seal>
where Seal: SingleUseSeal, <Seal as SingleUseSeal>::PubWitness: Serialize + for<'d> Deserialize<'d>, <Seal as SingleUseSeal>::CliWitness: Serialize + for<'d> Deserialize<'d>,

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<SealWitness<Seal>, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl<Seal> Hash for SealWitness<Seal>
where Seal: Hash + SingleUseSeal, <Seal as SingleUseSeal>::PubWitness: Hash, <Seal as SingleUseSeal>::CliWitness: Hash,

Source§

fn hash<__H>(&self, state: &mut __H)
where __H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl<Seal> PartialEq for SealWitness<Seal>

Source§

fn eq(&self, other: &SealWitness<Seal>) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl<Seal> Serialize for SealWitness<Seal>
where Seal: SingleUseSeal, <Seal as SingleUseSeal>::PubWitness: Serialize + for<'d> Deserialize<'d>, <Seal as SingleUseSeal>::CliWitness: Serialize + for<'d> Deserialize<'d>,

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl<Seal> StrictDecode for SealWitness<Seal>
where Seal: SingleUseSeal,

Source§

fn strict_decode( reader: &mut impl TypedRead, ) -> Result<SealWitness<Seal>, DecodeError>

Source§

fn strict_read(reader: impl ReadRaw) -> Result<Self, DecodeError>

Source§

impl<Seal> StrictDumb for SealWitness<Seal>
where Seal: SingleUseSeal,

Source§

impl<Seal> StrictEncode for SealWitness<Seal>
where Seal: SingleUseSeal,

Source§

fn strict_encode<W>(&self, writer: W) -> Result<W, Error>
where W: TypedWrite,

Source§

fn strict_write(&self, writer: impl WriteRaw) -> Result<(), Error>

Source§

impl<Seal> StrictStruct for SealWitness<Seal>
where Seal: SingleUseSeal,

Source§

impl<Seal> StrictType for SealWitness<Seal>
where Seal: SingleUseSeal,

Source§

const STRICT_LIB_NAME: &'static str = LIB_NAME_SEALS

Source§

fn strict_name() -> Option<TypeName>

Source§

impl<Seal> Copy for SealWitness<Seal>
where Seal: Copy + SingleUseSeal, <Seal as SingleUseSeal>::PubWitness: Copy, <Seal as SingleUseSeal>::CliWitness: Copy,

Source§

impl<Seal> Eq for SealWitness<Seal>
where Seal: Eq + SingleUseSeal, <Seal as SingleUseSeal>::PubWitness: Eq, <Seal as SingleUseSeal>::CliWitness: Eq,

Source§

impl<Seal> StrictProduct for SealWitness<Seal>
where Seal: SingleUseSeal,

Source§

impl<Seal> StructuralPartialEq for SealWitness<Seal>
where Seal: SingleUseSeal,

Auto Trait Implementations§

§

impl<Seal> Freeze for SealWitness<Seal>

§

impl<Seal> RefUnwindSafe for SealWitness<Seal>

§

impl<Seal> Send for SealWitness<Seal>
where <Seal as SingleUseSeal>::PubWitness: Send, <Seal as SingleUseSeal>::CliWitness: Send, Seal: Send,

§

impl<Seal> Sync for SealWitness<Seal>
where <Seal as SingleUseSeal>::PubWitness: Sync, <Seal as SingleUseSeal>::CliWitness: Sync, Seal: Sync,

§

impl<Seal> Unpin for SealWitness<Seal>
where <Seal as SingleUseSeal>::PubWitness: Unpin, <Seal as SingleUseSeal>::CliWitness: Unpin, Seal: Unpin,

§

impl<Seal> UnwindSafe for SealWitness<Seal>

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<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Checks if this value is equivalent to the given key. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
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.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> VerifyEq for T
where T: Eq,

Source§

fn verify_eq(&self, other: &T) -> bool

Verifies commit-equivalence of two instances of the same type.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,