Skip to main content

UpcastArcNetDirProvider

Trait UpcastArcNetDirProvider 

Source
pub trait UpcastArcNetDirProvider {
    // Required method
    fn upcast_arc<'a>(self: Arc<Self>) -> Arc<dyn NetDirProvider + 'a> 
       where Self: 'a;
}
Expand description

Helper trait: allows any Arc<X> to be upcast to a Arc<dyn NetDirProvider> if X is an implementation or supertrait of NetDirProvider.

This trait exists to work around a limitation in rust: when trait upcasting coercion is stable, this will be unnecessary.

The Rust tracking issue is https://github.com/rust-lang/rust/issues/65991.

Required Methods§

Source

fn upcast_arc<'a>(self: Arc<Self>) -> Arc<dyn NetDirProvider + 'a>
where Self: 'a,

Return a view of this object as an Arc<dyn NetDirProvider>

Dyn Compatibility§

This trait is dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety".

Implementors§