Exposes shared memory on *nix and Windows using mapped files. This work is heavily inspired on the sharedmemory crate, but instead of being just a copy cat, typedshmem provides a typed mapping into the shared region.
typed_shmem is in an early development stage, thus some major changes could be required, expect some API stability.
First, a process must create the shared region: ```rust use std::error::Error; use typed_shmem as sh;
fn main() -> Result<(), Box
// ShMem<T> implements Deref and DerefMut.
*mem = 10; //Write.
assert_eq!(*mem, 10); //Read.
loop {} //Used to keep the process alive, thus the allocated shared memory too.
Ok(())
} ```
Then, any other process can join the same region: ```rust use std::error::Error; use typed_shmem as sh;
fn main() -> Result<(), Box
assert_eq!(*mem, 10); //Read.
Ok(())
} ```
Box<dyn Error>
ing everything.ShMem
throught ShMemCfg
(String
related), although is not a major bottleneck/issue.panic!
ing at runtime.fork()
in *nix (not sure)?; windows?).All contributions to this project will be under Apache-2.0 license.