Struct sp_statement_store::Statement
source · pub struct Statement { /* private fields */ }
Expand description
Statement structure.
Implementations§
source§impl Statement
impl Statement
sourcepub fn new_with_proof(proof: Proof) -> Statement
pub fn new_with_proof(proof: Proof) -> Statement
Create a new statement with a proof.
sourcepub fn sign_sr25519_public(&mut self, key: &Public) -> bool
pub fn sign_sr25519_public(&mut self, key: &Public) -> bool
Sign with a key that matches given public key in the keystore.
Returns true
if signing worked (private key present etc).
NOTE: This can only be called from the runtime.
sourcepub fn sign_sr25519_private(&mut self, key: &Pair)
pub fn sign_sr25519_private(&mut self, key: &Pair)
Sign with a given private key and add the signature proof field.
sourcepub fn sign_ed25519_public(&mut self, key: &Public) -> bool
pub fn sign_ed25519_public(&mut self, key: &Public) -> bool
Sign with a key that matches given public key in the keystore.
Returns true
if signing worked (private key present etc).
NOTE: This can only be called from the runtime.
sourcepub fn sign_ed25519_private(&mut self, key: &Pair)
pub fn sign_ed25519_private(&mut self, key: &Pair)
Sign with a given private key and add the signature proof field.
sourcepub fn sign_ecdsa_public(&mut self, key: &Public) -> bool
pub fn sign_ecdsa_public(&mut self, key: &Public) -> bool
Sign with a key that matches given public key in the keystore.
Returns true
if signing worked (private key present etc).
NOTE: This can only be called from the runtime.
Returns true
if signing worked (private key present etc).
NOTE: This can only be called from the runtime.
sourcepub fn sign_ecdsa_private(&mut self, key: &Pair)
pub fn sign_ecdsa_private(&mut self, key: &Pair)
Sign with a given private key and add the signature proof field.
sourcepub fn verify_signature(&self) -> SignatureVerificationResult
pub fn verify_signature(&self) -> SignatureVerificationResult
Check proof signature, if any.
sourcepub fn decryption_key(&self) -> Option<DecryptionKey>
pub fn decryption_key(&self) -> Option<DecryptionKey>
Returns decryption key if any.
sourcepub fn account_id(&self) -> Option<AccountId>
pub fn account_id(&self) -> Option<AccountId>
Get proof account id, if any
sourcepub fn remove_proof(&mut self)
pub fn remove_proof(&mut self)
Remove the proof of this statement.
sourcepub fn set_proof(&mut self, proof: Proof)
pub fn set_proof(&mut self, proof: Proof)
Set statement proof. Any existing proof is overwritten.
sourcepub fn set_priority(&mut self, priority: u32)
pub fn set_priority(&mut self, priority: u32)
Set statement priority.
sourcepub fn set_channel(&mut self, channel: Channel)
pub fn set_channel(&mut self, channel: Channel)
Set statement channel.
sourcepub fn set_topic(&mut self, index: usize, topic: Topic)
pub fn set_topic(&mut self, index: usize, topic: Topic)
Set topic by index. Does noting if index is over MAX_TOPICS
.
sourcepub fn set_decryption_key(&mut self, key: DecryptionKey)
pub fn set_decryption_key(&mut self, key: DecryptionKey)
Set decryption key.
sourcepub fn set_plain_data(&mut self, data: Vec<u8>)
pub fn set_plain_data(&mut self, data: Vec<u8>)
Set unencrypted statement data.
Trait Implementations§
source§impl Decode for Statement
impl Decode for Statement
source§fn decode<I: Input>(input: &mut I) -> Result<Self, Error>
fn decode<I: Input>(input: &mut I) -> Result<Self, Error>
source§fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>,
) -> Result<DecodeFinished, Error>where
I: Input,
fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>,
) -> Result<DecodeFinished, Error>where
I: Input,
source§impl Encode for Statement
impl Encode for Statement
source§fn size_hint(&self) -> usize
fn size_hint(&self) -> usize
source§fn encode_to<T>(&self, dest: &mut T)
fn encode_to<T>(&self, dest: &mut T)
source§fn using_encoded<R, F>(&self, f: F) -> R
fn using_encoded<R, F>(&self, f: F) -> R
source§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
source§impl PartialEq for Statement
impl PartialEq for Statement
impl Eq for Statement
impl StructuralPartialEq for Statement
Auto Trait Implementations§
impl Freeze for Statement
impl RefUnwindSafe for Statement
impl Send for Statement
impl Sync for Statement
impl Unpin for Statement
impl UnwindSafe for Statement
Blanket Implementations§
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
source§impl<T> CheckedConversion for T
impl<T> CheckedConversion for T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<T> DecodeLimit for Twhere
T: Decode,
impl<T> DecodeLimit for Twhere
T: Decode,
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<T> FromFFIValue for Twhere
T: PassBy,
impl<T> FromFFIValue for Twhere
T: PassBy,
§type SelfInstance = T
type SelfInstance = T
Self
can be an unsized type, it needs to be represented by a sized type at the host.
This SelfInstance
is the sized type.source§fn from_ffi_value(
context: &mut dyn FunctionContext,
arg: <<T as PassBy>::PassBy as RIType>::FFIType,
) -> Result<T, String>
fn from_ffi_value( context: &mut dyn FunctionContext, arg: <<T as PassBy>::PassBy as RIType>::FFIType, ) -> Result<T, String>
SelfInstance
from the givensource§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> 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>
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>
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 moresource§impl<T> IntoFFIValue for Twhere
T: PassBy,
impl<T> IntoFFIValue for Twhere
T: PassBy,
source§fn into_ffi_value(
self,
context: &mut dyn FunctionContext,
) -> Result<<<T as PassBy>::PassBy as RIType>::FFIType, String>
fn into_ffi_value( self, context: &mut dyn FunctionContext, ) -> Result<<<T as PassBy>::PassBy as RIType>::FFIType, String>
self
into a ffi value.source§impl<T, Outer> IsWrappedBy<Outer> for T
impl<T, Outer> IsWrappedBy<Outer> for T
source§impl<T> SaturatedConversion for T
impl<T> SaturatedConversion for T
source§fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
fn saturated_from<T>(t: T) -> Selfwhere
Self: UniqueSaturatedFrom<T>,
source§fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
fn saturated_into<T>(self) -> Twhere
Self: UniqueSaturatedInto<T>,
T
. Read moresource§impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
impl<S, T> UncheckedInto<T> for Swhere
T: UncheckedFrom<S>,
source§fn unchecked_into(self) -> T
fn unchecked_into(self) -> T
unchecked_from
.source§impl<T, S> UniqueSaturatedInto<T> for S
impl<T, S> UniqueSaturatedInto<T> for S
source§fn unique_saturated_into(self) -> T
fn unique_saturated_into(self) -> T
T
.