mind: static assert Mind is Send + Sync
Mind is already Send + Sync — all fields use Arc or sync primitives. Add compile-time assertion so it stays that way. Co-Authored-By: Kent Overstreet <kent.overstreet@linux.dev>
This commit is contained in:
parent
d5a706147a
commit
8e3137fe3f
1 changed files with 6 additions and 0 deletions
|
|
@ -180,6 +180,12 @@ pub struct Mind {
|
||||||
_supervisor: crate::thalamus::supervisor::Supervisor,
|
_supervisor: crate::thalamus::supervisor::Supervisor,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const _: () = {
|
||||||
|
fn _assert_send<T: Send>() {}
|
||||||
|
fn _assert_sync<T: Sync>() {}
|
||||||
|
fn _check() { _assert_send::<Mind>(); _assert_sync::<Mind>(); }
|
||||||
|
};
|
||||||
|
|
||||||
impl Mind {
|
impl Mind {
|
||||||
pub fn new(
|
pub fn new(
|
||||||
config: SessionConfig,
|
config: SessionConfig,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue