Expose WeakPtrTarget trait bound under cxx::memory

This commit is contained in:
David Tolnay 2021-04-16 16:12:22 -07:00
parent 3eba08594c
commit d0019c6d08
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82
2 changed files with 6 additions and 3 deletions

View File

@ -4,5 +4,6 @@
pub use crate::shared_ptr::SharedPtrTarget;
pub use crate::unique_ptr::UniquePtrTarget;
pub use crate::weak_ptr::WeakPtrTarget;
#[doc(no_inline)]
pub use cxx::{SharedPtr, UniquePtr};

View File

@ -91,9 +91,11 @@ where
}
}
// Methods are private; not intended to be implemented outside of cxxbridge
// codebase.
#[allow(missing_docs)]
/// Trait bound for types which may be used as the `T` inside of a `WeakPtr<T>`
/// in generic code.
///
/// This trait has no publicly callable or implementable methods. Implementing
/// it outside of the CXX codebase is not supported.
pub unsafe trait WeakPtrTarget {
#[doc(hidden)]
fn __typename(f: &mut fmt::Formatter) -> fmt::Result;