[−][src]Struct scale_info::Path
Represents the path of a type definition.
This consists of several segments that each have to be a valid Rust identifier. The first segment represents the crate name in which the type has been defined. The last
Rust prelude type may have an empty namespace definition.
Implementations
impl Path
[src]
pub fn new(ident: &'static str, module_path: &'static str) -> Path
[src]
pub fn from_segments<I>(segments: I) -> Result<Path, PathError> where
I: IntoIterator<Item = &'static str>,
[src]
I: IntoIterator<Item = &'static str>,
Create a Path from the given segments
Errors
- If no segments are supplied
- If any of the segments are invalid Rust identifiers
impl<T> Path<T> where
T: Form,
[src]
T: Form,
pub fn segments(&self) -> &[T::String]ⓘ
[src]
Returns the segments of the Path
pub fn is_empty(&self) -> bool
[src]
Returns true
if the path is empty
pub fn ident(&self) -> Option<T::String>
[src]
Get the ident segment of the Path
pub fn namespace(&self) -> &[T::String]ⓘ
[src]
Get the namespace segments of the Path
Trait Implementations
impl<T: Clone + Form> Clone for Path<T> where
T::String: Clone,
[src]
T::String: Clone,
impl<T: Debug + Form> Debug for Path<T> where
T::String: Debug,
[src]
T::String: Debug,
impl<T: Form> Decode for Path<T> where
Vec<T::String>: Decode,
Vec<T::String>: Decode,
[src]
Vec<T::String>: Decode,
Vec<T::String>: Decode,
fn decode<__CodecInputEdqy: Input>(
__codec_input_edqy: &mut __CodecInputEdqy
) -> Result<Self, Error>
[src]
__codec_input_edqy: &mut __CodecInputEdqy
) -> Result<Self, Error>
pub fn skip<I>(input: &mut I) -> Result<(), Error> where
I: Input,
[src]
I: Input,
pub fn encoded_fixed_size() -> Option<usize>
[src]
impl<T> Default for Path<T> where
T: Form,
[src]
T: Form,
impl Display for Path<PortableForm>
[src]
impl<T: Form> Encode for Path<T> where
Vec<T::String>: Encode,
Vec<T::String>: Encode,
[src]
Vec<T::String>: Encode,
Vec<T::String>: Encode,
fn encode_to<__CodecOutputEdqy: Output + ?Sized>(
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy
)
[src]
&self,
__codec_dest_edqy: &mut __CodecOutputEdqy
)
fn encode(&self) -> Vec<u8>ⓘ
[src]
fn using_encoded<R, F: FnOnce(&[u8]) -> R>(&self, f: F) -> R
[src]
pub fn size_hint(&self) -> usize
[src]
pub fn encoded_size(&self) -> usize
[src]
impl<T: Form> EncodeLike<Path<T>> for Path<T> where
Vec<T::String>: Encode,
Vec<T::String>: Encode,
[src]
Vec<T::String>: Encode,
Vec<T::String>: Encode,
impl<T: Eq + Form> Eq for Path<T> where
T::String: Eq,
[src]
T::String: Eq,
impl IntoPortable for Path
[src]
type Output = Path<PortableForm>
The portable version of Self
.
fn into_portable(self, registry: &mut Registry) -> Self::Output
[src]
impl<T: Ord + Form> Ord for Path<T> where
T::String: Ord,
[src]
T::String: Ord,
fn cmp(&self, other: &Path<T>) -> 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<T: PartialEq + Form> PartialEq<Path<T>> for Path<T> where
T::String: PartialEq,
[src]
T::String: PartialEq,
impl<T: PartialOrd + Form> PartialOrd<Path<T>> for Path<T> where
T::String: PartialOrd,
[src]
T::String: PartialOrd,
fn partial_cmp(&self, other: &Path<T>) -> Option<Ordering>
[src]
fn lt(&self, other: &Path<T>) -> bool
[src]
fn le(&self, other: &Path<T>) -> bool
[src]
fn gt(&self, other: &Path<T>) -> bool
[src]
fn ge(&self, other: &Path<T>) -> bool
[src]
impl<T: Form> StructuralEq for Path<T>
[src]
impl<T: Form> StructuralPartialEq for Path<T>
[src]
Auto Trait Implementations
impl<T> RefUnwindSafe for Path<T> where
<T as Form>::String: RefUnwindSafe,
[src]
<T as Form>::String: RefUnwindSafe,
impl<T> Send for Path<T> where
<T as Form>::String: Send,
[src]
<T as Form>::String: Send,
impl<T> Sync for Path<T> where
<T as Form>::String: Sync,
[src]
<T as Form>::String: Sync,
impl<T> Unpin for Path<T> where
<T as Form>::String: Unpin,
[src]
<T as Form>::String: Unpin,
impl<T> UnwindSafe for Path<T> where
<T as Form>::String: UnwindSafe,
[src]
<T as Form>::String: UnwindSafe,
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<S> Codec for S where
S: Encode + Decode,
[src]
S: Encode + Decode,
impl<T> DecodeAll for T where
T: Decode,
[src]
T: Decode,
impl<T> DecodeLimit for T where
T: Decode,
[src]
T: Decode,
pub fn decode_all_with_depth_limit(limit: u32, input: &[u8]) -> Result<T, Error>
[src]
pub fn decode_with_depth_limit(limit: u32, input: &[u8]) -> Result<T, Error>
[src]
impl<'_, '_, T> EncodeLike<&'_ &'_ T> for T where
T: Encode,
[src]
T: Encode,
impl<'_, T> EncodeLike<&'_ T> for T where
T: Encode,
[src]
T: Encode,
impl<'_, T> EncodeLike<&'_ mut T> for T where
T: Encode,
[src]
T: Encode,
impl<T> EncodeLike<Arc<T>> for T where
T: Encode,
[src]
T: Encode,
impl<T> EncodeLike<Box<T, Global>> for T where
T: Encode,
[src]
T: Encode,
impl<'a, T> EncodeLike<Cow<'a, T>> for T where
T: Encode + ToOwned,
[src]
T: Encode + ToOwned,
impl<T> EncodeLike<Rc<T>> for T where
T: Encode,
[src]
T: Encode,
impl<T> From<T> for T
[src]
impl<S> FullCodec for S where
S: Decode + FullEncode,
[src]
S: Decode + FullEncode,
impl<S> FullEncode for S where
S: Encode + EncodeLike<S>,
[src]
S: Encode + EncodeLike<S>,
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> KeyedVec for T where
T: Codec,
[src]
T: Codec,
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>,