pub struct FileId {
pub shard: u64,
pub realm: u64,
pub num: u64,
pub checksum: Option<Checksum>,
}
Expand description
The unique identifier for a file on Hiero.
Fields§
§shard: u64
The shard number.
realm: u64
The realm number.
num: u64
The file number.
checksum: Option<Checksum>
A checksum if the file ID was read from a user inputted string which inclueded a checksum
Implementations§
Source§impl FileId
impl FileId
Sourcepub const ADDRESS_BOOK: Self
👎Deprecated: use get_address_book_file_id_for
instead
pub const ADDRESS_BOOK: Self
get_address_book_file_id_for
insteadAddress of the public node address book for the current network.
Sourcepub const FEE_SCHEDULE: Self
👎Deprecated: use get_fee_schedule_file_id_for
instead
pub const FEE_SCHEDULE: Self
get_fee_schedule_file_id_for
insteadAddress of the current fee schedule for the network.
Sourcepub const EXCHANGE_RATES: Self
👎Deprecated: use get_exchange_rates_file_id_for
instead
pub const EXCHANGE_RATES: Self
get_exchange_rates_file_id_for
insteadAddress of the current exchange rate of HBAR to USD.
Sourcepub const fn new(shard: u64, realm: u64, num: u64) -> Self
pub const fn new(shard: u64, realm: u64, num: u64) -> Self
Create a FileId
with the given shard.realm.num
.
Sourcepub fn get_address_book_file_id_for(realm: u64, shard: u64) -> Self
pub fn get_address_book_file_id_for(realm: u64, shard: u64) -> Self
Address of the public node address book for the current network.
Sourcepub fn get_fee_schedule_file_id_for(realm: u64, shard: u64) -> Self
pub fn get_fee_schedule_file_id_for(realm: u64, shard: u64) -> Self
Address of the current fee schedule for the network.
Sourcepub fn get_exchange_rates_file_id_for(realm: u64, shard: u64) -> Self
pub fn get_exchange_rates_file_id_for(realm: u64, shard: u64) -> Self
Address of the current exchange rate of HBAR to USD.
Sourcepub fn from_bytes(bytes: &[u8]) -> Result<Self>
pub fn from_bytes(bytes: &[u8]) -> Result<Self>
Create a new FileId
from protobuf-encoded bytes
.
§Errors
Error::FromProtobuf
if decoding the bytes fails to produce a valid protobuf.Error::FromProtobuf
if decoding the protobuf fails.
Sourcepub fn from_solidity_address(address: &str) -> Result<Self>
pub fn from_solidity_address(address: &str) -> Result<Self>
Create a FileId
from a solidity address.
§Errors
Error::BasicParse
ifaddress
cannot be parsed as a solidity address.
Sourcepub fn to_solidity_address(&self) -> Result<String>
pub fn to_solidity_address(&self) -> Result<String>
Convert self
into a solidity address
§Errors
Error::BasicParse
ifself.shard
is larger thanu32::MAX
.
Sourcepub fn to_string_with_checksum(&self, client: &Client) -> String
pub fn to_string_with_checksum(&self, client: &Client) -> String
Convert self
to a string with a valid checksum.
Sourcepub fn validate_checksum(&self, client: &Client) -> Result<(), Error>
pub fn validate_checksum(&self, client: &Client) -> Result<(), Error>
Validates self.checksum
(if it exists) for client
.
§Errors
Error::BadEntityId
if there is a checksum, and the checksum is not valid for the client’sledger_id
.
Trait Implementations§
impl Copy for FileId
impl Eq for FileId
impl StructuralPartialEq for FileId
Auto Trait Implementations§
impl Freeze for FileId
impl RefUnwindSafe for FileId
impl Send for FileId
impl Sync for FileId
impl Unpin for FileId
impl UnwindSafe for FileId
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> 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§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.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> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T
in a tonic::Request