pub struct SignatureGated<T> { /* private fields */ }
Expand description
A SignatureGated object is a self-signed object that’s well-signed when one or more ValidatableSignature objects are correct.
Implementations§
Source§impl<T> SignatureGated<T>
impl<T> SignatureGated<T>
Sourcepub fn new(obj: T, signatures: Vec<Box<dyn ValidatableSignature>>) -> Self
pub fn new(obj: T, signatures: Vec<Box<dyn ValidatableSignature>>) -> Self
Return a new SignatureGated object that will be treated as correct if every one of the given set of signatures is valid.
Sourcepub fn dangerously_map<F, U>(self, f: F) -> SignatureGated<U>where
F: FnOnce(T) -> U,
pub fn dangerously_map<F, U>(self, f: F) -> SignatureGated<U>where
F: FnOnce(T) -> U,
Consume this SignatureGated
, and return a new one with the same
bounds, applying f
to its protected value.
The caller must ensure that f
does not make any assumptions about the
well-signedness of the protected value, or leak any of its contents in
an inappropriate way.
Trait Implementations§
Source§impl<T> SelfSigned<T> for SignatureGated<T>
impl<T> SelfSigned<T> for SignatureGated<T>
Source§fn dangerously_assume_wellsigned(self) -> T
fn dangerously_assume_wellsigned(self) -> T
Return the underlying object without checking its signature.
Source§fn check_signature(self) -> Result<T, Self::Error>
fn check_signature(self) -> Result<T, Self::Error>
Unwrap this object if the signature is valid
Auto Trait Implementations§
impl<T> Freeze for SignatureGated<T>where
T: Freeze,
impl<T> !RefUnwindSafe for SignatureGated<T>
impl<T> !Send for SignatureGated<T>
impl<T> !Sync for SignatureGated<T>
impl<T> Unpin for SignatureGated<T>where
T: Unpin,
impl<T> !UnwindSafe for SignatureGated<T>
Blanket Implementations§
§impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedExplicit<'a, E> for Twhere
T: 'a,
§impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
impl<'a, T, E> AsTaggedImplicit<'a, E> for Twhere
T: 'a,
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more