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

pub struct ConnectionId(_);

Implementations

impl ConnectionId[src]

pub fn new(counter: u64) -> Self[src]

Builds a new connection identifier. Connection identifiers are deterministically formed from two elements: a prefix prefix, and a monotonically increasing counter; these are separated by a dash “-”. The prefix is currently determined statically (see ConnectionId::prefix()) so this method accepts a single argument, the counter.

let conn_id = ConnectionId::new(11);
assert_eq!(&conn_id, "connection-11");

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

Returns the static prefix to be used across all connection identifiers.

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

Get this identifier as a borrowed &str

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

Get this identifier as a borrowed byte slice

Trait Implementations

impl Clone for ConnectionId[src]

impl Debug for ConnectionId[src]

impl Default for ConnectionId[src]

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

impl Display for ConnectionId[src]

This implementation provides a to_string method.

impl Eq for ConnectionId[src]

impl FromStr for ConnectionId[src]

type Err = ValidationError

The associated error which can be returned from parsing.

impl Hash for ConnectionId[src]

impl Ord for ConnectionId[src]

impl PartialEq<ConnectionId> for ConnectionId[src]

impl PartialEq<str> for ConnectionId[src]

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

use std::str::FromStr;
use ibc::ics24_host::identifier::ConnectionId;
let conn_id = ConnectionId::from_str("connectionId-0");
assert!(conn_id.is_ok());
conn_id.map(|id| {assert_eq!(&id, "connectionId-0")});

impl PartialOrd<ConnectionId> for ConnectionId[src]

impl Serialize for ConnectionId[src]

impl StructuralEq for ConnectionId[src]

impl StructuralPartialEq for ConnectionId[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]