Macro rust_icu_common::generalized_fallible_getter [−][src]
macro_rules! generalized_fallible_getter { ($top_level_method_name:ident, $impl_name:ident, [ $( $arg:ident: $arg_type:ty ,)* ], $ret_type:ty) => { ... }; }
Expand description
Expands into a getter method that forwards all its arguments and returns a fallible value which is the same as the value returned by the underlying function.
The invocation:
ⓘ
impl _ { generalized_fallible_getter!( get_context, unum_getContext, [context_type: sys::UDisplayContextType, ], sys::UDisplayContext ); }
allows us to bind the function:
UDisplayContext unum_getContext(
const SOMETYPE* t,
UDisplayContextType type,
UErrorCode* status
);
which then becomes:
ⓘ
impl _ { fn get_context(&self, context_type: sys::UDisplayContextType) -> Result<sys::UDisplayContext, common::Error>; }
where Self
has an internal representation named exactly Self::rep
.