pub fn downcast<T>(self) -> Result<StrongArc<T>, Self>
    where
        T: Any + Send + Sync + 'static,
    {
        if (*self).is::<T>() {
            let ptr = self.ptr.cast::<StrongArcInner<T>>();
            mem::forget(self);
            Ok(StrongArc::from_inner(ptr))
        } else {
            Err(self)
        }
    }
/// Attempt to downcast the `StrongArc<dyn Any + Send + Sync>` to a concrete type.
///
/// # Examples
///
/// ```
/// use std::any::Any;
/// use std::sync::Arc;
///
/// fn print_if_string(value: Arc<dyn Any + Send + Sync>) {
///     if let Ok(string) = value.downcast::<String>() {
///         println!("String ({}): {}", string.len(), string);
///     }
/// }
///
/// let my_string = "Hello World".to_string();
/// print_if_string(Arc::new(my_string));
/// print_if_string(Arc::new(0i8));
/// ```
Attempt to downcast the `StrongArc` to a concrete type.
Attempt to downcast the ` StrongArc ` to a concrete type .
pub fn downcast<T>(self) -> Result<StrongArc<T>, Self>
    where
        T: Any + Send + Sync + 'static,
    {
        if (*self).is::<T>() {
            let ptr = self.ptr.cast::<StrongArcInner<T>>();
            mem::forget(self);
            Ok(StrongArc::from_inner(ptr))
        } else {
            Err(self)
        }
    }
pub fn downcast < T > ( self ) -> Result < StrongArc < T > , Self > where T : Any + Send + Sync + ' static , { if ( * self ) . is :: < T > ( ) { let ptr = self . ptr . cast :: < StrongArcInner < T > > ( ) ; mem :: forget ( self ) ; Ok ( StrongArc :: from_inner ( ptr ) ) } else { Err ( self ) } }
Attempt to downcast the `StrongArc<dyn Any + Send + Sync>` to a concrete type.
Attempt to downcast the ` StrongArc<dyn Any + Send + Sync > ` to a concrete type .
self
self
examples
```
use std::any::Any;
use std::sync::Arc.

fn print_if_string(value: Arc) {
if let Ok(string) = value.downcast::() {
println!("String ({}): {}", string.len(), string);
}
}

let my_string = "Hello World".to_string();
print_if_string(Arc::new(my_string));
print_if_string(Arc::new(0i8));
```
` ` ` use std :: any :: Any ; use std :: sync :: Arc . fn print_if_string ( value : Arc ) { if let Ok ( string ) = value . downcast :: () { println! ( " String ( {} ) : {} " string . len () string ) ; } } let my_string = " Hello World " . to_string () ; print_if_string ( Arc :: new ( my_string )) ; print_if_string ( Arc :: new ( 0i8 )) ; ` ` `