Struct ChannelId
pub struct ChannelId(pub String);
Tuple Fields§
§0: String
Implementations§
§impl ChannelId
impl ChannelId
pub fn new(identifier: u64) -> ChannelId
pub fn new(identifier: u64) -> ChannelId
Builds a new channel identifier. Like client and connection identifiers, channel ids are
deterministically formed from two elements: a prefix prefix
, and a monotonically
increasing counter
, separated by a dash “-”.
The prefix is currently determined statically (see ChannelId::prefix()
) so this method
accepts a single argument, the counter
.
use ibc_types_core_channel::ChannelId;
let chan_id = ChannelId::new(27);
assert_eq!(chan_id.to_string(), "channel-27");
Trait Implementations§
§impl<'de> Deserialize<'de> for ChannelId
impl<'de> Deserialize<'de> for ChannelId
§fn deserialize<__D>(
__deserializer: __D,
) -> Result<ChannelId, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<ChannelId, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
§impl Ord for ChannelId
impl Ord for ChannelId
§impl PartialEq<str> for ChannelId
Equality check against string literal (satisfies &ChannelId == &str).
impl PartialEq<str> for ChannelId
Equality check against string literal (satisfies &ChannelId == &str).
use core::str::FromStr;
use ibc_types_core_channel::ChannelId;
let channel_id = ChannelId::from_str("channelId-0");
assert!(channel_id.is_ok());
channel_id.map(|id| {assert_eq!(&id, "channelId-0")});
§impl PartialOrd for ChannelId
impl PartialOrd for ChannelId
§impl Serialize for ChannelId
impl Serialize for ChannelId
§fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S,
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Eq for ChannelId
impl StructuralPartialEq for ChannelId
Auto Trait Implementations§
impl Freeze for ChannelId
impl RefUnwindSafe for ChannelId
impl Send for ChannelId
impl Sync for ChannelId
impl Unpin for ChannelId
impl UnwindSafe for ChannelId
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Checks if this value is equivalent to the given key. Read more
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
Source§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
Wrap the input message
T
in a tonic::Request