Struct ibc::ics24_host::identifier::ClientId[][src]

pub struct ClientId(_);

Implementations

impl ClientId[src]

pub fn new(ctype: ClientType, counter: u64) -> Result<Self, ValidationError>[src]

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") });

pub fn as_str(&self) -> &str[src]

Get this identifier as a borrowed &str

pub fn prefix(client_type: ClientType) -> &'static str[src]

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’.

pub fn as_bytes(&self) -> &[u8][src]

Get this identifier as a borrowed byte slice

Trait Implementations

impl Clone for ClientId[src]

impl Debug for ClientId[src]

impl Default for ClientId[src]

impl<'de> Deserialize<'de> for ClientId[src]

impl Display for ClientId[src]

This implementation provides a to_string method.

impl Eq for ClientId[src]

impl FromStr for ClientId[src]

type Err = ValidationError

The associated error which can be returned from parsing.

impl Hash for ClientId[src]

impl Ord for ClientId[src]

impl PartialEq<ClientId> for ClientId[src]

impl PartialEq<str> for ClientId[src]

Equality check against string literal (satisfies &ClientId == &str).

use std::str::FromStr;
use ibc::ics24_host::identifier::ClientId;
let client_id = ClientId::from_str("clientidtwo");
assert!(client_id.is_ok());
client_id.map(|id| {assert_eq!(&id, "clientidtwo")});

impl PartialOrd<ClientId> for ClientId[src]

impl Serialize for ClientId[src]

impl StructuralEq for ClientId[src]

impl StructuralPartialEq for ClientId[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> DynClone for T where
    T: Clone
[src]

impl<Q, K> Equivalent<K> for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> From<T> for T[src]

impl<T> Instrument for T[src]

impl<T> Instrument for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> IntoRequest<T> for T[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>, 

impl<T> WithSubscriber for T[src]