pub fn dup_handle_operating_rights(
        &self,
        handle_value: HandleValue,
        operation: impl FnOnce(Rights) -> ZxResult<Rights>,
    ) -> ZxResult<HandleValue> {
        let mut inner = self.inner.lock();
        let mut handle = match inner.handles.get(&handle_value) {
            Some((h, _)) => h.clone(),
            None => return Err(ZxError::BAD_HANDLE),
        };
        handle.rights = operation(handle.rights)?;
        let new_handle_value = inner.add_handle(handle);
        Ok(new_handle_value)
    }
/// Duplicate a handle with new `rights`, return the new handle value.
///
/// The handle must have `Rights::DUPLICATE`.
/// To duplicate the handle with the same rights use `Rights::SAME_RIGHTS`.
/// If different rights are desired they must be strictly lesser than of the source handle,
/// or an `ZxError::ACCESS_DENIED` will be raised.
Duplicate a handle with new `rights`, return the new handle value.
The handle must have `Rights::DUPLICATE`.
To duplicate the handle with the same rights use `Rights::SAME_RIGHTS`.
If different rights are desired they must be strictly lesser than of the source handle,
or an `ZxError::ACCESS_DENIED` will be raised.
Duplicate a handle with new ` rights ` return the new handle value . The handle must have ` Rights :: DUPLICATE ` . To duplicate the handle with the same rights use ` Rights :: SAME_RIGHTS ` . If different rights are desired they must be strictly lesser than of the source handle or an ` ZxError :: ACCESS_DENIED ` will be raised .
pub fn dup_handle_operating_rights(
        &self,
        handle_value: HandleValue,
        operation: impl FnOnce(Rights) -> ZxResult<Rights>,
    ) -> ZxResult<HandleValue> {
        let mut inner = self.inner.lock();
        let mut handle = match inner.handles.get(&handle_value) {
            Some((h, _)) => h.clone(),
            None => return Err(ZxError::BAD_HANDLE),
        };
        handle.rights = operation(handle.rights)?;
        let new_handle_value = inner.add_handle(handle);
        Ok(new_handle_value)
    }
pub fn dup_handle_operating_rights ( & self , handle_value : HandleValue , operation : impl FnOnce ( Rights ) -> ZxResult < Rights > , ) -> ZxResult < HandleValue > { let mut inner = self . inner . lock ( ) ; let mut handle = match inner . handles . get ( & handle_value ) { Some ( ( h , _ ) ) => h . clone ( ) , None => return Err ( ZxError :: BAD_HANDLE ) , } ; handle . rights = operation ( handle . rights ) ? ; let new_handle_value = inner . add_handle ( handle ) ; Ok ( new_handle_value ) }
Duplicate a handle with new `rights`, return the new handle value.
Duplicate a handle with new ` rights ` return the new handle value .
&self
handle_value
HandleValue
operation
impl FnOnce(Rights) -> ZxResult<Rights>
&self
handle_value
HandleValue
operation
impl FnOnce(Rights) -> ZxResult<Rights>