std_new/
lib.rs

1#![forbid(unsafe_code)]
2#![warn(clippy::all, clippy::pedantic)]
3
4use std::panic::{RefUnwindSafe, UnwindSafe};
5
6use serde::{Deserialize, Serialize};
7use static_assertions::assert_impl_all;
8
9// Implement common traits which may be usesful.
10// `Copy` is commented out as it may not always be appropriate.
11#[derive(Clone, /*Copy,*/ Debug, Default, Deserialize, PartialEq, PartialOrd, Serialize)]
12pub struct ExampleStruct {
13    pub value: i32,
14}
15
16// Ensure ExampleStruct implements common auto traits.
17// If any of these traits are not implemented, a compile-time error will occur, and
18// thus a major version bump may be required.
19assert_impl_all!(ExampleStruct: RefUnwindSafe, Send, Sized, Sync, Unpin, UnwindSafe);