pub enum Transfer {
Nothing,
Container,
Everything,
}
Expand description
The transfer is the exchange of data between two parts, from the callee to
the caller. The callee is either a function/method/signal or an
object/interface where a property is defined. The caller is the side
accessing a property or calling a function.
Transfer specifies who’s responsible for freeing the resources after the
ownership transfer is complete. In case of a containing type such as a list,
an array or a hash table the container itself is specified differently from
the items within the container itself. Each container is freed differently,
check the documentation for the types themselves for information on how to
free them.
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
transfer nothing from the callee (function or the type
instance the property belongs to) to the caller. The callee retains the
ownership of the transfer and the caller doesn’t need to do anything to free
up the resources of this transfer.
transfer the container (list, array, hash table) from
the callee to the caller. The callee retains the ownership of the individual
items in the container and the caller has to free up the container resources
(g_list_free()/g_hash_table_destroy() etc) of this transfer.
transfer everything, eg the container and its
contents from the callee to the caller. This is the case when the callee
creates a copy of all the data it returns. The caller is responsible for
cleaning up the container and item resources of this transfer.