This PR implements the suggestions I made for from_fn in the Rust Community Discord, with some further iterations. Namely:
from_fn returns Result<ComPtr<T>, HRESULT> instead of Result<Option<ComPtr<T>>, E>
F is redefined as FnOnce(&GUID, &mut *mut P) -> HRESULT
It also adds a com_ptr_from_fn function that generalizes from_fn for COM functions that output multiple COM objects (such as ICallFactory::CreateCall).
This PR implements the suggestions I made for
from_fn
in the Rust Community Discord, with some further iterations. Namely:from_fn
returnsResult<ComPtr<T>, HRESULT>
instead ofResult<Option<ComPtr<T>>, E>
F
is redefined asFnOnce(&GUID, &mut *mut P) -> HRESULT
It also adds a
com_ptr_from_fn
function that generalizesfrom_fn
for COM functions that output multiple COM objects (such asICallFactory::CreateCall
).