Struct ibc::core::ics24_host::identifier::ClientId
source · [−]pub struct ClientId(_);
Implementations
sourceimpl ClientId
impl ClientId
sourcepub fn new(ctype: ClientType, counter: u64) -> Result<Self, ValidationError>
pub fn new(ctype: 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::Tendermint, 0);
assert!(tm_client_id.is_ok());
tm_client_id.map(|id| { assert_eq!(&id, "07-tendermint-0") });
sourcepub fn prefix(client_type: ClientType) -> &'static str
pub fn prefix(client_type: ClientType) -> &'static str
Returns one of the prefixes that should be present in any client identifiers. The prefix is deterministic for a given chain type, hence all clients for a Tendermint-type chain, for example, will have the prefix ‘07-tendermint’.
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) -> Self
fn max(self, other: Self) -> Self
Compares and returns the maximum of two values. Read more
1.21.0 · sourcefn min(self, other: Self) -> Self
fn min(self, other: Self) -> Self
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Self where
Self: PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialEq<ClientId> for ClientId
impl PartialEq<ClientId> for ClientId
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>
This method returns an ordering between self
and other
values if one exists. Read more
1.0.0 · sourcefn lt(&self, other: &Rhs) -> bool
fn lt(&self, other: &Rhs) -> bool
This method tests less than (for self
and other
) and is used by the <
operator. Read more
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 more
impl 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 T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
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
sourceimpl<T> Instrument for T
impl<T> Instrument for T
sourcefn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
sourcefn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
sourceimpl<T> WithSubscriber for T
impl<T> WithSubscriber for T
sourcefn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
Attaches the provided Subscriber
to this type, returning a
WithDispatch
wrapper. Read more
sourcefn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
Attaches the current default Subscriber
to this type, returning a
WithDispatch
wrapper. Read more