#[non_exhaustive]pub struct TypeNameOpts {
pub recurse_ttl: isize,
}Expand description
Options for formatting the name of a type
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.recurse_ttl: isizeas long as this is > 0, keep formatting the type parameters
when it reaches 0, format type parameters as ...
if negative, all type parameters are formatted
Implementations§
Source§impl TypeNameOpts
impl TypeNameOpts
Sourcepub fn none() -> TypeNameOpts
pub fn none() -> TypeNameOpts
Create a new NameOpts for which none of the type parameters are formatted
Sourcepub fn one() -> TypeNameOpts
pub fn one() -> TypeNameOpts
Create a new NameOpts for which only the direct children are formatted
Sourcepub fn infinite() -> TypeNameOpts
pub fn infinite() -> TypeNameOpts
Create a new NameOpts for which all type parameters are formatted
Sourcepub fn for_children(&self) -> Option<TypeNameOpts>
pub fn for_children(&self) -> Option<TypeNameOpts>
Decrease the recurse_ttl — if it’s != 0, returns options to pass when
formatting children type parameters.
If this returns None and you have type parameters, you should render a
… (unicode ellipsis) character instead of your list of types.
See the implementation for Vec for examples.
Trait Implementations§
Source§impl Clone for TypeNameOpts
impl Clone for TypeNameOpts
Source§fn clone(&self) -> TypeNameOpts
fn clone(&self) -> TypeNameOpts
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Default for TypeNameOpts
impl Default for TypeNameOpts
Source§fn default() -> TypeNameOpts
fn default() -> TypeNameOpts
Returns the “default value” for a type. Read more
impl Copy for TypeNameOpts
Auto Trait Implementations§
impl Freeze for TypeNameOpts
impl RefUnwindSafe for TypeNameOpts
impl Send for TypeNameOpts
impl Sync for TypeNameOpts
impl Unpin for TypeNameOpts
impl UnwindSafe for TypeNameOpts
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
Mutably borrows from an owned value. Read more