pub fn try_new<F>(func: F) -> Result<RuntimeArgs, CLValueError>
    where
        F: FnOnce(&mut RuntimeArgs) -> Result<(), CLValueError>,
    {
        let mut runtime_args = RuntimeArgs::new();
        func(&mut runtime_args)?;
        Ok(runtime_args)
    }
/// A wrapper that lets you easily and safely create runtime arguments.
///
/// This method is useful when you have to construct a [`RuntimeArgs`] with multiple entries,
/// but error handling at given call site would require to have a match statement for each
/// [`RuntimeArgs::insert`] call. With this method you can use ? operator inside the closure and
/// then handle single result. When `try_block` will be stabilized this method could be
/// deprecated in favor of using those blocks.
A wrapper that lets you easily and safely create runtime arguments.
This method is useful when you have to construct a [`RuntimeArgs`] with multiple entries,
but error handling at given call site would require to have a match statement for each
[`RuntimeArgs::insert`] call. With this method you can use . operator inside the closure and
then handle single result. When `try_block` will be stabilized this method could be
deprecated in favor of using those blocks.
A wrapper that lets you easily and safely create runtime arguments . This method is useful when you have to construct a [ ` RuntimeArgs ` ] with multiple entries but error handling at given call site would require to have a match statement for each [ ` RuntimeArgs :: insert ` ] call . With this method you can use . operator inside the closure and then handle single result . When ` try_block ` will be stabilized this method could be deprecated in favor of using those blocks .
pub fn try_new<F>(func: F) -> Result<RuntimeArgs, CLValueError>
    where
        F: FnOnce(&mut RuntimeArgs) -> Result<(), CLValueError>,
    {
        let mut runtime_args = RuntimeArgs::new();
        func(&mut runtime_args)?;
        Ok(runtime_args)
    }
pub fn try_new < F > ( func : F ) -> Result < RuntimeArgs , CLValueError > where F : FnOnce ( & mut RuntimeArgs ) -> Result < ( ) , CLValueError > , { let mut runtime_args = RuntimeArgs :: new ( ) ; func ( & mut runtime_args ) ? ; Ok ( runtime_args ) }
A wrapper that lets you easily and safely create runtime arguments.
A wrapper that lets you easily and safely create runtime arguments .
func
F
func
F