Struct ibc::ics24_host::identifier::ChainId [−][src]
This type is subject to future changes.
TODO: ChainId validation is not standardized yet.
is_epoch_format
will most likely be replaced by validate_chain_id()-style function.
See: https://github.com/informalsystems/ibc-rs/pull/304#discussion_r503917283.
Also, contrast with tendermint-rs ChainId
type.
Implementations
impl ChainId
[src]
pub fn new(name: String, version: u64) -> Self
[src]
Creates a new ChainId
given a chain name and an epoch number.
The returned ChainId
will have the format: {chain name}-{epoch number}
.
use ibc::ics24_host::identifier::ChainId; let epoch_number = 10; let id = ChainId::new("chainA".to_string(), epoch_number); assert_eq!(id.version(), epoch_number);
pub fn as_str(&self) -> &str
[src]
Get a reference to the underlying string.
pub fn version(&self) -> u64
[src]
Extract the version from this chain identifier.
pub fn chain_version(chain_id: &str) -> u64
[src]
Extract the version from the given chain identifier.
pub fn is_epoch_format(chain_id: &str) -> bool
[src]
is_epoch_format() checks if a chain_id is in the format required for parsing epochs
The chainID must be in the form: {chainID}-{version}
use ibc::ics24_host::identifier::ChainId; assert_eq!(ChainId::is_epoch_format("chainA-0"), false); assert_eq!(ChainId::is_epoch_format("chainA"), false); assert_eq!(ChainId::is_epoch_format("chainA-1"), true);
Trait Implementations
impl Clone for ChainId
[src]
impl Debug for ChainId
[src]
impl Default for ChainId
[src]
impl<'de> Deserialize<'de> for ChainId
[src]
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error> where
__D: Deserializer<'de>,
[src]
__D: Deserializer<'de>,
impl Display for ChainId
[src]
impl Eq for ChainId
[src]
impl From<Id> for ChainId
[src]
impl FromStr for ChainId
[src]
type Err = ValidationError
The associated error which can be returned from parsing.
fn from_str(id: &str) -> Result<Self, Self::Err>
[src]
impl Hash for ChainId
[src]
fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Ord for ChainId
[src]
fn cmp(&self, other: &ChainId) -> Ordering
[src]
#[must_use]pub fn max(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn min(self, other: Self) -> Self
1.21.0[src]
#[must_use]pub fn clamp(self, min: Self, max: Self) -> Self
1.50.0[src]
impl PartialEq<ChainId> for ChainId
[src]
impl PartialOrd<ChainId> for ChainId
[src]
fn partial_cmp(&self, other: &ChainId) -> Option<Ordering>
[src]
#[must_use]pub fn lt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn le(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn gt(&self, other: &Rhs) -> bool
1.0.0[src]
#[must_use]pub fn ge(&self, other: &Rhs) -> bool
1.0.0[src]
impl Serialize for ChainId
[src]
fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error> where
__S: Serializer,
[src]
__S: Serializer,
impl StructuralEq for ChainId
[src]
impl StructuralPartialEq for ChainId
[src]
impl TryFrom<String> for ChainId
[src]
Auto Trait Implementations
impl RefUnwindSafe for ChainId
impl Send for ChainId
impl Sync for ChainId
impl Unpin for ChainId
impl UnwindSafe for ChainId
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> DeserializeOwned for T where
T: for<'de> Deserialize<'de>,
[src]
T: for<'de> Deserialize<'de>,
impl<T> DynClone for T where
T: Clone,
[src]
T: Clone,
pub fn __clone_box(&self, Private) -> *mut ()
[src]
impl<Q, K> Equivalent<K> for Q where
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
[src]
K: Borrow<Q> + ?Sized,
Q: Eq + ?Sized,
pub fn equivalent(&self, key: &K) -> bool
[src]
impl<T> From<T> for T
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T> Instrument for T
[src]
pub fn instrument(self, span: Span) -> Instrumented<Self>
[src]
pub fn in_current_span(self) -> Instrumented<Self>
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> IntoRequest<T> for T
[src]
pub fn into_request(self) -> Request<T>
[src]
impl<T> Same<T> for T
type Output = T
Should always be Self
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T> ToString for T where
T: Display + ?Sized,
[src]
T: Display + ?Sized,
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
pub fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<V, T> VZip<V> for T where
V: MultiLane<T>,
V: MultiLane<T>,
pub fn vzip(self) -> V
impl<T> WithSubscriber for T
[src]
pub fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> where
S: Into<Dispatch>,
[src]
S: Into<Dispatch>,