Skip to main content

announce_std/
convert.rs

1//! announce mocks of `convert` traits. Generated from newer-type-std's copies.
2
3#[allow(unused_imports)]
4use announce::announce;
5
6/// announce mock of [`::core::convert::AsRef`]: invoke `AsRef!` to receive its definition.
7///
8/// The real trait is re-exported under the same path.
9#[announce(mock = ::core::convert::AsRef)]
10pub trait AsRef<T: ?::core::marker::Sized> {
11    fn as_ref(&self) -> &T;
12}
13
14#[doc(no_inline)]
15pub use ::core::convert::AsRef;
16
17/// announce mock of [`::core::convert::AsMut`]: invoke `AsMut!` to receive its definition.
18///
19/// The real trait is re-exported under the same path.
20#[announce(mock = ::core::convert::AsMut)]
21pub trait AsMut<T: ?::core::marker::Sized> {
22    fn as_mut(&mut self) -> &mut T;
23}
24
25#[doc(no_inline)]
26pub use ::core::convert::AsMut;
27
28/// announce mock of [`::core::convert::Into`]: invoke `Into!` to receive its definition.
29///
30/// The real trait is re-exported under the same path.
31#[announce(mock = ::core::convert::Into)]
32pub trait Into<T>: ::core::marker::Sized {
33    fn into(self) -> T;
34}
35
36#[doc(no_inline)]
37pub use ::core::convert::Into;
38
39/// announce mock of [`::core::convert::TryInto`]: invoke `TryInto!` to receive its definition.
40///
41/// The real trait is re-exported under the same path.
42#[announce(mock = ::core::convert::TryInto)]
43pub trait TryInto<T>: ::core::marker::Sized {
44    type Error;
45    fn try_into(self) -> ::core::result::Result<T, Self::Error>;
46}
47
48#[doc(no_inline)]
49pub use ::core::convert::TryInto;