shm: rename ShmGlobalToken to ShmToken

This commit is contained in:
Victor Berger 2017-06-13 16:45:46 +02:00
parent bf9ee9a395
commit afd9ca5656
1 changed files with 6 additions and 5 deletions

View File

@ -13,7 +13,7 @@
//! //!
//! To use it, first add a `ShmGlobal` to your event loop, specifying the formats //! To use it, first add a `ShmGlobal` to your event loop, specifying the formats
//! you want to support (ARGB8888 and XRGB8888 are always considered as supported, //! you want to support (ARGB8888 and XRGB8888 are always considered as supported,
//! as specified by the wayland protocol) and obtain its `ShmGlobalToken`. //! as specified by the wayland protocol) and obtain its `ShmToken`.
//! //!
//! ``` //! ```
//! extern crate wayland_server; //! extern crate wayland_server;
@ -110,8 +110,8 @@ impl ShmGlobal {
/// and has been initialized. If it is not the case, this method will panic. /// and has been initialized. If it is not the case, this method will panic.
/// ///
/// This is needed to retrieve the contents of the shm pools and buffers. /// This is needed to retrieve the contents of the shm pools and buffers.
pub fn get_token(&self) -> ShmGlobalToken { pub fn get_token(&self) -> ShmToken {
ShmGlobalToken { hid: self.handler_id.expect("ShmGlobal was not initialized.") } ShmToken { hid: self.handler_id.expect("ShmGlobal was not initialized.") }
} }
} }
@ -119,7 +119,8 @@ impl ShmGlobal {
/// ///
/// It is needed to access the contents of the buffers & pools managed by the /// It is needed to access the contents of the buffers & pools managed by the
/// associated `ShmGlobal`. /// associated `ShmGlobal`.
pub struct ShmGlobalToken { #[derive(Clone)]
pub struct ShmToken {
hid: usize, hid: usize,
} }
@ -136,7 +137,7 @@ pub enum BufferAccessError {
BadMap, BadMap,
} }
impl ShmGlobalToken { impl ShmToken {
/// Call given closure with the contents of the given buffer /// Call given closure with the contents of the given buffer
/// ///
/// If the buffer is managed by the associated ShmGlobal, its contents are /// If the buffer is managed by the associated ShmGlobal, its contents are