Struct ibc::core::ics24_host::identifier::ClientId
source · pub struct ClientId(_);
Implementations
sourceimpl 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
sourceimpl<'de> Deserialize<'de> for ClientId
impl<'de> Deserialize<'de> for ClientId
sourcefn 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
sourceimpl Ord for ClientId
impl Ord for ClientId
1.21.0 · sourcefn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl 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")});
sourceimpl PartialOrd<ClientId> for ClientId
impl PartialOrd<ClientId> for ClientId
sourcefn partial_cmp(&self, other: &ClientId) -> Option<Ordering>
fn partial_cmp(&self, other: &ClientId) -> Option<Ordering>
1.0.0 · sourcefn 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 StructuralEq for ClientId
impl StructuralPartialEq for ClientId
Auto Trait Implementations
impl RefUnwindSafe for ClientId
impl Send for ClientId
impl Sync for ClientId
impl Unpin for ClientId
impl UnwindSafe for ClientId
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more