Trait 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

Dyn Compatibility§

This trait is not dyn compatible.

In older versions of Rust, dyn compatibility was called "object safety", so 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.