pub struct Dummy;Expand description
A general purpose test Dummy. Implements any interface annotadet with the dummies macro as
well as a number of traits from the std namespace.
Dummy will implement any annotated trait trivially. For a trait MyTrait annotated with
dummies the implementation is:
impl MyTrait for Dummy {}This works, because after being annotated with dummies every trait method has a default
implementation. Even if it is just panicing.
use double_trait::{dummies, Dummy};
#[dummies]
trait OrgTrait {
fn answer(&self) -> i32;
}
OrgTrait::answer(&Dummy); // Compiles, but raises panic with `unimplemented!()`Trait Implementations§
impl Eq for Dummy
Source§impl Ord for Dummy
impl Ord for Dummy
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialOrd for Dummy
impl PartialOrd for Dummy
impl StructuralPartialEq for Dummy
Auto Trait Implementations§
impl Freeze for Dummy
impl RefUnwindSafe for Dummy
impl Send for Dummy
impl Sync for Dummy
impl Unpin for Dummy
impl UnsafeUnpin for Dummy
impl UnwindSafe for Dummy
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more