zenoh_shm/api/client/
shm_segment.rs

1//
2// Copyright (c) 2023 ZettaScale Technology
3//
4// This program and the accompanying materials are made available under the
5// terms of the Eclipse Public License 2.0 which is available at
6// http://www.eclipse.org/legal/epl-2.0, or the Apache License, Version 2.0
7// which is available at https://www.apache.org/licenses/LICENSE-2.0.
8//
9// SPDX-License-Identifier: EPL-2.0 OR Apache-2.0
10//
11// Contributors:
12//   ZettaScale Zenoh Team, <zenoh@zettascale.tech>
13//
14
15use std::fmt::Debug;
16
17use zenoh_result::ZResult;
18
19use crate::api::common::types::ChunkID;
20
21/// ShmSegment - RAII interface to interact with particular shared memory segment
22#[zenoh_macros::unstable_doc]
23pub trait ShmSegment: Debug + Send + Sync {
24    /// Obtain the actual region of memory identified by it's id
25    #[zenoh_macros::unstable_doc]
26    fn map(&self, chunk: ChunkID) -> ZResult<*mut u8>;
27}