[][src]Type Definition paho_mqtt_sys::Persistence_open

type Persistence_open = Option<unsafe extern "C" fn(handle: *mut *mut c_void, clientID: *const c_char, serverURI: *const c_char, context: *mut c_void) -> c_int>;

@brief Initialize the persistent store.

Either open the existing persistent store for this client ID or create a new one if one doesn't exist. If the persistent store is already open, return without taking any action.

An application can use the same client identifier to connect to many different servers. The clientid in conjunction with the serverURI uniquely identifies the persistence store required.

@param handle The address of a pointer to a handle for this persistence implementation. This function must set handle to a valid reference to the persistence following a successful return. The handle pointer is passed as an argument to all the other persistence functions. It may include the context parameter and/or any other data for use by the persistence functions. @param clientID The client identifier for which the persistent store should be opened. @param serverURI The connection string specified when the MQTT client was created (see MQTTClient_create()). @param context A pointer to any data required to initialize the persistent store (see ::MQTTClient_persistence). @return Return 0 if the function completes successfully, otherwise return ::MQTTCLIENT_PERSISTENCE_ERROR.