Struct tetsy_scale_info::Path[][src]

pub struct Path<T: Form = MetaForm> { /* fields omitted */ }

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]

Create a new Path

Panics

  • If the type identifier or module path contain invalid Rust identifiers

pub fn from_segments<I>(segments: I) -> Result<Path, PathError> where
    I: IntoIterator<Item = &'static str>, 
[src]

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]

pub fn segments(&self) -> &[T::String]

Notable traits for &'_ mut [u8]

impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
[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]

Notable traits for &'_ mut [u8]

impl<'_> Write for &'_ mut [u8]impl<'_> Read for &'_ [u8]
[src]

Get the namespace segments of the Path

Trait Implementations

impl<T: Clone + Form> Clone for Path<T> where
    T::String: Clone
[src]

impl<T: Debug + Form> Debug for Path<T> where
    T::String: Debug
[src]

impl<T: Form> Decode for Path<T> where
    Vec<T::String>: Decode,
    Vec<T::String>: Decode
[src]

impl<T> Default for Path<T> where
    T: Form
[src]

impl Display for Path<PortableForm>[src]

impl<T: Form> Encode for Path<T> where
    Vec<T::String>: Encode,
    Vec<T::String>: Encode
[src]

impl<T: Form> EncodeLike<Path<T>> for Path<T> where
    Vec<T::String>: Encode,
    Vec<T::String>: Encode
[src]

impl<T: Eq + Form> Eq for Path<T> where
    T::String: Eq
[src]

impl IntoPortable for Path[src]

type Output = Path<PortableForm>

The portable version of Self.

impl<T: Ord + Form> Ord for Path<T> where
    T::String: Ord
[src]

impl<T: PartialEq + Form> PartialEq<Path<T>> for Path<T> where
    T::String: PartialEq
[src]

impl<T: PartialOrd + Form> PartialOrd<Path<T>> for Path<T> where
    T::String: PartialOrd
[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]

impl<T> Send for Path<T> where
    <T as Form>::String: Send
[src]

impl<T> Sync for Path<T> where
    <T as Form>::String: Sync
[src]

impl<T> Unpin for Path<T> where
    <T as Form>::String: Unpin
[src]

impl<T> UnwindSafe for Path<T> where
    <T as Form>::String: UnwindSafe
[src]

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<S> Codec for S where
    S: Encode + Decode
[src]

impl<T> DecodeAll for T where
    T: Decode
[src]

impl<T> DecodeLimit for T where
    T: Decode
[src]

impl<'_, '_, T> EncodeLike<&'_ &'_ T> for T where
    T: Encode
[src]

impl<'_, T> EncodeLike<&'_ T> for T where
    T: Encode
[src]

impl<'_, T> EncodeLike<&'_ mut T> for T where
    T: Encode
[src]

impl<T> EncodeLike<Arc<T>> for T where
    T: Encode
[src]

impl<T> EncodeLike<Box<T, Global>> for T where
    T: Encode
[src]

impl<'a, T> EncodeLike<Cow<'a, T>> for T where
    T: Encode + ToOwned
[src]

impl<T> EncodeLike<Rc<T>> for T where
    T: Encode
[src]

impl<T> From<T> for T[src]

impl<S> FullCodec for S where
    S: Decode + FullEncode
[src]

impl<S> FullEncode for S where
    S: Encode + EncodeLike<S>, 
[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> KeyedVec for T where
    T: Codec
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.