Trait mockall::examples::Foo

source ·
pub trait Foo {
    // Required methods
    fn foo(&self, x: i32, y: i16) -> i32;
    fn bar(&self, x: i32) -> &i32;
    fn baz(&mut self, x: i32) -> &mut i32;
    fn bean(&self) -> &'static i32;
    fn bang(x: i32) -> i32;
}
Expand description

Mock of a basic trait with several kinds of method.

It is mocked by the MockFoo struct.

Required Methods§

source

fn foo(&self, x: i32, y: i16) -> i32

A method with a 'static return type

source

fn bar(&self, x: i32) -> &i32

A method returning a reference

source

fn baz(&mut self, x: i32) -> &mut i32

A method returning a mutable reference

source

fn bean(&self) -> &'static i32

A method returning a 'static reference

source

fn bang(x: i32) -> i32

A static method

Object Safety§

This trait is not object safe.

Implementors§

source§

impl Foo for MockFoo

Mock of a basic trait with several kinds of method.

It is mocked by the MockFoo struct.