[−][src]Function xaynet::sdk::api::run_client
#[no_mangle]pub unsafe extern "C" fn run_client(client: *mut FFIClient) -> c_int
Starts the Client
and executes its tasks in an asynchronous runtime.
Errors
Ignores null pointer client
s and returns an error immediately.
If the client must be stopped because of a panic or error or when the client terminates successfully, then one of the following error codes is returned:
-1
: client didn't start due to null pointer0
: no error (only for clients with finite running time)1
: client panicked due to unexpected/unhandled error2
: client stopped due to errorParticipantInitErr
3
: client stopped due to errorParticipantErr
4
: client stopped due to errorDeserialiseErr
5
: client stopped due to errorNetworkErr
6
: client stopped due to errorParseErr
7
: client stopped due to errorGeneralErr
8
: client stopped due to errorFetch
9
: client stopped due to errorPetMessage
Safety
The method dereferences from the raw pointer arguments. Therefore, the behavior of the method is undefined if the arguments don't point to valid objects.
If the client panicked (error code 1
), it is the users responsibility to not access possibly
invalid client state and to drop the client.