[−][src]Macro rust_icu_common::generalized_fallible_getter
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:
ⓘThis example is not tested
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:
ⓘThis example is not tested
impl _ { fn get_context(&self, context_type: sys::UDisplayContextType) -> Result<sys::UDisplayContext, common::Error>; }
where Self
has an internal representation named exactly Self::rep
.