pub struct ChainName(/* private fields */);
Expand description
The name of a chain, aka the chain-id without the post-fix number.
ex. cosmoshub-4
-> cosmoshub
, juno-1
-> juno
Implementations§
Source§impl ChainName
impl ChainName
pub fn new(env: &Env) -> Self
pub fn from_chain_id(chain_id: &str) -> Self
pub fn from_string(value: String) -> AbstractResult<Self>
Sourcepub fn verify(&self) -> AbstractResult<()>
pub fn verify(&self) -> AbstractResult<()>
verify the formatting of the chain name
pub fn as_str(&self) -> &str
pub fn into_string(self) -> String
Trait Implementations§
Source§impl<'de> Deserialize<'de> for ChainName
impl<'de> Deserialize<'de> for ChainName
Source§fn 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
Source§impl FromStr for ChainName
impl FromStr for ChainName
Source§type Err = AbstractError
type Err = AbstractError
The associated error which can be returned from parsing.
Source§impl JsonSchema for ChainName
impl JsonSchema for ChainName
Source§fn schema_name() -> String
fn schema_name() -> String
The name of the generated JSON Schema. Read more
Source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
Returns a string that uniquely identifies the schema produced by this type. Read more
Source§fn json_schema(generator: &mut SchemaGenerator) -> Schema
fn json_schema(generator: &mut SchemaGenerator) -> Schema
Generates a JSON Schema for this type. Read more
Source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
Whether JSON Schemas generated for this type should be re-used where possible using the
$ref
keyword. Read moreSource§impl KeyDeserialize for &ChainName
impl KeyDeserialize for &ChainName
Source§impl Ord for ChainName
impl Ord for ChainName
Source§impl PartialOrd for ChainName
impl PartialOrd for ChainName
Source§impl<'a> PrimaryKey<'a> for &ChainName
impl<'a> PrimaryKey<'a> for &ChainName
Source§type Prefix = ()
type Prefix = ()
These associated types need to implement
Prefixer
, so that they can be useful arguments
for prefix()
, sub_prefix()
, and their key-deserializable variants.type SubPrefix = ()
Source§type Suffix = &ChainName
type Suffix = &ChainName
These associated types need to implement
KeyDeserialize
, so that they can be returned from
range_de()
and friends.type SuperSuffix = &ChainName
fn joined_key(&self) -> Vec<u8> ⓘ
fn joined_extra_key(&self, key: &[u8]) -> Vec<u8> ⓘ
impl Eq for ChainName
impl StructuralPartialEq for ChainName
Auto Trait Implementations§
impl Freeze for ChainName
impl RefUnwindSafe for ChainName
impl Send for ChainName
impl Sync for ChainName
impl Unpin for ChainName
impl UnwindSafe for ChainName
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