Struct ibc_types_core_client::ClientId
source · pub struct ClientId(/* private fields */);
Expand description
An IBC 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 “-”.
Implementations§
source§impl ClientId
impl ClientId
sourcepub fn new(
client_type: ClientType,
counter: u64
) -> Result<Self, IdentifierError>
pub fn new( client_type: ClientType, counter: u64 ) -> Result<Self, IdentifierError>
Construct a new client identifier from a client type and a counter.
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<ClientId> for str
impl PartialEq<ClientId> for str
source§impl PartialEq<str> for ClientId
impl PartialEq<str> for ClientId
Equality check against string literal (satisfies &ClientId == &str).
let client_id = ClientId::from_str("clientidtwo");
assert!(client_id.is_ok());
client_id.map(|id| {assert_eq!(&id, "clientidtwo")});
source§impl PartialEq for ClientId
impl PartialEq for ClientId
source§impl PartialOrd for ClientId
impl PartialOrd 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 moreimpl Eq for ClientId
impl StructuralPartialEq for ClientId
Auto Trait Implementations§
impl Freeze for ClientId
impl RefUnwindSafe for ClientId
impl Send for ClientId
impl Sync for ClientId
impl Unpin for ClientId
impl UnwindSafe for ClientId
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