pub trait FnResult<'a, T>: FnMarker {
type Output;
}
Expand description
Trait for determining function result types.
This trait maps function markers to their corresponding result types. For synchronous functions, this is just the value type. For asynchronous functions, this wraps the value in a Future.
§Type Parameters
'a
- Lifetime parameter for the resultT
- The base type that will be wrapped according to the marker
§Associated Types
Output
- The actual result type (T for sync,Future<T>
for async)
§Examples
use cel_cxx::marker::{FnMarker, FnResult};
fn result_example<'a, F, T>() -> F::Output
where
F: FnMarker + FnResult<'a, T>,
{
// Return type depends on the function marker
todo!()
}
Required Associated Types§
Implementations on Foreign Types§
Source§impl<'a, T> FnResult<'a, T> for ()
Synchronous function results.
impl<'a, T> FnResult<'a, T> for ()
Synchronous function results.
For synchronous functions, the result type is just the base type.