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 get_expiration_timestamp_secs(&self) -> u32
pub fn get_expiration_timestamp_secs(&self) -> u32
Get expiration timestamp in seconds.
The expiration timestamp in seconds is stored in the most significant 32 bits of the expiry field.
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_expiry(&mut self, expiry: u64)
pub fn set_expiry(&mut self, expiry: u64)
Set statement expiry.
Sourcepub fn set_expiry_from_parts(
&mut self,
expiration_timestamp_secs: u32,
sequence_number: u32,
)
pub fn set_expiry_from_parts( &mut self, expiration_timestamp_secs: u32, sequence_number: u32, )
Set statement expiry from its parts. See Statement::expiry for details on the format.
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 TypeInfo for Statement
Note: The TypeInfo implementation reflects the actual encoding format (Vec<Field>)
rather than the struct fields, since Statement has custom Encode/Decode implementations.
impl TypeInfo for Statement
Note: The TypeInfo implementation reflects the actual encoding format (Vec<Field>)
rather than the struct fields, since Statement has custom Encode/Decode implementations.
impl DecodeWithMemTracking 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 UnsafeUnpin 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§impl<T> DecodeLimit for Twhere
T: Decode,
impl<T> DecodeLimit for Twhere
T: Decode,
Source§impl<T> DecodeWithMemLimit for Twhere
T: DecodeWithMemTracking,
impl<T> DecodeWithMemLimit for Twhere
T: DecodeWithMemTracking,
Source§impl<T, U> DefensiveTruncateInto<U> for Twhere
U: DefensiveTruncateFrom<T>,
impl<T, U> DefensiveTruncateInto<U> for Twhere
U: DefensiveTruncateFrom<T>,
Source§fn defensive_truncate_into(self) -> U
fn defensive_truncate_into(self) -> U
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.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> 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<Src, Dest> IntoTuple<Dest> for Srcwhere
Dest: FromTuple<Src>,
impl<Src, Dest> IntoTuple<Dest> for Srcwhere
Dest: FromTuple<Src>,
fn into_tuple(self) -> Dest
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<T, U> TryIntoKey<U> for Twhere
U: TryFromKey<T>,
impl<T, U> TryIntoKey<U> for Twhere
U: TryFromKey<T>,
type Error = <U as TryFromKey<T>>::Error
fn try_into_key(self) -> Result<U, <U as TryFromKey<T>>::Error>
Source§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.