2024-05-21 14:28:30 -05:00
|
|
|
// https://github.com/rust-lang/rust/issues/89309
|
2021-10-04 20:54:48 -05:00
|
|
|
#![crate_name = "foo"]
|
|
|
|
|
2024-06-21 07:03:08 -05:00
|
|
|
//@ has foo/trait.Read.html
|
|
|
|
//@ has - '//h2' 'Trait examples'
|
2021-10-04 20:54:48 -05:00
|
|
|
/// # Trait examples
|
|
|
|
pub trait Read {
|
2024-06-21 07:03:08 -05:00
|
|
|
//@ has - '//h5' 'Function examples'
|
2021-10-04 20:54:48 -05:00
|
|
|
/// # Function examples
|
|
|
|
fn read(&mut self, buf: &mut [u8]) -> Result<usize, ()>;
|
|
|
|
}
|
|
|
|
|
|
|
|
pub struct Foo;
|
|
|
|
|
2024-06-21 07:03:08 -05:00
|
|
|
//@ has foo/struct.Foo.html
|
2021-10-04 20:54:48 -05:00
|
|
|
impl Foo {
|
2024-06-21 07:03:08 -05:00
|
|
|
//@ has - '//h5' 'Implementation header'
|
2021-10-04 20:54:48 -05:00
|
|
|
/// # Implementation header
|
|
|
|
pub fn bar(&self) -> usize {
|
|
|
|
1
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
impl Read for Foo {
|
2024-06-21 07:03:08 -05:00
|
|
|
//@ has - '//h5' 'Trait implementation header'
|
2021-10-04 20:54:48 -05:00
|
|
|
/// # Trait implementation header
|
|
|
|
fn read(&mut self, buf: &mut [u8]) -> Result<usize, ()> {
|
|
|
|
Ok(1)
|
|
|
|
}
|
|
|
|
}
|