Skip to main content

announce_std/
borrow.rs

1//! announce mocks of `borrow` traits. Generated from newer-type-std's copies.
2
3#[allow(unused_imports)]
4use announce::announce;
5
6/// announce mock of [`::core::borrow::Borrow`]: invoke `Borrow!` to receive its definition.
7///
8/// The real trait is re-exported under the same path.
9#[announce(mock = ::core::borrow::Borrow)]
10pub trait Borrow<Borrowed>
11where
12    Borrowed: ?::core::marker::Sized,
13{
14    // Required method
15    fn borrow(&self) -> &Borrowed;
16}
17
18#[doc(no_inline)]
19pub use ::core::borrow::Borrow;
20
21/// announce mock of [`::core::borrow::BorrowMut`]: invoke `BorrowMut!` to receive its definition.
22///
23/// The real trait is re-exported under the same path.
24#[announce(mock = ::core::borrow::BorrowMut)]
25pub trait BorrowMut<Borrowed>: ::core::borrow::Borrow<Borrowed>
26where
27    Borrowed: ?::core::marker::Sized,
28{
29    fn borrow_mut(&mut self) -> &mut Borrowed;
30}
31
32#[doc(no_inline)]
33pub use ::core::borrow::BorrowMut;
34
35#[cfg(feature = "std")]
36/// announce mock of [`::std::borrow::ToOwned`].
37#[announce(mock = ::std::borrow::ToOwned)]
38pub trait ToOwned {
39    type Owned: ::core::borrow::Borrow<Self>;
40    fn to_owned(&self) -> Self::Owned;
41    fn clone_into(&self, target: &mut Self::Owned) {
42        ::core::unimplemented!()
43    }
44}
45#[cfg(feature = "std")]
46#[doc(no_inline)]
47pub use ::std::borrow::ToOwned;