Struct ibc_app_nft_transfer_types::TracePath
source · pub struct TracePath(/* private fields */);
Expand description
A full trace path modelled as a collection of TracePrefix
s.
Internally, the TracePath
is modelled as a Vec<TracePrefix>
but with the order reversed, i.e.
“transfer/channel-0/transfer/channel-1/uatom” => ["transfer/channel-1", "transfer/channel-0"]
This is done for ease of addition/removal of prefixes.
Implementations§
source§impl TracePath
impl TracePath
sourcepub fn starts_with(&self, prefix: &TracePrefix) -> bool
pub fn starts_with(&self, prefix: &TracePrefix) -> bool
Returns true iff this path starts with the specified prefix
sourcepub fn remove_prefix(&mut self, prefix: &TracePrefix)
pub fn remove_prefix(&mut self, prefix: &TracePrefix)
Removes the specified prefix from the path if there is a match, otherwise does nothing.
sourcepub fn add_prefix(&mut self, prefix: TracePrefix)
pub fn add_prefix(&mut self, prefix: TracePrefix)
Adds the specified prefix to the path.
sourcepub fn trim(s: &str) -> (TracePath, Option<&str>)
pub fn trim(s: &str) -> (TracePath, Option<&str>)
Returns a string slice with TracePath
or all TracePrefix
es repeatedly removed.
If the string starts with a TracePath
, it returns a tuple of the removed
TracePath
and the substring after the TracePath
.
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 contain any TracePrefix
, it returns the original string.
This method is analogous to trim_start_matches
from the standard library.
Trait Implementations§
source§impl BorshDeserialize for TracePath
impl BorshDeserialize for TracePath
fn deserialize_reader<__R>(reader: &mut __R) -> Result<TracePath, 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 TracePath
impl BorshSerialize for TracePath
source§impl Decode for TracePath
impl Decode for TracePath
source§fn decode<__CodecInputEdqy>(
__codec_input_edqy: &mut __CodecInputEdqy,
) -> Result<TracePath, Error>where
__CodecInputEdqy: Input,
fn decode<__CodecInputEdqy>(
__codec_input_edqy: &mut __CodecInputEdqy,
) -> Result<TracePath, 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 TracePath
impl<'de> Deserialize<'de> for TracePath
source§fn deserialize<__D>(
__deserializer: __D,
) -> Result<TracePath, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D,
) -> Result<TracePath, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
source§impl Encode for TracePath
impl Encode for TracePath
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<__CodecOutputReturn, __CodecUsingEncodedCallback>(
&self,
f: __CodecUsingEncodedCallback,
) -> __CodecOutputReturn
fn using_encoded<__CodecOutputReturn, __CodecUsingEncodedCallback>( &self, f: __CodecUsingEncodedCallback, ) -> __CodecOutputReturn
source§fn encoded_size(&self) -> usize
fn encoded_size(&self) -> usize
source§impl JsonSchema for TracePath
impl JsonSchema for TracePath
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 TracePath
impl Ord for TracePath
source§impl PartialOrd for TracePath
impl PartialOrd for TracePath
source§impl Serialize for TracePath
impl Serialize for TracePath
source§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,
impl EncodeLike for TracePath
impl Eq for TracePath
impl StructuralPartialEq for TracePath
Auto Trait Implementations§
impl Freeze for TracePath
impl RefUnwindSafe for TracePath
impl Send for TracePath
impl Sync for TracePath
impl Unpin for TracePath
impl UnwindSafe for TracePath
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
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)