Skip to content

Commit

Permalink
iox-#5 Fix clippy warning for unsafe trait
Browse files Browse the repository at this point in the history
  • Loading branch information
elBoberido committed Jun 27, 2022
1 parent 3139716 commit 27fceea
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/pb/sample.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,16 @@ use super::Publisher;

use std::ops::{Deref, DerefMut};

/// # Safety
///
/// This is a marker trait for types that can be transferred via shared memory.
/// The types must satisfy the following conditions:
/// - no heap is used
/// - the data structure is entirely contained in the shared memory - no pointers
/// to process local memory, no references to process local constructs, no dynamic allocators
/// - the data structure has to be relocatable and therefore must not internally
/// use pointers/references
/// In general, types that could implement the Copy trait fulfill these requirements.
pub unsafe trait POD {}
// TODO more impls
unsafe impl POD for i8 {}
Expand Down

0 comments on commit 27fceea

Please sign in to comment.