Struct ibc::core::ics24_host::identifier::ClientId
source · pub struct ClientId(_);Implementations§
source§impl ClientId
impl ClientId
sourcepub fn new(
client_type: ClientType,
counter: u64
) -> Result<Self, ValidationError>
pub fn new(
client_type: ClientType,
counter: u64
) -> Result<Self, ValidationError>
Builds a new client identifier. Client identifiers are deterministically formed from two
elements: a prefix derived from the client type ctype, and a monotonically increasing
counter; these are separated by a dash “-”.
let tm_client_id = ClientId::new(ClientType::new("07-tendermint".to_string()), 0);
assert!(tm_client_id.is_ok());
tm_client_id.map(|id| { assert_eq!(&id, "07-tendermint-0") });Trait Implementations§
source§impl<'de> Deserialize<'de> for ClientId
impl<'de> Deserialize<'de> for ClientId
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 Ord for ClientId
impl Ord for ClientId
source§impl PartialEq<str> for ClientId
impl PartialEq<str> for ClientId
Equality check against string literal (satisfies &ClientId == &str).
use core::str::FromStr;
use ibc::core::ics24_host::identifier::ClientId;
let client_id = ClientId::from_str("clientidtwo");
assert!(client_id.is_ok());
client_id.map(|id| {assert_eq!(&id, "clientidtwo")});source§impl PartialOrd<ClientId> for ClientId
impl PartialOrd<ClientId> for ClientId
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self and other) and is used by the <=
operator. Read more