pub struct SignedHashed<T>where
T: HashableContent,{
pub hashed: HoloHashed<T>,
pub signature: Signature,
}
Expand description
Any content that has been hashed and signed.
Fields§
§hashed: HoloHashed<T>
The hashed content.
signature: Signature
The signature of the content.
Implementations§
§impl<T> SignedHashed<T>where
T: HashableContent,
<T as HashableContent>::HashType: HashTypeSync,
impl<T> SignedHashed<T>where T: HashableContent, <T as HashableContent>::HashType: HashTypeSync,
pub fn new(content: T, signature: Signature) -> SignedHashed<T>
pub fn new(content: T, signature: Signature) -> SignedHashed<T>
Create a new signed and hashed content by hashing the content.
§impl<T> SignedHashed<T>where
T: HashableContent,
impl<T> SignedHashed<T>where T: HashableContent,
pub fn into_inner(self) -> (HoloHashed<T>, Signature)
pub fn into_inner(self) -> (HoloHashed<T>, Signature)
Destructure into a HoloHashed
and Signature
.
pub fn as_hash(&self) -> &HoloHash<<T as HashableContent>::HashType>
pub fn as_hash(&self) -> &HoloHash<<T as HashableContent>::HashType>
Access the already-calculated hash stored in this wrapper type.
pub fn with_presigned(
hashed: HoloHashed<T>,
signature: Signature
) -> SignedHashed<T>
pub fn with_presigned( hashed: HoloHashed<T>, signature: Signature ) -> SignedHashed<T>
Create with an existing signature.
§impl SignedHashed<Action>
impl SignedHashed<Action>
pub fn action_address(&self) -> &HoloHash<Action>
pub fn action_address(&self) -> &HoloHash<Action>
Access the Action Hash.
pub fn raw_from_same_hash<T>(other: SignedHashed<T>) -> SignedHashed<Action>where
T: Into<Action> + HashableContent<HashType = Action>,
pub fn raw_from_same_hash<T>(other: SignedHashed<T>) -> SignedHashed<Action>where T: Into<Action> + HashableContent<HashType = Action>,
Create a new SignedActionHashed from a type that implements into Action
and
has the same hash bytes.
The caller must make sure the hash does not change.
Trait Implementations§
§impl<'a, T> Arbitrary<'a> for SignedHashed<T>where
T: HashableContent + Arbitrary<'a>,
<T as HashableContent>::HashType: PrimitiveHashType,
impl<'a, T> Arbitrary<'a> for SignedHashed<T>where T: HashableContent + Arbitrary<'a>, <T as HashableContent>::HashType: PrimitiveHashType,
§fn arbitrary(u: &mut Unstructured<'a>) -> Result<SignedHashed<T>, Error>
fn arbitrary(u: &mut Unstructured<'a>) -> Result<SignedHashed<T>, Error>
Generate an arbitrary value of
Self
from the given unstructured data. Read more§fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
Generate an arbitrary value of
Self
from the entirety of the given
unstructured data. Read more§impl AsRef<SignedHashed<Action>> for RegisterAgentActivity
impl AsRef<SignedHashed<Action>> for RegisterAgentActivity
§fn as_ref(&self) -> &SignedHashed<Action>
fn as_ref(&self) -> &SignedHashed<Action>
Converts this type into a shared reference of the (usually inferred) input type.
§impl AsRef<SignedHashed<Action>> for SignedHashed<Action>
impl AsRef<SignedHashed<Action>> for SignedHashed<Action>
§fn as_ref(&self) -> &SignedHashed<Action>
fn as_ref(&self) -> &SignedHashed<Action>
Converts this type into a shared reference of the (usually inferred) input type.
source§impl ChainItem for SignedHashed<Action>
impl ChainItem for SignedHashed<Action>
§impl<T> Clone for SignedHashed<T>where
T: Clone + HashableContent,
impl<T> Clone for SignedHashed<T>where T: Clone + HashableContent,
§fn clone(&self) -> SignedHashed<T>
fn clone(&self) -> SignedHashed<T>
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read more§impl<T> Debug for SignedHashed<T>where
T: Debug + HashableContent,
impl<T> Debug for SignedHashed<T>where T: Debug + HashableContent,
§impl<'de, T> Deserialize<'de> for SignedHashed<T>where
T: HashableContent + Deserialize<'de>,
impl<'de, T> Deserialize<'de> for SignedHashed<T>where T: HashableContent + Deserialize<'de>,
§fn deserialize<__D>(
__deserializer: __D
) -> Result<SignedHashed<T>, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>( __deserializer: __D ) -> Result<SignedHashed<T>, <__D as Deserializer<'de>>::Error>where __D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl From<SignedHashed<Action>> for Action
impl From<SignedHashed<Action>> for Action
§fn from(signed_action_hashed: SignedHashed<Action>) -> Action
fn from(signed_action_hashed: SignedHashed<Action>) -> Action
Converts to this type from the input type.
source§impl From<SignedHashed<Action>> for SignedAction
impl From<SignedHashed<Action>> for SignedAction
source§fn from(shh: SignedHashed<Action>) -> SignedAction
fn from(shh: SignedHashed<Action>) -> SignedAction
Converts to this type from the input type.
§impl<T> From<SignedHashed<T>> for HoloHashed<T>where
T: HashableContent,
impl<T> From<SignedHashed<T>> for HoloHashed<T>where T: HashableContent,
§fn from(sh: SignedHashed<T>) -> HoloHashed<T>
fn from(sh: SignedHashed<T>) -> HoloHashed<T>
Converts to this type from the input type.
source§impl From<TestChainItem> for SignedHashed<Action>
impl From<TestChainItem> for SignedHashed<Action>
source§fn from(a: TestChainItem) -> SignedHashed<Action>
fn from(a: TestChainItem) -> SignedHashed<Action>
Converts to this type from the input type.
§impl<T> Hash for SignedHashed<T>where
T: HashableContent,
impl<T> Hash for SignedHashed<T>where T: HashableContent,
§impl<T> PartialEq<SignedHashed<T>> for SignedHashed<T>where
T: HashableContent,
impl<T> PartialEq<SignedHashed<T>> for SignedHashed<T>where T: HashableContent,
§fn eq(&self, other: &SignedHashed<T>) -> bool
fn eq(&self, other: &SignedHashed<T>) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.§impl<T> Serialize for SignedHashed<T>where
T: HashableContent + Serialize,
impl<T> Serialize for SignedHashed<T>where T: HashableContent + Serialize,
§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
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 SignedActionHashedExt for SignedHashed<Action>
impl SignedActionHashedExt for SignedHashed<Action>
source§fn sign<'life0, 'async_trait>(
keystore: &'life0 MetaLairClient,
action: HoloHashed<Action>
) -> Pin<Box<dyn Future<Output = Result<SignedHashed<Action>, OneErr>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
SignedHashed<Action>: 'async_trait,
fn sign<'life0, 'async_trait>( keystore: &'life0 MetaLairClient, action: HoloHashed<Action> ) -> Pin<Box<dyn Future<Output = Result<SignedHashed<Action>, OneErr>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, SignedHashed<Action>: 'async_trait,
SignedAction constructor
source§fn validate<'life0, 'async_trait>(
&'life0 self
) -> Pin<Box<dyn Future<Output = Result<(), KeystoreError>> + Send + 'async_trait, Global>>where
'life0: 'async_trait,
SignedHashed<Action>: 'async_trait,
fn validate<'life0, 'async_trait>( &'life0 self ) -> Pin<Box<dyn Future<Output = Result<(), KeystoreError>> + Send + 'async_trait, Global>>where 'life0: 'async_trait, SignedHashed<Action>: 'async_trait,
Validates a signed action
source§fn from_content_sync(signed_action: SignedAction) -> SignedHashed<Action>where
SignedHashed<Action>: Sized,
fn from_content_sync(signed_action: SignedAction) -> SignedHashed<Action>where SignedHashed<Action>: Sized,
Create a hash from data
source§impl TryFrom<SignedHashed<Action>> for WireDelete
impl TryFrom<SignedHashed<Action>> for WireDelete
§type Error = WrongActionError
type Error = WrongActionError
The type returned in the event of a conversion error.
source§fn try_from(
shh: SignedHashed<Action>
) -> Result<WireDelete, <WireDelete as TryFrom<SignedHashed<Action>>>::Error>
fn try_from( shh: SignedHashed<Action> ) -> Result<WireDelete, <WireDelete as TryFrom<SignedHashed<Action>>>::Error>
Performs the conversion.
source§impl TryFrom<SignedHashed<Action>> for WireNewEntryAction
impl TryFrom<SignedHashed<Action>> for WireNewEntryAction
§type Error = ActionError
type Error = ActionError
The type returned in the event of a conversion error.
source§fn try_from(
shh: SignedHashed<Action>
) -> Result<WireNewEntryAction, <WireNewEntryAction as TryFrom<SignedHashed<Action>>>::Error>
fn try_from( shh: SignedHashed<Action> ) -> Result<WireNewEntryAction, <WireNewEntryAction as TryFrom<SignedHashed<Action>>>::Error>
Performs the conversion.
source§impl TryFrom<SignedHashed<Action>> for WireUpdate
impl TryFrom<SignedHashed<Action>> for WireUpdate
§type Error = WrongActionError
type Error = WrongActionError
The type returned in the event of a conversion error.
source§fn try_from(
shh: SignedHashed<Action>
) -> Result<WireUpdate, <WireUpdate as TryFrom<SignedHashed<Action>>>::Error>
fn try_from( shh: SignedHashed<Action> ) -> Result<WireUpdate, <WireUpdate as TryFrom<SignedHashed<Action>>>::Error>
Performs the conversion.
source§impl TryFrom<SignedHashed<Action>> for WireUpdateRelationship
impl TryFrom<SignedHashed<Action>> for WireUpdateRelationship
§type Error = WrongActionError
type Error = WrongActionError
The type returned in the event of a conversion error.
source§fn try_from(
shh: SignedHashed<Action>
) -> Result<WireUpdateRelationship, <WireUpdateRelationship as TryFrom<SignedHashed<Action>>>::Error>
fn try_from( shh: SignedHashed<Action> ) -> Result<WireUpdateRelationship, <WireUpdateRelationship as TryFrom<SignedHashed<Action>>>::Error>
Performs the conversion.
impl<T> Eq for SignedHashed<T>where T: Eq + HashableContent,
impl<T> StructuralEq for SignedHashed<T>where T: HashableContent,
Auto Trait Implementations§
impl<T> RefUnwindSafe for SignedHashed<T>where T: RefUnwindSafe, <T as HashableContent>::HashType: RefUnwindSafe,
impl<T> Send for SignedHashed<T>where T: Send, <T as HashableContent>::HashType: Send,
impl<T> Sync for SignedHashed<T>where T: Sync, <T as HashableContent>::HashType: Sync,
impl<T> Unpin for SignedHashed<T>where T: Unpin, <T as HashableContent>::HashType: Unpin,
impl<T> UnwindSafe for SignedHashed<T>where T: UnwindSafe, <T as HashableContent>::HashType: UnwindSafe,
Blanket Implementations§
§impl<T> Any for Twhere
T: Any + ?Sized,
impl<T> Any for Twhere T: Any + ?Sized,
§fn type_id_compat(&self) -> TypeId
fn type_id_compat(&self) -> TypeId
TODO: once 1.33.0 is the minimum supported compiler version, remove
Any::type_id_compat and use StdAny::type_id instead.
https://github.com/rust-lang/rust/issues/27745
§impl<T> ArchivePointee for T
impl<T> ArchivePointee for T
§type ArchivedMetadata = ()
type ArchivedMetadata = ()
The archived version of the pointer metadata for this type.
§fn pointer_metadata(
_: &<T as ArchivePointee>::ArchivedMetadata
) -> <T as Pointee>::Metadata
fn pointer_metadata( _: &<T as ArchivePointee>::ArchivedMetadata ) -> <T as Pointee>::Metadata
Converts some archived metadata to the pointer metadata for itself.
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<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere
W: DeserializeWith<F, T, D>,
D: Fallible + ?Sized,
F: ?Sized,
impl<F, W, T, D> Deserialize<With<T, W>, D> for Fwhere W: DeserializeWith<F, T, D>, D: Fallible + ?Sized, F: ?Sized,
§fn deserialize(
&self,
deserializer: &mut D
) -> Result<With<T, W>, <D as Fallible>::Error>
fn deserialize( &self, deserializer: &mut D ) -> Result<With<T, W>, <D as Fallible>::Error>
Deserializes using the given deserializer
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
fn with_context(self, otel_cx: Context) -> WithContext<Self> ⓘ
§fn with_current_context(self) -> WithContext<Self> ⓘ
fn with_current_context(self) -> WithContext<Self> ⓘ
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
source§impl<T> Instrument for T
impl<T> Instrument for T
source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.§impl<T> Upcastable for Twhere
T: Any + Send + Sync + 'static,
impl<T> Upcastable for Twhere T: Any + Send + Sync + 'static,
§fn upcast_any_ref(&self) -> &(dyn Any + 'static)
fn upcast_any_ref(&self) -> &(dyn Any + 'static)
upcast ref
§fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn upcast_any_mut(&mut self) -> &mut (dyn Any + 'static)
upcast mut ref