pub struct StdImplCache { /* private fields */ }Expand description
Cache of known trait implementations for standard library types.
This is a static cache that knows which primitives and std types implement common traits like Clone, Default, Debug, etc.
Implementations§
Source§impl StdImplCache
impl StdImplCache
Sourcepub fn has_impl(&self, type_name: &str, trait_name: &str) -> bool
pub fn has_impl(&self, type_name: &str, trait_name: &str) -> bool
Check if a type implements a trait.
Sourcepub fn is_primitive(&self, type_name: &str) -> bool
pub fn is_primitive(&self, type_name: &str) -> bool
Check if a type is a known primitive.
Sourcepub fn is_std_container(&self, type_name: &str) -> bool
pub fn is_std_container(&self, type_name: &str) -> bool
Check if a type is a known std container.
Sourcepub fn traits_for(&self, type_name: &str) -> Vec<&'static str>
pub fn traits_for(&self, type_name: &str) -> Vec<&'static str>
Get all traits a type is known to implement.
Trait Implementations§
Source§impl Clone for StdImplCache
impl Clone for StdImplCache
Source§fn clone(&self) -> StdImplCache
fn clone(&self) -> StdImplCache
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StdImplCache
impl Debug for StdImplCache
Auto Trait Implementations§
impl Freeze for StdImplCache
impl RefUnwindSafe for StdImplCache
impl Send for StdImplCache
impl Sync for StdImplCache
impl Unpin for StdImplCache
impl UnsafeUnpin for StdImplCache
impl UnwindSafe for StdImplCache
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more