[−][src]Struct exonum::runtime::CallerAddress
Uniform presentation of a Caller
.
Converting to Address
The address for a Caller
is defined as the SHA-256 digest of its Protobuf serialization.
This ensures that addresses are unique, collision-resistant and domain-separated for different
Caller
types.
For example, to compute an address from a public key, you can use CallerAddress::from_key()
(in Rust code), or create and hash a Caller
Protobuf message (in any programming language).
let public_key = crypto::KeyPair::random().public_key(); let address = CallerAddress::from_key(public_key); let caller = Caller::Transaction { author: public_key }; // Obtain Protobuf serialization of the `Caller`. let caller_pb = caller.to_bytes(); assert_eq!(address.as_ref(), &crypto::hash(&caller_pb)[..]);
Methods
impl CallerAddress
[src]
Trait Implementations
impl AsRef<[u8]> for CallerAddress
[src]
impl BinaryKey for CallerAddress
[src]
fn size(&self) -> usize
[src]
fn write(&self, buffer: &mut [u8]) -> usize
[src]
fn read(buffer: &[u8]) -> Self::Owned
[src]
impl BinaryValue for CallerAddress
[src]
fn to_bytes(&self) -> Vec<u8>
[src]
fn from_bytes(value: Cow<[u8]>) -> Result<Self, Error>
[src]
fn into_bytes(self) -> Vec<u8>
[src]
impl Clone for CallerAddress
[src]
fn clone(&self) -> CallerAddress
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
impl Copy for CallerAddress
[src]
impl Debug for CallerAddress
[src]
impl<'de> Deserialize<'de> for CallerAddress
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Eq for CallerAddress
[src]
impl Hash for CallerAddress
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl ObjectHash for CallerAddress
[src]
fn object_hash(&self) -> Hash
[src]
impl Ord for CallerAddress
[src]
fn cmp(&self, other: &CallerAddress) -> Ordering
[src]
#[must_use]fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]fn clamp(self, min: Self, max: Self) -> Self
[src]
impl PartialEq<CallerAddress> for CallerAddress
[src]
fn eq(&self, other: &CallerAddress) -> bool
[src]
fn ne(&self, other: &CallerAddress) -> bool
[src]
impl PartialOrd<CallerAddress> for CallerAddress
[src]
fn partial_cmp(&self, other: &CallerAddress) -> Option<Ordering>
[src]
fn lt(&self, other: &CallerAddress) -> bool
[src]
fn le(&self, other: &CallerAddress) -> bool
[src]
fn gt(&self, other: &CallerAddress) -> bool
[src]
fn ge(&self, other: &CallerAddress) -> bool
[src]
impl ProtobufConvert for CallerAddress
[src]
type ProtoStruct = Hash
Type generated from the Protobuf definition.
fn to_pb(&self) -> Self::ProtoStruct
[src]
fn from_pb(pb: Self::ProtoStruct) -> Result<Self>
[src]
impl RawKey for CallerAddress
[src]
fn to_raw_key(&self) -> [u8; 32]
[src]
impl Serialize for CallerAddress
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralEq for CallerAddress
[src]
impl StructuralPartialEq for CallerAddress
[src]
Auto Trait Implementations
impl RefUnwindSafe for CallerAddress
impl Send for CallerAddress
impl Sync for CallerAddress
impl Unpin for CallerAddress
impl UnwindSafe for CallerAddress
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: Deserialize<'de>,
[src]
T: Deserialize<'de>,
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToHex for T where
T: AsRef<[u8]>,
[src]
T: AsRef<[u8]>,
fn encode_hex<U>(&self) -> U where
U: FromIterator<char>,
[src]
U: FromIterator<char>,
fn encode_hex_upper<U>(&self) -> U where
U: FromIterator<char>,
[src]
U: FromIterator<char>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,