pub struct Hash {
pub bytes: Option<BytesData>,
pub hash_format_type: i32,
pub hash_type: i32,
}Fields§
§bytes: Option<BytesData>§hash_format_type: i32§hash_type: i32Implementations§
Source§impl Hash
impl Hash
Sourcepub fn hash_format_type(&self) -> HashFormatType
pub fn hash_format_type(&self) -> HashFormatType
Returns the enum value of hash_format_type, or the default if the field is set to an invalid enum value.
Sourcepub fn set_hash_format_type(&mut self, value: HashFormatType)
pub fn set_hash_format_type(&mut self, value: HashFormatType)
Sets hash_format_type to the provided enum value.
Sourcepub fn hash_type(&self) -> HashType
pub fn hash_type(&self) -> HashType
Returns the enum value of hash_type, or the default if the field is set to an invalid enum value.
Sourcepub fn set_hash_type(&mut self, value: HashType)
pub fn set_hash_type(&mut self, value: HashType)
Sets hash_type to the provided enum value.
Source§impl Hash
impl Hash
pub fn raw_bytes_hex(&self) -> RgResult<String>
pub fn raw_bytes(&self) -> RgResult<Vec<u8>>
pub fn vec(&self) -> Vec<u8> ⓘ
pub fn hex(&self) -> String
pub fn new_from_proto(vec: Vec<u8>) -> RgResult<Self>
pub fn new_direct_transaction(vec: &Vec<u8>) -> Self
pub fn from_raw_hex_transaction(h: impl Into<String>) -> RgResult<Self>
pub fn validate_size(&self) -> Result<&Self, ErrorInfo>
pub fn from_hex<S: Into<String>>(s: S) -> Result<Self, ErrorInfo>
pub fn from_string_calculate(s: &str) -> Self
pub fn digest(s: Vec<u8>) -> Self
pub fn div_mod(&self, bucket: usize) -> i64
pub fn merkle_combine(&self, right: Hash) -> Self
pub fn checksum_no_calc(&self) -> Vec<u8> ⓘ
pub fn checksum_hex(&self) -> String
pub fn xor_vec(&self, other: Hash) -> Vec<u8> ⓘ
pub fn xor_distance(&self, other: Hash) -> u64
pub fn new_checksum(s: &Vec<u8>) -> String
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Hash
impl<'de> Deserialize<'de> for Hash
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Message for Hash
impl Message for Hash
Source§fn encoded_len(&self) -> usize
fn encoded_len(&self) -> usize
Returns the encoded length of the message without a length delimiter.
Source§fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Encodes the message to a buffer. Read more
Source§fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Encodes the message to a newly allocated buffer.
Source§fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
fn encode_length_delimited<B>(&self, buf: &mut B) -> Result<(), EncodeError>
Encodes the message with a length-delimiter to a buffer. Read more
Source§fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
fn encode_length_delimited_to_vec(&self) -> Vec<u8> ⓘwhere
Self: Sized,
Encodes the message with a length-delimiter to a newly allocated buffer.
Source§fn decode<B>(buf: B) -> Result<Self, DecodeError>
fn decode<B>(buf: B) -> Result<Self, DecodeError>
Decodes an instance of the message from a buffer. Read more
Source§fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
fn decode_length_delimited<B>(buf: B) -> Result<Self, DecodeError>
Decodes a length-delimited instance of the message from the buffer.
Source§fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge<B>(&mut self, buf: B) -> Result<(), DecodeError>
Decodes an instance of the message from a buffer, and merges it into
self. Read moreSource§fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
fn merge_length_delimited<B>(&mut self, buf: B) -> Result<(), DecodeError>
Decodes a length-delimited instance of the message from buffer, and
merges it into
self.impl Eq for Hash
impl StructuralPartialEq for Hash
Auto Trait Implementations§
impl Freeze for Hash
impl RefUnwindSafe for Hash
impl Send for Hash
impl Sync for Hash
impl Unpin for Hash
impl UnwindSafe for Hash
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
Compare self to
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>
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