Struct ibc_app_nft_transfer_types::TracePrefix
source · pub struct TracePrefix { /* private fields */ }
Expand description
One hop in a token’s trace, which consists of the port and channel IDs of the sender
For example, given the token my_port-1/my_channel-1/my_port-2/my_channel-2/base_denom
,
my_port-1/my_channel-1
is a trace prefix, and my_port-2/my_channel-2
is another one.
See TracePath which stitches trace prefixes together.
Implementations§
source§impl TracePrefix
impl TracePrefix
pub fn new(port_id: PortId, channel_id: ChannelId) -> TracePrefix
sourcepub fn strip(s: &str) -> Option<(TracePrefix, Option<&str>)>
pub fn strip(s: &str) -> Option<(TracePrefix, Option<&str>)>
Returns a string slice with TracePrefix
removed.
If the string starts with a TracePrefix
, i.e. {port-id}/channel-{id}
,
it returns a tuple of the removed TracePrefix
and the substring after the prefix.
If the substring is empty, it returns None
.
Otherwise the substring starts with /
. In that case,
the leading /
is stripped and returned.
If the string does not start with a TracePrefix
, this method returns None
.
This method is analogous to strip_prefix
from the standard library.
Trait Implementations§
source§impl BorshDeserialize for TracePrefix
impl BorshDeserialize for TracePrefix
fn deserialize_reader<R>(reader: &mut R) -> Result<TracePrefix, Error>where
R: Read,
source§fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
fn deserialize(buf: &mut &[u8]) -> Result<Self, Error>
source§fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_slice(v: &[u8]) -> Result<Self, Error>
fn try_from_reader<R>(reader: &mut R) -> Result<Self, Error>where
R: Read,
source§impl BorshSerialize for TracePrefix
impl BorshSerialize for TracePrefix
source§impl Clone for TracePrefix
impl Clone for TracePrefix
source§fn clone(&self) -> TracePrefix
fn clone(&self) -> TracePrefix
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for TracePrefix
impl Debug for TracePrefix
source§impl Decode for TracePrefix
impl Decode for TracePrefix
source§fn decode<__CodecInputEdqy>(
__codec_input_edqy: &mut __CodecInputEdqy
) -> Result<TracePrefix, Error>where
__CodecInputEdqy: Input,
fn decode<__CodecInputEdqy>(
__codec_input_edqy: &mut __CodecInputEdqy
) -> Result<TracePrefix, Error>where
__CodecInputEdqy: Input,
source§fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>
) -> Result<DecodeFinished, Error>where
I: Input,
fn decode_into<I>(
input: &mut I,
dst: &mut MaybeUninit<Self>
) -> Result<DecodeFinished, Error>where
I: Input,
source§impl<'de> Deserialize<'de> for TracePrefix
impl<'de> Deserialize<'de> for TracePrefix
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<TracePrefix, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<TracePrefix, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
source§impl Display for TracePrefix
impl Display for TracePrefix
source§impl Encode for TracePrefix
impl Encode for TracePrefix
source§fn size_hint(&self) -> usize
fn size_hint(&self) -> usize
source§fn encode_to<__CodecOutputEdqy>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy
)
fn encode_to<__CodecOutputEdqy>( &self, __codec_dest_edqy: &mut __CodecOutputEdqy )
source§fn using_encoded<R, F>(&self, f: F) -> R
fn using_encoded<R, F>(&self, f: F) -> R
source§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
source§impl JsonSchema for TracePrefix
impl JsonSchema for TracePrefix
source§fn schema_name() -> String
fn schema_name() -> String
source§fn schema_id() -> Cow<'static, str>
fn schema_id() -> Cow<'static, str>
source§fn json_schema(gen: &mut SchemaGenerator) -> Schema
fn json_schema(gen: &mut SchemaGenerator) -> Schema
source§fn is_referenceable() -> bool
fn is_referenceable() -> bool
$ref
keyword. Read moresource§impl Ord for TracePrefix
impl Ord for TracePrefix
source§fn cmp(&self, other: &TracePrefix) -> Ordering
fn cmp(&self, other: &TracePrefix) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq for TracePrefix
impl PartialEq for TracePrefix
source§fn eq(&self, other: &TracePrefix) -> bool
fn eq(&self, other: &TracePrefix) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for TracePrefix
impl PartialOrd for TracePrefix
source§fn partial_cmp(&self, other: &TracePrefix) -> Option<Ordering>
fn partial_cmp(&self, other: &TracePrefix) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read more