pub struct Ty { /* private fields */ }
Expand description
A nicer std:TypeId
.
- Shorter name.
- Improved
Debug
impl. - Option for non-
'static
types.
Implementations§
Trait Implementations§
source§impl Ord for Ty
impl Ord for Ty
source§impl PartialOrd for Ty
impl PartialOrd for Ty
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for Ty
impl Eq for Ty
impl StructuralEq for Ty
Auto Trait Implementations§
impl RefUnwindSafe for Ty
impl Send for Ty
impl Sync for Ty
impl Unpin for Ty
impl UnwindSafe for Ty
Blanket Implementations§
source§impl<X> AnyDebug for Xwhere
X: Any + Debug + Send + Sync,
impl<X> AnyDebug for Xwhere X: Any + Debug + Send + Sync,
source§fn get_ty(&self) -> Ty
fn get_ty(&self) -> Ty
You’re inevitably wanting to call this with something like
Box<dyn AnyDebug>
, but instead
of returning the ty of the contents, it uselessly returns Ty::of::<Box<dyn AnyDebug>>()
.
How do you deal with this? Instead of this.get_ty()
, call (*this).get_ty()
.fn type_name(&self) -> &'static str
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