pub fn instantiate_exact<I, F>(&self, version: u32, implementor: F) -> Result<I, GlobalError>
    where
        I: Interface + From<Proxy<I>>,
        F: FnOnce(NewProxy<I>) -> I,
    {
        let inner = self.inner.lock().unwrap();
        for &(id, ref interface, server_version) in &inner.list {
            if interface == I::NAME {
                if version > server_version {
                    return Err(GlobalError::VersionTooLow(server_version));
                } else {
                    return Ok(self.registry.bind(version, id, implementor).unwrap());
                }
            }
        }
        Err(GlobalError::Missing)
    }
/// Instantiate a global with a specific version
///
/// Meaning of requests and events can change depending on the object version you use,
/// as such unless you specifically want to support several versions of a protocol, it is
/// recommended to use this method with an hardcoded value for the version (the one you'll
/// use a as reference for your implementation). Notably you should *not* use `I::VERSION`
/// as a version, as this value can change when the protocol files are updated.
///
/// This method is only appropriate for globals that are expected to
/// not exist with multiplicity (such as `wl_compositor` or `wl_shm`),
/// as it will always bind the first one that was advertized.
Instantiate a global with a specific version
Meaning of requests and events can change depending on the object version you use,
as such unless you specifically want to support several versions of a protocol, it is
recommended to use this method with an hardcoded value for the version (the one you'll
use a as reference for your implementation). Notably you should *not* use `I::VERSION`
as a version, as this value can change when the protocol files are updated.

This method is only appropriate for globals that are expected to
not exist with multiplicity (such as `wl_compositor` or `wl_shm`),
as it will always bind the first one that was advertized.
Instantiate a global with a specific version Meaning of requests and events can change depending on the object version you use as such unless you specifically want to support several versions of a protocol it is recommended to use this method with an hardcoded value for the version ( the one you ' ll use a as reference for your implementation ) . Notably you should * not * use ` I :: VERSION ` as a version as this value can change when the protocol files are updated . This method is only appropriate for globals that are expected to not exist with multiplicity ( such as ` wl_compositor ` or ` wl_shm ` ) as it will always bind the first one that was advertized .
pub fn instantiate_exact<I, F>(&self, version: u32, implementor: F) -> Result<I, GlobalError>
    where
        I: Interface + From<Proxy<I>>,
        F: FnOnce(NewProxy<I>) -> I,
    {
        let inner = self.inner.lock().unwrap();
        for &(id, ref interface, server_version) in &inner.list {
            if interface == I::NAME {
                if version > server_version {
                    return Err(GlobalError::VersionTooLow(server_version));
                } else {
                    return Ok(self.registry.bind(version, id, implementor).unwrap());
                }
            }
        }
        Err(GlobalError::Missing)
    }
pub fn instantiate_exact < I , F > ( & self , version : u32 , implementor : F ) -> Result < I , GlobalError > where I : Interface + From < Proxy < I > > , F : FnOnce ( NewProxy < I > ) -> I , { let inner = self . inner . lock ( ) . unwrap ( ) ; for & ( id , ref interface , server_version ) in & inner . list { if interface == I :: NAME { if version > server_version { return Err ( GlobalError :: VersionTooLow ( server_version ) ) ; } else { return Ok ( self . registry . bind ( version , id , implementor ) . unwrap ( ) ) ; } } } Err ( GlobalError :: Missing ) }
Instantiate a global with a specific version
Meaning of requests and events can change depending on the object version you use,
as such unless you specifically want to support several versions of a protocol, it is
recommended to use this method with an hardcoded value for the version (the one you'll
use a as reference for your implementation).
Instantiate a global with a specific version Meaning of requests and events can change depending on the object version you use as such unless you specifically want to support several versions of a protocol it is recommended to use this method with an hardcoded value for the version ( the one you ' ll use a as reference for your implementation ) .
&self
version
u32
implementor
F
&self
version
u32
implementor
F