[−][src]Struct tynm::TypeName
Organizes type name string into distinct parts.
Methods
impl<'s> TypeName<'s>
[src]
pub fn module_path(&self) -> &[&'s str]
[src]
Returns the module path of the type.
pub fn simple_name(&self) -> &'s str
[src]
Returns the simple name of the type, excluding type parameters.
pub fn type_params(&self) -> &[TypeName<'s>]
[src]
Returns the type parameters to the type.
pub fn as_str(&self) -> String
[src]
Returns the type name string without any module paths.
This is equivalent to calling TypeName::as_str_mn(0, 0);
pub fn as_str_mn(&self, m: usize, n: usize) -> String
[src]
Returns the type name string with the given number of module segments.
If the left and right module segments overlap, the overlapping segments will only be printed printed once.
Parameters
m
: Number of module segments to include, beginning from the left (most significant).n
: Number of module segments to include, beginning from the right (least significant).
pub fn write_str<W>(
&self,
buffer: &mut W,
m: usize,
n: usize
) -> Result<(), Error> where
W: Write,
[src]
&self,
buffer: &mut W,
m: usize,
n: usize
) -> Result<(), Error> where
W: Write,
Writes the type name string to the given buffer.
If the left and right module segments overlap, the overlapping segments will only be printed once.
Parameters
buffer
: Buffer to write to.m
: Number of module segments to include, beginning from the left (most significant).n
: Number of module segments to include, beginning from the right (least significant).
pub fn write_module_path<W>(
&self,
buffer: &mut W,
m: usize,
n: usize
) -> Result<(), Error> where
W: Write,
[src]
&self,
buffer: &mut W,
m: usize,
n: usize
) -> Result<(), Error> where
W: Write,
Writes the module path to the given buffer.
If the left and right module segments overlap, the overlapping segments will only be printed once.
Parameters
buffer
: Buffer to write to.m
: Number of module segments to include, beginning from the left (most significant).n
: Number of module segments to include, beginning from the right (least significant).
pub fn write_simple_name<W>(&self, buffer: &mut W) -> Result<(), Error> where
W: Write,
[src]
W: Write,
pub fn write_type_params<W>(
&self,
buffer: &mut W,
m: usize,
n: usize
) -> Result<(), Error> where
W: Write,
[src]
&self,
buffer: &mut W,
m: usize,
n: usize
) -> Result<(), Error> where
W: Write,
Writes type parameters to the given buffer.
If the left and right module segments overlap, the overlapping segments will only be printed once.
Parameters
buffer
: Buffer to write to.m
: Number of module segments to include, beginning from the left (most significant).n
: Number of module segments to include, beginning from the right (least significant).
Trait Implementations
impl<'s> Clone for TypeName<'s>
[src]
impl<'s> Debug for TypeName<'s>
[src]
impl<'s> Eq for TypeName<'s>
[src]
impl<'s> From<&'s str> for TypeName<'s>
[src]
impl<'s> PartialEq<TypeName<'s>> for TypeName<'s>
[src]
impl<'s> StructuralEq for TypeName<'s>
[src]
impl<'s> StructuralPartialEq for TypeName<'s>
[src]
Auto Trait Implementations
impl<'s> RefUnwindSafe for TypeName<'s>
impl<'s> Send for TypeName<'s>
impl<'s> Sync for TypeName<'s>
impl<'s> Unpin for TypeName<'s>
impl<'s> UnwindSafe for TypeName<'s>
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,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
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.
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>,