getter-methods 2.0.2

Derive macro to create getter / accessor methods.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
#![allow(clippy::disallowed_names)]

use std::sync::Arc;

use getter_methods::Getters;

#[derive(Debug, Getters)]
struct Foo {
  bar: Arc<i64>,
}

fn main() {
  let foo = Foo { bar: Arc::new(42) };
  let rc2 = foo.bar();
  assert_eq!(foo.bar(), rc2);
}