[−][src]Function kekbit_core::shm::shm_reader
pub fn shm_reader(
root_path: &Path,
channel_id: u64
) -> Result<ShmReader, ChannelError>
Creates a kekbit reader associated to a memory mapped channel.
Returns a ready to use reader which points to the beginning of a kekbit channel if succeeds, or an error if the operation fails.
Arguments
root_path
- The path to the folder where all the channels will be stored grouped by writer's id.writer_id
- The id of the writer which created the channel.channel_id
- The channel identifier.
Errors
Various errors may occur if the operation fails.
Examples
use kekbit_core::shm::*; let writer_id = 1850; let channel_id = 42; let test_tmp_dir = tempdir::TempDir::new("kektest").unwrap(); let reader = shm_reader(&test_tmp_dir.path(), channel_id).unwrap(); println!("{:?}", reader.header());