\doxysection{\+\_\+\+Eina\+\_\+\+Future\+\_\+\+Desc Struct Reference}
\hypertarget{struct__Eina__Future__Desc}{}\label{struct__Eina__Future__Desc}\index{\_Eina\_Future\_Desc@{\_Eina\_Future\_Desc}}


A struct used to define a callback and data for a future.  




{\ttfamily \#include $<$eina\+\_\+promise.\+h$>$}

\doxysubsubsection*{Data Fields}
\begin{DoxyCompactItemize}
\item 
\mbox{\hyperlink{group__Eina__Future__Callbacks_ga43d2d4c20a2f7aee2a25ada34a9cc675}{Eina\+\_\+\+Future\+\_\+\+Cb}} \mbox{\hyperlink{struct__Eina__Future__Desc_a539cbfa26204bdf1aae7bdcfa6f15d09}{cb}}
\begin{DoxyCompactList}\small\item\em Called when the future is resolved or rejected. \end{DoxyCompactList}\item 
const void \texorpdfstring{$\ast$}{*} \mbox{\hyperlink{struct__Eina__Future__Desc_a3776d82a99776d2b6a96839c6191bc13}{data}}
\begin{DoxyCompactList}\small\item\em Context data to {\ttfamily cb}. \end{DoxyCompactList}\item 
\mbox{\hyperlink{eina__promise_8h_ae7a10cf718d83b4fbe62671435270480}{Eina\+\_\+\+Future}} \texorpdfstring{$\ast$}{*}\texorpdfstring{$\ast$}{*} \mbox{\hyperlink{struct__Eina__Future__Desc_afdce5683a20c045e4400cbbe7e0da9d4}{storage}}
\begin{DoxyCompactList}\small\item\em The storage will be used by Eina to store a pointer to the created future. \end{DoxyCompactList}\end{DoxyCompactItemize}


\doxysubsection{Detailed Description}
A struct used to define a callback and data for a future. 

This struct contains a future completion callback and a data to the future completion callback which is used by \doxylink{group__Eina__Future_ga9f4948790f1f84de93ba8195520d4a92}{eina\+\_\+future\+\_\+then()}, \doxylink{group__Eina__Future_gaeb721d890aa5eac3103a982edde76e9a}{eina\+\_\+future\+\_\+chain()} and friends to inform the user about the future result. The \doxylink{struct__Eina__Future__Desc_a3776d82a99776d2b6a96839c6191bc13}{\+\_\+\+Eina\+\_\+\+Future\+\_\+\+Desc\+::data} variable should be freed when \doxylink{struct__Eina__Future__Desc_a539cbfa26204bdf1aae7bdcfa6f15d09}{\+\_\+\+Eina\+\_\+\+Future\+\_\+\+Desc\+::cb} is called, otherwise it will leak.

\begin{DoxyNote}{Note}
If \doxylink{group__Eina__Future_ga9f4948790f1f84de93ba8195520d4a92}{eina\+\_\+future\+\_\+then()}, \doxylink{group__Eina__Future_gaeb721d890aa5eac3103a982edde76e9a}{eina\+\_\+future\+\_\+chain()} and friends fails to return a valid future (in other words\+: {\ttfamily NULL} is returned) the \doxylink{struct__Eina__Future__Desc_a539cbfa26204bdf1aae7bdcfa6f15d09}{\+\_\+\+Eina\+\_\+\+Future\+\_\+\+Desc\+::cb} will be called report an error like {\ttfamily EINVAL} or {\ttfamily ENOMEM} so \doxylink{struct__Eina__Future__Desc_a3776d82a99776d2b6a96839c6191bc13}{\+\_\+\+Eina\+\_\+\+Future\+\_\+\+Desc\+::data} can be freed.
\end{DoxyNote}
\begin{DoxySeeAlso}{See also}
\doxylink{group__Eina__Future_ga9f4948790f1f84de93ba8195520d4a92}{eina\+\_\+future\+\_\+then()} 

\doxylink{group__Eina__Future_gaf64b3969ac3a86afe47da820c625a416}{eina\+\_\+future\+\_\+chain\+\_\+array()} 

\doxylink{group__Eina__Future_ga8937a1545bc81676138a23d25829650b}{eina\+\_\+future\+\_\+cb\+\_\+convert\+\_\+to()} 

\doxylink{group__Eina__Future_ga84c55db821fee59726596580aa4bd827}{eina\+\_\+future\+\_\+cb\+\_\+console\+\_\+from\+\_\+desc()} 

\doxylink{group__Eina__Future_ga5acd0341dcde7ed060254fab2c0c18a9}{eina\+\_\+future\+\_\+cb\+\_\+ignore\+\_\+error()} 

\doxylink{group__Eina__Future_ga8efd2e10698d893468026e1eaf9e5948}{eina\+\_\+future\+\_\+cb\+\_\+easy\+\_\+from\+\_\+desc()} 

\doxylink{group__Eina__Future_ga25abdeb653ee9056a33288874d8d7111}{eina\+\_\+future\+\_\+cb\+\_\+log\+\_\+from\+\_\+desc()} 
\end{DoxySeeAlso}


\doxysubsection{Field Documentation}
\Hypertarget{struct__Eina__Future__Desc_a539cbfa26204bdf1aae7bdcfa6f15d09}\label{struct__Eina__Future__Desc_a539cbfa26204bdf1aae7bdcfa6f15d09} 
\index{\_Eina\_Future\_Desc@{\_Eina\_Future\_Desc}!cb@{cb}}
\index{cb@{cb}!\_Eina\_Future\_Desc@{\_Eina\_Future\_Desc}}
\doxysubsubsection{\texorpdfstring{cb}{cb}}
{\footnotesize\ttfamily \mbox{\hyperlink{group__Eina__Future__Callbacks_ga43d2d4c20a2f7aee2a25ada34a9cc675}{Eina\+\_\+\+Future\+\_\+\+Cb}} \+\_\+\+Eina\+\_\+\+Future\+\_\+\+Desc\+::cb}



Called when the future is resolved or rejected. 

Once a future is resolved or rejected this function is called passing the future result to inform the user that the future operation has ended. Normally this function is called from a safe context (main loop or some platform defined safe context), however in case of a future cancellation (\doxylink{group__Eina__Future_ga5462a38eabc060b163d24c9d7395ae3b}{eina\+\_\+future\+\_\+cancel()}) or if \doxylink{group__Eina__Future_ga9f4948790f1f84de93ba8195520d4a92}{eina\+\_\+future\+\_\+then()}, \doxylink{group__Eina__Future_gaeb721d890aa5eac3103a982edde76e9a}{eina\+\_\+future\+\_\+chain()} and friends fails to create a new future, this function is called from the current context.

Use this function to free {\ttfamily data} if necessary. \begin{DoxySeeAlso}{See also}
\doxylink{group__Eina__Future_gaeb721d890aa5eac3103a982edde76e9a}{eina\+\_\+future\+\_\+chain()} 

\doxylink{group__Eina__Future_ga9f4948790f1f84de93ba8195520d4a92}{eina\+\_\+future\+\_\+then()} 

\doxylink{group__Eina__Future_ga5462a38eabc060b163d24c9d7395ae3b}{eina\+\_\+future\+\_\+cancel()} 
\end{DoxySeeAlso}


Referenced by \mbox{\hyperlink{group__Eina__Future_ga84c55db821fee59726596580aa4bd827}{eina\+\_\+future\+\_\+cb\+\_\+console\+\_\+from\+\_\+desc()}}, \mbox{\hyperlink{group__Eina__Future_ga8937a1545bc81676138a23d25829650b}{eina\+\_\+future\+\_\+cb\+\_\+convert\+\_\+to()}}, \mbox{\hyperlink{group__Eina__Future_gaf64b3969ac3a86afe47da820c625a416}{eina\+\_\+future\+\_\+chain\+\_\+array()}}, and \mbox{\hyperlink{group__Eina__Future_ga6c6d97b2f3be307cc43364d6f4aade48}{eina\+\_\+future\+\_\+new()}}.

\Hypertarget{struct__Eina__Future__Desc_a3776d82a99776d2b6a96839c6191bc13}\label{struct__Eina__Future__Desc_a3776d82a99776d2b6a96839c6191bc13} 
\index{\_Eina\_Future\_Desc@{\_Eina\_Future\_Desc}!data@{data}}
\index{data@{data}!\_Eina\_Future\_Desc@{\_Eina\_Future\_Desc}}
\doxysubsubsection{\texorpdfstring{data}{data}}
{\footnotesize\ttfamily const void\texorpdfstring{$\ast$}{*} \+\_\+\+Eina\+\_\+\+Future\+\_\+\+Desc\+::data}



Context data to {\ttfamily cb}. 

The {\ttfamily data} should be freed inside {\ttfamily cb}, otherwise its memory will leak! 

Referenced by \mbox{\hyperlink{group__Eina__Future_ga84c55db821fee59726596580aa4bd827}{eina\+\_\+future\+\_\+cb\+\_\+console\+\_\+from\+\_\+desc()}}.

\Hypertarget{struct__Eina__Future__Desc_afdce5683a20c045e4400cbbe7e0da9d4}\label{struct__Eina__Future__Desc_afdce5683a20c045e4400cbbe7e0da9d4} 
\index{\_Eina\_Future\_Desc@{\_Eina\_Future\_Desc}!storage@{storage}}
\index{storage@{storage}!\_Eina\_Future\_Desc@{\_Eina\_Future\_Desc}}
\doxysubsubsection{\texorpdfstring{storage}{storage}}
{\footnotesize\ttfamily \mbox{\hyperlink{eina__promise_8h_ae7a10cf718d83b4fbe62671435270480}{Eina\+\_\+\+Future}}\texorpdfstring{$\ast$}{*}\texorpdfstring{$\ast$}{*} \+\_\+\+Eina\+\_\+\+Future\+\_\+\+Desc\+::storage}



The storage will be used by Eina to store a pointer to the created future. 

It can be {\ttfamily NULL}. 