Annotations
In Java, annotations are a specialized kind of interface that allows you to add custom metadata about your code.
Here's an example of a method that's annotated with @Test
to indicate that it's a test method:
@Test
public void someTestMethod() {
// arrange
// act
// assert
}
The equivalent of annotations in Rust are called attributes. Here's a test method that is annotated with the #[test]
attribute:
#[test]
fn some_test_method() {
// arrange
// act
// assert
}
See also: